.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/other_applications/plot_check_logging.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_other_applications_plot_check_logging.py: .. _useful-log-tips: Checking AequilibraE's log ========================== AequilibraE's log is a very useful tool to get more information about what the software is doing under the hood. Information such as Traffic Class and Traffic Assignment stats, and Traffic Assignment outputs. If you have created your project's network from OSM, you will also find information on the number of nodes, links, and the query performed to obtain the data. In this example, we'll use Sioux Falls data to check the logs, but we strongly encourage you to go ahead and download a place of your choice and perform a traffic assignment! .. GENERATED FROM PYTHON SOURCE LINES 18-26 .. code-block:: Python # Imports from uuid import uuid4 from tempfile import gettempdir from os.path import join from aequilibrae.utils.create_example import create_example from aequilibrae.paths import TrafficAssignment, TrafficClass .. GENERATED FROM PYTHON SOURCE LINES 28-29 We create an empty project on an arbitrary folder .. GENERATED FROM PYTHON SOURCE LINES 29-32 .. code-block:: Python fldr = join(gettempdir(), uuid4().hex) project = create_example(fldr) .. GENERATED FROM PYTHON SOURCE LINES 33-34 We build our graphs .. GENERATED FROM PYTHON SOURCE LINES 34-41 .. code-block:: Python project.network.build_graphs() graph = project.network.graphs["c"] graph.set_graph("free_flow_time") graph.set_skimming(["free_flow_time", "distance"]) graph.set_blocked_centroid_flows(False) .. rst-class:: sphx-glr-script-out .. code-block:: none /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/aequilibrae/project/network/network.py:327: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)` df = pd.read_sql(sql, conn).fillna(value=np.nan) .. GENERATED FROM PYTHON SOURCE LINES 42-43 We get our demand matrix from the project and create a computational view .. GENERATED FROM PYTHON SOURCE LINES 43-47 .. code-block:: Python proj_matrices = project.matrices demand = proj_matrices.get_matrix("demand_omx") demand.computational_view(["matrix"]) .. GENERATED FROM PYTHON SOURCE LINES 48-49 Now let's perform our traffic assignment .. GENERATED FROM PYTHON SOURCE LINES 49-64 .. code-block:: Python assig = TrafficAssignment() assigclass = TrafficClass(name="car", graph=graph, matrix=demand) assig.add_class(assigclass) assig.set_vdf("BPR") assig.set_vdf_parameters({"alpha": 0.15, "beta": 4.0}) assig.set_capacity_field("capacity") assig.set_time_field("free_flow_time") assig.set_algorithm("bfw") assig.max_iter = 50 assig.rgap_target = 0.001 assig.execute() .. rst-class:: sphx-glr-script-out .. code-block:: none Equilibrium Assignment: 0%| | 0/50 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_check_logging.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_check_logging.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_