-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* surrogate training notebook * apply black * updating example * updating tutorial * Run black * adding dataset * applying black * fixing black error * applying black * adding primitive results * applying black adding header * removing commented code * adding position to the nodes * adding pos to the nodes * applying black * adding save figure feature * applying black * adding test * Update pareto/examples/desalination_jupyter_notebooks/desalination_surrogate_training.ipynb * Run black * Increase timeout for utilities tests * Increase timeout for strategic toy case study test * Increase test coverage * Tweak formatting of graphs * Implement show results feature * adding .rst file * adding image with correct extension * updating index.rst * updating index * Edit documentation * Trigger build * Fix indentation * More documentation edits --------- Co-authored-by: JavalVyas2000 <[email protected]> Co-authored-by: Travis Arnold <[email protected]> Co-authored-by: Travis Arnold <[email protected]>
- Loading branch information
1 parent
2585277
commit c4c82fc
Showing
8 changed files
with
405 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Visualization Feature | ||
====================== | ||
|
||
This feature utilizes the `networkx` library to create a graphical visualization of the network model. The method extracts nodes and edges from the model to generate a visual representation, allowing for an intuitive understanding of the network's structure. | ||
|
||
Usage Instructions | ||
------------------ | ||
|
||
To use this feature, first build the model and then call the visualization method as shown below:: | ||
|
||
plot_network(model) | ||
|
||
You can customize the visualization by adjusting the argument values as needed. For example, to display both piping and trucking arcs, you can use:: | ||
|
||
plot_network(model, show_piping=True, show_trucking=True) | ||
|
||
A complete list of the optional keyword arguments for `plot_network()` follows: | ||
|
||
- ``show_piping``: (``bool``, default = ``True``) | ||
Determines whether to display available pipeline arcs within the network. | ||
|
||
- ``show_trucking``: (``bool``, default = ``False``) | ||
Determines whether to display available trucking arcs within the network. | ||
|
||
- ``show_results``: (``bool``, default = ``False``) | ||
If ``True``, the network visualization will highlight the pipelines which are suggested to be built or expanded. The model needs to be in a solved state for this option to have an effect. | ||
|
||
- ``save_fig``: (``str``, default = ``None``) | ||
Specifies the file name for saving the visualization. No figure is saved if a file name is not provided. | ||
|
||
- ``show_fig``: (``bool``, default = ``True``) | ||
If ``True``, the network visualization will be displayed directly after creation. | ||
|
||
- ``pos``: (``dict``, optional) | ||
A dictionary to define the relative positions of the nodes in the format ``{Node: (x, y)}``. For example: ``{R01: (10,10)}``. If this dictionary is not provided, the network elements are displayed in a circular layout. | ||
|
||
Examples | ||
-------- | ||
|
||
The following figures show the network visualization produced for the strategic toy case study, showing both piping and trucking arcs, first with the default circular layout, and second in a layout with custom positioning: | ||
|
||
.. figure:: network_circular.png | ||
:width: 800 | ||
:align: center | ||
:alt: Network visualization in a circular layout | ||
|
||
.. figure:: network.png | ||
:width: 800 | ||
:align: center | ||
:alt: Network visualization with specified positions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.