The Cosimulation Graph Engine¶
GraphEngine is a class that represents a graph structure based on * FMUs and/or symbolic nodes * connections (namely edges) It uses networkx library to build and manipulate the graph.
Custom dependencies: the method plot_graph uses GraphPlotter
Initialize the GraphEngine instance, set up the FMU and connection lists, and construct the graph.
| PARAMETER | DESCRIPTION | 
|---|---|
| fmu_list | List of FMU data (each FMU represented as a dictionary). 
                  
                    TYPE:
                       | 
| symbolic_nodes | List of symbolic nodes (each node represented as a dictionary). 
                  
                    TYPE:
                       | 
| conn_list | List of connections (each connection represented as a dictionary). 
                  
                    TYPE:
                       | 
| edge_sep | Separator used for edge labels. Default is " -> ". 
                  
                    TYPE:
                       | 
Source code in cofmpy/graph_engine.py
                    | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |  | 
plot_graph ¶
plot_graph(savefig=False)
Plot a graph representation of the co-simulation diagram.
This method generates a Plotly figure showing nodes and their connections. It uses NetworkX for node positioning and Plotly for rendering the graph.
| PARAMETER | DESCRIPTION | 
|---|---|
| savefig | Whether to save the figure as an HTML file. Defaults to False. 
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Figure | go.Figure: The Plotly figure object representing the co-simulation diagram. | 
Source code in cofmpy/graph_engine.py
              | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |  |