.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/02_visualization/plot_07_dashboard.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_02_visualization_plot_07_dashboard.py: An operability dashboard ======================== :func:`nocad.viz.plot_operability_summary` combines four views of one network: the SCC hierarchy with the designed inputs and outputs, the control and observation depth maps and the operability plane. Here it is applied to a random scale-free network with self-loops on a share of its nodes. .. GENERATED FROM PYTHON SOURCE LINES 12-14 One call, four panels --------------------- .. GENERATED FROM PYTHON SOURCE LINES 14-25 .. code-block:: Python import matplotlib.pyplot as plt import nocad from nocad.datasets import make_random_network from nocad.viz import plot_operability_summary net = make_random_network(40, 1.6, kind="scale_free", self_loops=0.3, random_state=2) # [snippet:summary] fig = plot_operability_summary(net.adj, method="path_finding", title="scale-free network, 40 states") # [/snippet:summary] .. image-sg:: /auto_examples/02_visualization/images/sphx_glr_plot_07_dashboard_001.png :alt: scale-free network, 40 states, SCC hierarchy: 14 driver, 11 sensor nodes, control depth, observation depth, operability plane :srcset: /auto_examples/02_visualization/images/sphx_glr_plot_07_dashboard_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 26-30 Parameter study: the design method ---------------------------------- The exact minimum may need fewer dedicated driver nodes than path finding; the counts for the same network: .. GENERATED FROM PYTHON SOURCE LINES 30-36 .. code-block:: Python for method in ("matching", "signal_sharing", "path_finding", "minimum"): d = nocad.InputOutputDesign(method).fit(net.adj) print(f"{method:15s} inputs={d.n_inputs_:2d} drivers={d.n_drivers_:2d} outputs={d.n_outputs_:2d} " f"sensors={d.n_sensors_:2d} controllable={d.is_controllable()} observable={d.is_observable()}") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none matching inputs= 9 drivers= 9 outputs= 9 sensors= 9 controllable=False observable=False signal_sharing inputs= 9 drivers=14 outputs= 9 sensors=12 controllable=True observable=True path_finding inputs=14 drivers=14 outputs=11 sensors=11 controllable=True observable=True minimum inputs=14 drivers=14 outputs=11 sensors=11 controllable=True observable=True .. GENERATED FROM PYTHON SOURCE LINES 37-40 **Take-away.** A single figure answers the questions a designer asks first: where must the inputs and outputs go, how deep is the network, and which states are hard to reach. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.844 seconds) .. _sphx_glr_download_auto_examples_02_visualization_plot_07_dashboard.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/nocad/main?urlpath=lab/tree/notebooks/auto_examples/02_visualization/plot_07_dashboard.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_07_dashboard.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_07_dashboard.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_07_dashboard.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_