yaocptool.modelling.network package

Submodules

yaocptool.modelling.network.network module

Created on Fri Jul 07 16:05:50 2017

@author: marco

class Network(nodes=None, name='network')[source]

Bases: object

__init__(nodes=None, name='network')[source]
Parameters:of Node nodes (list) –
connect(y, u, node1, node2)[source]
Connect the variables of two subsystems (nodes) by creating an edge
Parameters:
  • y – output variable of node1
  • u – input variable of node2
  • node1 – node1 (which has ‘y’)
  • node2 – node2 (which has ‘u’)
connections
All connections (edges) from the self.graph
Return type:networkx.reportviews.OutEdgeView
create_node(name=None, model=None, problem=None, **kwargs)[source]
Creat a node in the network
Parameters:
Return type:

Node

Returns:

node

get_map_coloring_groups()[source]
get_model()[source]
Create a single model which is the composition of all models and the connections
Returns:model
Return type:SystemModel
get_node_by_id(id)[source]
get_node_by_name(name)[source]
get_problem()[source]
Create a single OCP which is the composition of all problems and connections.
Returns:problem
Return type:OptimalControlProblem
include_nodes(nodes)[source]
Include node or list of nodes in the network
Parameters:nodes (list|Node) – node/nodes
insert_intermediary_nodes()[source]
models
List of models of all nodes
Return type:list of SystemModel
Returns:list of all models
nodes
All nodes (from the self.graph)
Return type:networkx.reportviews.NodeView
plot()[source]

Plot the network

problems
List of problems of all nodes
Return type:list of OptimalControlProblem
Returns:list of all problems
remove_connection(node1, node2)[source]
Remove a connection between node1 and node2
Parameters:

yaocptool.modelling.network.node module

Created on Fri Jul 07 16:33:52 2017

@author: marco

class Node(node_id=None, name='', model=None, problem=None, color=0.25, **kwargs)[source]

Bases: object

__init__(node_id=None, name='', model=None, problem=None, color=0.25, **kwargs)[source]
Parameters:
  • node_id (int) –
  • name (str) –
  • model (yaocptool.modelling.SystemModel) –
  • problem (yaocptool.modelling.OptimalControlProblem) –
  • color (float) –
  • kwargs (dict) –

Module contents