.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/traffic_assignment/plot_forecasting_custom_vdfs.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_traffic_assignment_plot_forecasting_custom_vdfs.py: .. _example_usage_forecasting_custom_vdfs: Forecasting with a custom VDF ============================= In this example, we use the built-in BPR volume-delay function (VDF) for the base-year assignment in Sioux Falls. We then estimate future demand and use a custom quadratic VDF for the future-year assignment with select link analysis. See the :ref:`original forecasting example ` for the full model setup, including gravity model calibration and trip length frequency plots. .. GENERATED FROM PYTHON SOURCE LINES 15-31 .. code-block:: Python from dataclasses import replace from os.path import join from tempfile import gettempdir from uuid import uuid4 import matplotlib.pyplot as plt import numpy as np import pandas as pd from aequilibrae.distribution import Ipf from aequilibrae.examples import create_example from aequilibrae.traffic import VDF, TrafficAssignment, TrafficClass from aequilibrae.traffic.vdf import bpr from aequilibrae.utils import basic_config .. GENERATED FROM PYTHON SOURCE LINES 32-36 Base-year assignment with the built-in BPR VDF ---------------------------------------------- We use the built-in BPR VDF to run the base-year assignment with skims for ``free_flow_time`` and ``distance``. .. GENERATED FROM PYTHON SOURCE LINES 36-78 .. code-block:: Python # We create the example project inside our temp folder. fldr = join(gettempdir(), uuid4().hex) project = create_example(fldr) # We'll also apply a basic logging configuration. basic_config() network = project.road.build_network() proj_matrices = project.matrices # Load the demand matrix core for computation. demand = proj_matrices.get_matrix("demand.omx", subset=["matrix"]) # Create the assignment class assigclass = TrafficClass( name="car", mode="c", cost="free_flow_time", demand=demand, skimming=["free_flow_time", "distance"], # Every node in Sioux Falls is a centroid, so paths must pass through centroids. graph_options={"block_centroid_flows": False}, ) # Configure the VDF, network fields, and assignment algorithm. assig = TrafficAssignment( network=network, project=project, classes=[assigclass], vdf=bpr, name_mapping={"alpha": "b", "beta": "power"}, time_field="free_flow_time", capacity_field="capacity", algorithm="bfw", ) assig.execute(max_iterations=1000, rgap=0.001) # Save the results to the project database and the skims to OMX. assig.save_results("base_year_assignment") assig.save_skims("base_year_assignment_skims", which_ones="all", format="omx") .. rst-class:: sphx-glr-script-out .. code-block:: none Equilibrium Assignment : 0%| | 0/1000 [00:00`. Direction can be one of 0, 1, or -1, where 0 denotes bi-directionality. .. GENERATED FROM PYTHON SOURCE LINES 155-158 We reuse the base-year traffic class settings with the future-year demand and select link sets. Unlike the base-year BPR assignment, which maps its parameters to network fields, this assignment uses the same values of ``a`` and ``b`` on every link. .. GENERATED FROM PYTHON SOURCE LINES 158-173 .. code-block:: Python assigclass = replace(assigclass, demand=future_demand, select_link_sets=select_links) # Configure the VDF, network fields, and assignment algorithm. assig = TrafficAssignment( network=network, project=project, classes=[assigclass], vdf=vdf, name_mapping={"a": 0.15, "b": 1.0}, time_field="free_flow_time", capacity_field="capacity", algorithm="bfw", ) assig.execute(max_iterations=500, rgap=0.00001) .. rst-class:: sphx-glr-script-out .. code-block:: none :16: UserWarning: Input string name has a space in it. Replacing with _ Equilibrium Assignment : 0%| | 0/500 [00:00
matrix_ab matrix_ba matrix_tot Preload_AB Preload_BA Preload_tot Congested_Time_AB Congested_Time_BA Congested_Time_Max Delay_factor_AB Delay_factor_BA Delay_factor_Max VOC_AB VOC_BA VOC_max PCE_AB PCE_BA PCE_tot
link_id
1 6639.163971 0.0 6639.163971 0.0 0.0 0.0 7.597156 0.0 7.597156 1.266193 0.0 1.266193 0.256336 0.0 0.256336 6639.163971 0.0 6639.163971
2 9895.652131 0.0 9895.652131 0.0 0.0 0.0 5.798584 0.0 5.798584 1.449646 0.0 1.449646 0.422828 0.0 0.422828 9895.652131 0.0 9895.652131
3 6690.913284 0.0 6690.913284 0.0 0.0 0.0 7.610070 0.0 7.610070 1.268345 0.0 1.268345 0.258334 0.0 0.258334 6690.913284 0.0 6690.913284
4 6436.786101 0.0 6436.786101 0.0 0.0 0.0 12.755098 0.0 12.755098 2.551020 0.0 2.551020 1.298215 0.0 1.298215 6436.786101 0.0 6436.786101
5 9443.280626 0.0 9443.280626 0.0 0.0 0.0 5.711683 0.0 5.711683 1.427921 0.0 1.427921 0.403499 0.0 0.403499 9443.280626 0.0 9443.280626
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
72 10817.949256 0.0 10817.949256 0.0 0.0 0.0 15.463032 0.0 15.463032 3.865758 0.0 3.865758 2.163590 0.0 2.163590 10817.949256 0.0 10817.949256
73 7053.484520 0.0 7053.484520 0.0 0.0 0.0 5.356482 0.0 5.356482 2.678241 0.0 2.678241 1.388889 0.0 1.388889 7053.484520 0.0 7053.484520
74 12379.157753 0.0 12379.157753 0.0 0.0 0.0 17.273001 0.0 17.273001 4.318250 0.0 4.318250 2.431455 0.0 2.431455 12379.157753 0.0 12379.157753
75 12467.523096 0.0 12467.523096 0.0 0.0 0.0 13.586815 0.0 13.586815 4.528938 0.0 4.528938 2.552019 0.0 2.552019 12467.523096 0.0 12467.523096
76 7708.907824 0.0 7708.907824 0.0 0.0 0.0 5.727144 0.0 5.727144 2.863572 0.0 2.863572 1.517947 0.0 1.517947 7708.907824 0.0 7708.907824

76 rows × 18 columns



.. GENERATED FROM PYTHON SOURCE LINES 174-176 To save our select link results, all we need to do is provide it with a name. In addition to exporting the select link flows, it also exports the Select Link matrices in OMX format. .. GENERATED FROM PYTHON SOURCE LINES 176-178 .. code-block:: Python assig.save_select_link_results("select_link_analysis") .. GENERATED FROM PYTHON SOURCE LINES 179-186 .. note:: Say we just want to save our select link flows, we can call: ``assig.save_select_link_flows("just_flows")`` Or if we just want the select link matrices: ``assig.save_select_link_matrices("just_matrices")`` Internally, the ``save_select_link_results`` calls both of these methods at once. .. GENERATED FROM PYTHON SOURCE LINES 188-189 We can export the results to CSV or AequilibraE Data, but let's put it directly into the results database .. GENERATED FROM PYTHON SOURCE LINES 189-191 .. code-block:: Python assig.save_results("future_year_assignment") .. rst-class:: sphx-glr-script-out .. code-block:: none ResultRecord(scenario=None, year=None, table_name='future_year_assignment', reference_table='links', procedure='traffic assignment', procedure_id='5c59a8898a4b4e30bf5974e1c7681011', procedure_report='{"convergence": {"iteration": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 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, 112, 113, 114, 115, 116, 117, 118, 119, 120], "time": [0.001578222000034657, 0.0026910689999795068, 0.0038654700000506637, 0.005285211000000345, 0.0062476379999907294, 0.007377539999993132, 0.00882238100007271, 0.01024205900000652, 0.01120970900001339, 0.012279699000032451, 0.013869538999983888, 0.015268445000060638, 0.016372637000017676, 0.017791321000004245, 0.019428179999977147, 0.0210919680000643, 0.02283462800005509, 0.023966647000065677, 0.025177388000088285, 0.026903551000032166, 0.028248603000065486, 0.029668366000009883, 0.031023859000015364, 0.03250296500004879, 0.03391251300001841, 0.03536903799999891, 0.03682962499999576, 0.03779767600008199, 0.03891133299998728, 0.04029949400000987, 0.0416574790000368, 0.0430943250000837, 0.04458128700002817, 0.04612182400001075, 0.04769228200007092, 0.049295973000084814, 0.050892241000042304, 0.05239033800000925, 0.053996808000079, 0.055527649000055135, 0.05717904200002977, 0.05881164700008412, 0.060553557000048386, 0.062032162000036806, 0.06353253899999345, 0.06511963399998422, 0.06659449300002507, 0.06797344200003863, 0.0693262480000385, 0.07081938700002866, 0.07241214900000159, 0.07459221600004184, 0.07694107400004668, 0.0790002450000884, 0.08059594899998501, 0.08215987599999153, 0.08375663800006805, 0.08519559000001209, 0.08676560499998232, 0.08818295000003218, 0.08991591000005883, 0.09186485200007155, 0.09343292800008385, 0.09506999000006999, 0.09663909900007184, 0.09818085799997789, 0.09970271400004549, 0.10173044600003323, 0.1033704440000065, 0.10493448800002625, 0.10640476700007184, 0.10792356299998573, 0.10929611000005934, 0.11100472200007516, 0.11268827300000339, 0.11427138500005185, 0.11580965899997864, 0.11736027699998886, 0.11935271599998032, 0.12141444100006993, 0.12363606400003846, 0.12566742199999226, 0.1277215380000598, 0.12975379700003487, 0.13195073800000046, 0.13396142600004168, 0.13587473900008717, 0.13775765600007617, 0.1398802250000699, 0.14209841600006712, 0.14422367100007705, 0.14596750100008649, 0.1477782310000748, 0.14939451700001882, 0.15092627700005323, 0.1525934790000747, 0.15411256300001241, 0.15562983900008476, 0.15707435100000566, 0.15871120100007374, 0.16007227099999, 0.16152731400006815, 0.16313049699999738, 0.16485806000002867, 0.16657032199998412, 0.16816807800000788, 0.1697686380000505, 0.1712818519999928, 0.17290608600001178, 0.17440847800003212, 0.17589653499999258, 0.17742421500008732, 0.17911845800006176, 0.1807150880000563, 0.18236149599999862, 0.18374868600005811, 0.18512661199997638, 0.18651409100004912, 0.18784748400003082, 0.18848569300007512], "rgap": [null, 0.3223941243523036, 0.09357018047812077, 0.07923928477897003, 0.05272055863676113, 0.024063989953914258, 0.020023056003165837, 0.020711669125475066, 0.02041460881665271, 0.008618029467741052, 0.006622049597625763, 0.006905027620402019, 0.004963252832746507, 0.0028540342285293674, 0.0024702862389784563, 0.002119796580678417, 0.0018820098520840555, 0.00135184626449878, 0.0008274989061310867, 0.00099994845642748, 0.0007466237173198362, 0.0007867039017211382, 0.0006782802346574176, 0.0006827583127430937, 0.00046380661319168567, 0.000434157691760241, 0.00029799564159543423, 0.000344269195434648, 0.00025558895811940836, 0.0003766324442828823, 0.0002899447846794078, 0.00020706390930251008, 0.0001770263029561657, 0.0001756019693794029, 0.00017434858437017923, 0.0001303483765982148, 0.00025726197166742247, 0.00029339997717893934, 0.00026901446603898094, 0.00022835609802492274, 0.0001731874366963136, 0.00011130344128112094, 9.385535724805085e-05, 9.800032909573769e-05, 8.767591077514167e-05, 8.213740696294912e-05, 0.00011879859081355616, 8.541427167954302e-05, 7.54352117415235e-05, 5.960812350710768e-05, 5.934446548772382e-05, 5.575106486914005e-05, 6.805890121612594e-05, 8.564940250801808e-05, 5.024623229152887e-05, 4.440112616078379e-05, 3.357586076849172e-05, 4.126448714522453e-05, 2.6986152859987166e-05, 3.8910327828532135e-05, 2.835966458376054e-05, 2.750611955014915e-05, 1.9129080981919076e-05, 2.9260762592204155e-05, 2.2435024800193848e-05, 1.8615219723601283e-05, 3.953530970751043e-05, 3.080419890778753e-05, 3.844200617570496e-05, 3.722455855699241e-05, 3.7825126527823346e-05, 2.0744854758831172e-05, 2.369992938146248e-05, 2.3134545712476698e-05, 2.9264052777819312e-05, 2.1765164253471405e-05, 3.566762627503249e-05, 4.053837053764926e-05, 3.384335112807597e-05, 2.5528270711052906e-05, 2.755599455564612e-05, 2.5673236505775155e-05, 1.8279183768696748e-05, 1.5838286799121645e-05, 2.114608813961428e-05, 2.091376654920179e-05, 2.300407268004993e-05, 2.2844355821756672e-05, 3.4771814035883626e-05, 2.2196402274603875e-05, 2.9985861911859455e-05, 3.922904744794232e-05, 3.0174054644652853e-05, 3.168733332341519e-05, 2.7460663775751664e-05, 3.079188600129104e-05, 3.935109308546661e-05, 4.257288488683426e-05, 3.615813713813854e-05, 1.85053427729722e-05, 3.2783058572862687e-05, 2.9619772848403064e-05, 2.5454358008003235e-05, 2.3199126074190085e-05, 2.3310188807123624e-05, 1.9095652646520414e-05, 1.8122514332538013e-05, 1.376758596490481e-05, 1.8861827038869915e-05, 1.757596834900561e-05, 2.7872956403421784e-05, 2.1880803576748163e-05, 2.023787303637853e-05, 2.101086017872273e-05, 1.3379974778550379e-05, 1.9805610746524624e-05, 1.8921196909970572e-05, 1.8602577977303668e-05, 1.8957814088473183e-05, 9.930649106405912e-06], "alpha": [1.0, 0.33187502048731193, 0.6951428774868275, 1.0, 0.22654884487006757, 0.49901609565950056, 0.9801611164469147, 1.0, 0.2021920344412951, 0.3683127165134708, 0.5986113594426272, 1.0, 0.20133821276071037, 0.29516898871034225, 0.30816326448343545, 0.6737996289141311, 1.0, 0.026639626585763253, 0.10747770976491126, 0.17102988722957405, 0.09180840927279747, 0.22106001264094868, 0.4251899845584049, 0.3189901231348956, 0.5561040429461434, 0.5752969588946937, 1.0, 0.032101426856685836, 0.06738998679497883, 0.05863302283513457, 0.11423809786588558, 0.036218660600385214, 0.03558652135082141, 0.04153878911817082, 0.038709391083407686, 0.09157212083834917, 0.12687734570323012, 0.35541788743975106, 0.20730231274723487, 0.3177800176804049, 0.11773815879935567, 0.2209741690978756, 0.1183860356792874, 0.10331354690557597, 0.04993840641353142, 0.09599935685362772, 0.06117185120477985, 0.056127846519005584, 0.037649819596905255, 0.017451863763820397, 0.028294752185959816, 0.04765913631901637, 0.046337487032504544, 0.0388525837681397, 0.014456023111903846, 0.0033683681481340927, 0.008057923749275026, 0.018407274055185132, 0.013485297866066068, 0.008066652110541, 0.003686506336939814, 0.002688367284634951, 0.004231647097474791, 0.008361670000152057, 0.0032268470024802137, 0.008331779174619027, 0.015466783937626282, 0.017854562390173075, 0.015539726750990173, 0.018049524243151087, 0.011844924534706255, 0.004908953910100366, 0.0027223663105980147, 0.006337835553419776, 0.0033380921241578623, 0.009164855303112424, 0.015090516827860168, 0.025688123093944276, 0.015253171214024796, 0.032623517281280455, 0.01877238587401287, 0.021093734249835558, 0.007994083316258496, 0.025307916535865033, 0.027189121835911084, 0.014294944840708059, 0.02251909223592083, 0.018379067357526514, 0.01343518643643869, 0.04528630718622678, 0.03497686960757042, 0.04767850988802423, 0.056525442936407315, 0.03424503202359612, 0.05691692088563952, 0.09231427314511022, 0.06758401453416042, 0.06719578667979263, 0.04767494194993235, 0.022730713126585877, 0.02300155304023501, 0.07319513604506607, 0.025237610456714247, 0.04014392379289098, 0.030661896439875526, 0.013776383012979673, 0.01010047230463416, 0.010629390692799601, 0.00831018584163675, 0.024918388131346, 0.013680487521100954, 0.03040081227414036, 0.017112754688597277, 0.011733639490179507, 0.017460448939350084, 0.012405279229558957, 0.0119508553378613, 0.010445060383517614, 0.015227363299282586, null], "warnings": ["", "", "", "", "Invalid BFW mu coefficient; using the Frank-Wolfe direction.", "", "", "", "Invalid BFW mu coefficient; using the Frank-Wolfe direction.", "", "", "", "Invalid BFW mu coefficient; using the Frank-Wolfe direction.", "", "", "", "", "Invalid BFW mu coefficient; using the Frank-Wolfe direction.", "", "", "", "", "", "", "", "", "", "Invalid BFW mu coefficient; using the Frank-Wolfe direction.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], "beta0": [1.0, 1.0, 1.0, 0.22829820775270002, 1.0, 1.0, 0.3174493255979457, 0.005132311735498084, 1.0, 0.8466625611877038, 0.32732944204248704, 0.11175370193808999, 1.0, 0.8335213366030478, 0.299833209208152, 0.19641483802382376, 0.08959803484485976, 1.0, 0.9515174708459082, 0.525620644704321, 0.329732812713737, 0.21484486968922015, 0.26860220165371557, 0.15226855758438013, 0.08787033336043117, 0.03182485419921539, 0.03585656290817054, 1.0, 0.7761748027426904, 0.3465753303249402, 0.3824862254205571, 0.4915966022434132, 0.34429994146860005, 0.539426887280814, 0.5049435226824202, 0.5543829862399327, 0.15038471326292127, 0.06289190669671452, 0.04683121647843, 0.04778532523717647, 0.10502904925053447, 0.10000046205932528, 0.14161738097621995, 0.07535416994723845, 0.14658007203849385, 0.24585521661802673, 0.09476206641073041, 0.12972923882009338, 0.1338504562266067, 0.6798101222264189, 0.2595697879715875, 0.28138682891960504, 0.17601374576298884, 0.07582360748870291, 0.2093219342929863, 0.5975333481823814, 0.8284171380453652, 0.4431725879070089, 0.4656247752067836, 0.16199618076443698, 0.38373476427957454, 0.5392619809448339, 0.869085951092941, 0.4211966034089498, 0.46915406260224224, 0.6484365708704906, 0.2366793383018823, 0.29799516111502833, 0.193215757512507, 0.11320437124543681, 0.20497385713760696, 1.0, 0.14417638227948554, 0.6424984310179698, 0.4883500158105188, 0.5432589447340198, 0.24315835275391484, 0.14425060371090365, 0.1306535464267691, 0.17279538205192463, 0.11310235954222966, 0.12745568046826256, 0.11598071343284448, 0.1711859237742598, 0.11769196456515192, 0.14113184431159598, 0.09124394698225968, 0.31424901798281163, 0.088869188406441, 0.15424589372685638, 0.142056053995806, 0.07228426124706461, 0.08270279903501852, 0.05500291326703065, 0.0860546104396915, 0.09447561240108611, 0.05787368964188286, 0.02755207257144091, 0.13509560400275122, 0.17401276099389962, 0.08557121516748795, 0.10777944570650579, 0.0724894299039166, 0.1302572595268938, 0.11916627238267714, 0.09648594087152673, 0.10322434655298982, 0.31240434632177705, 0.16365028033554044, 0.21108012942014606, 0.11195888939282861, 0.09295980913330978, 0.22423919997286898, 0.08334277161099314, 0.251648515158055, 0.11418714217388458, 0.08351826806986849, 0.2807865497499727, 0.13555078253353153, null], "beta1": [0.0, 0.0, 0.0, 0.7582983130674362, 0.0, 0.0, 0.6825506744020542, 0.9870132185546325, 0.0, 0.1533374388122962, 0.672670557957513, 0.7293450364965545, 0.0, 0.16647866339695214, 0.6180387732607467, 0.5492048429057037, 0.8397873897503958, 0.0, 0.04848252915409181, 0.474379355295679, 0.5609487664412314, 0.327204309178877, 0.5193252781003915, 0.8477314424156199, 0.5321740992643618, 0.8391287091728681, 0.6218896040545954, 0.0, 0.22382519725730962, 0.602682965263711, 0.2889255714542851, 0.34329737587590514, 0.11875391841992236, 0.27091333532486767, 0.3813252314883327, 0.0, 0.5626409557973104, 0.6424712949226473, 0.7511035212211659, 0.36853272772167384, 0.8949709507494654, 0.3283827058615058, 0.8583826190237801, 0.6145299665217407, 0.41956600731625276, 0.420234648697202, 0.6360100871858503, 0.38442380061707815, 0.44114743592714784, 0.0, 0.12509540226858193, 0.45618886611470694, 0.5181888647471286, 0.6164342904072113, 0.0, 0.40246665181761854, 0.1715828619546347, 0.4499594394235438, 0.5343752247932165, 0.5839574569220579, 0.0, 0.4607380190551661, 0.13091404890705902, 0.5788033965910502, 0.5208852457447708, 0.13938857952427852, 0.6711868685854274, 0.049194380786439944, 0.3979493927300875, 0.3534463996677908, 0.5902170737489364, 0.0, 0.13374198445783894, 0.0, 0.5116499841894813, 0.0, 0.659479438092863, 0.46871020975608363, 0.6311598915467884, 0.5177992318012525, 0.8868976404577704, 0.18204215484101705, 0.668018673285697, 0.4897794252474176, 0.8823080354348481, 0.5361444974580829, 0.4741946771028692, 0.5769959375568385, 0.4138243048333511, 0.3637024787947431, 0.759332035593694, 0.43302056807529543, 0.4886014287856004, 0.7406465453547, 0.494207923959397, 0.905524387598914, 0.8967955498630469, 0.5935396120209941, 0.7663178048050081, 0.8259872390061005, 0.7272829247710045, 0.2421265716651998, 0.8284679011149843, 0.5678217982903685, 0.8648229135009046, 0.5243195043435536, 0.07623298046063227, 0.18932080705646465, 0.8363497196644596, 0.1744627620761961, 0.707616288117174, 0.348976597192827, 0.775760800027131, 0.3977420811580296, 0.0, 0.7201630468154744, 0.36639769228488606, 0.5873498124491305, 0.40318062383630954, null], "beta2": [0.0, 0.0, 0.0, 0.013403479179863929, 0.0, 0.0, 0.0, 0.007854469709869421, 0.0, 0.0, 0.0, 0.15890126156535544, 0.0, 0.0, 0.08212801753110124, 0.2543803190704726, 0.0706145754047444, 0.0, 0.0, 0.0, 0.10931842084503153, 0.4579508211319028, 0.21207252024589296, 0.0, 0.37995556737520714, 0.12904643662791654, 0.342253833037234, 0.0, 0.0, 0.05074170441134888, 0.3285882031251578, 0.16510602188068177, 0.5369461401114777, 0.18965977739431836, 0.11373124582924721, 0.4456170137600674, 0.2869743309397684, 0.2946367983806381, 0.20206526230040414, 0.5836819470411496, 0.0, 0.571616832079169, 0.0, 0.31011586353102083, 0.43385392064525335, 0.3339101346847713, 0.2692278464034194, 0.4858469605628285, 0.4250021078462455, 0.32018987777358116, 0.6153348097598306, 0.26242430496568814, 0.3057973894898826, 0.30774210210408565, 0.7906780657070138, 0.0, 0.0, 0.10686797266944727, 0.0, 0.25404636231350514, 0.6162652357204255, 0.0, 0.0, 0.0, 0.00996069165298683, 0.2121748496052309, 0.09213379311269027, 0.6528104580985319, 0.4088348497574055, 0.5333492290867724, 0.20480906911345656, 0.0, 0.7220816332626755, 0.35750156898203017, 0.0, 0.45674105526598013, 0.09736220915322208, 0.3870391865330127, 0.23818656202644245, 0.3094053861468228, 0.0, 0.6905021646907203, 0.2160006132814586, 0.3390346509783227, 0.0, 0.3227236582303211, 0.43456137591487115, 0.10875504446034989, 0.49730650676020804, 0.48205162747840047, 0.09861191041049987, 0.49469517067763996, 0.42869577217938104, 0.20435054137826927, 0.4197374656009114, 0.0, 0.045330760495070184, 0.378908315407565, 0.09858659119224056, 0.0, 0.18714586006150738, 0.6500939826282944, 0.09904266898109906, 0.3019209421827377, 0.01601081411641831, 0.37919455478491954, 0.8205426729863778, 0.49827484662175825, 0.0, 0.6144571085036579, 0.1804248224899975, 0.5580635936738632, 0.0, 0.5189151472309771, 0.748351484841945, 0.165649811010641, 0.5500840396452454, 0.13186363780089683, 0.4612685936301589, null], "conjugacy_prev": [null, null, null, 0.032084169006361234, null, null, -1.138931598177012e-16, -0.006733930954286869, null, null, 7.010592843690111e-17, -0.009237135982460301, null, null, -0.0012046150363949622, -0.0009857730383747664, 4.1960145525503796e-05, null, null, -1.1531988511766286e-16, 0.00015226561163722395, 0.0003925839110822456, 0.0005367661175090077, 1.1761726385055107e-17, -0.00016708962740306875, 0.00012049412859770117, 8.505057367844091e-05, null, null, -9.085215068173996e-06, 0.00012502688973851762, -9.358207354729454e-05, -1.1690537944343212e-05, 2.282701709031884e-05, 1.702193912229629e-05, 0.07866032825709308, 0.0610910035880669, 0.06555432920497864, 0.025341924418992266, 0.011420736492670147, 1.11804471656124e-16, 1.6191962144482885e-05, -1.663345448910551e-17, 5.5373581381105645e-05, -4.780151031312521e-07, 3.9170198317599025e-06, 3.6429335292436075e-05, 3.0145986557820104e-05, 3.28016931664355e-05, 0.2028686158774044, 0.08921756024602523, 0.062458754046997106, 0.02584034603828525, 0.01048562154667776, 0.24789609122097156, 2.2373913836020858e-17, -1.1824513290632794e-16, 1.8907221892847243e-05, -5.801376670316275e-17, -8.767421345291042e-06, 0.11866523688112565, 1.136932975922716e-16, -1.2364651369110377e-17, 1.2385708733137412e-16, 8.733599358541596e-07, -4.477294868191454e-07, -5.7957352336403715e-08, 6.5820751420726355e-06, 1.923799513611809e-05, 1.8312643917646942e-05, -2.24725518941439e-06, 0.29242884994941254, 0.21280182790787475, 0.147404530329808, 6.9089606457782004e-18, 0.16777496197518663, 0.04536221388555458, 0.04229384416652435, 0.013779221335061898, 0.005286392424865021, 9.413807648865103e-17, -1.1919687568697392e-05, -6.280753633733763e-06, 7.626520281929077e-07, 2.2171529243777607e-16, 1.9187633735464495e-06, 1.972194385805083e-05, 1.3351107518727377e-06, -5.386087031860483e-06, -5.85344490480102e-05, -6.162415123379612e-06, 1.8065411057367602e-06, -5.273232626138001e-05, -9.269246538492679e-06, -1.279785048180359e-05, -1.768794712751566e-17, -3.5512582699585275e-07, -1.9800264022123537e-05, -1.6109752834049881e-07, 1.3254613268365526e-16, 4.762812917158719e-06, -1.2659362029009493e-05, 5.547317976818809e-06, -2.973117548419194e-06, -4.6456853809779856e-07, -6.575956537310649e-06, -9.06569876700264e-06, 2.1264827344058184e-05, -3.7433644207943115e-18, 5.4630773360129725e-06, 4.1423613199827415e-06, 1.3782614534749749e-05, 5.660199070637677e-17, -1.802621880469509e-05, 0.16081005466675377, 0.024240928119953133, 0.015982932466176557, 0.0012353888782952536, 0.0005000180689895884, null], "conjugacy_prev2": [null, null, null, 0.28861233280261056, null, null, 0.36139364052909106, -0.01256827601574007, null, null, 0.19525156213896824, -0.013989219637948972, null, null, -0.005182068891912626, -0.0016732564678957728, 0.00012922525370578282, null, null, 0.28144083826805505, 0.0005611540107889414, 0.0006895360864999538, 0.0008482114072195478, 0.07114296752420192, -0.0004146105646999141, 0.0002795086435841275, 0.00013123308905464576, null, null, -5.9065947550578465e-05, 0.0002061655516092309, -0.00017901889801911838, -2.64329097048695e-05, 4.3312960561242764e-05, 8.498618255210728e-05, 0.00016005977436114898, 0.10068235313679617, 0.12027977597114387, 0.036716803208381055, 0.024987981274315188, 0.34423676778506646, 7.026710804591256e-05, 0.22726415489330334, 0.00027893557402802505, -7.631210636564102e-07, 1.7786388118900322e-05, 0.00010539093350017044, 5.24447242120263e-05, 6.960653414331578e-05, 4.9447937682928455e-06, 0.3224963149348479, 0.07738162525793715, 0.054915800832368966, 0.02816336741648161, 0.003764119353754785, 0.0736504031351129, 0.2577327223883371, 6.491129097623017e-05, 0.6668765583387579, -2.8149166082673043e-05, -1.1328643897097957e-05, 0.2556709102843701, 0.020738208181077543, 0.2880362606137465, 2.8390818245725575e-05, -1.10934838022186e-06, -3.1835934578760253e-07, 4.54113402283602e-06, 3.491205314422465e-05, 2.942751502128619e-05, -6.081595163591976e-06, 0.09480408597267918, 0.6453327559836021, 0.039755972589336754, 0.22626048979635507, -2.466934013927972e-06, 0.19244199575319582, 0.060770665913303705, 0.03135458971903284, 0.01626913473939553, 0.2720981778886067, -1.695986068179789e-05, -2.4788065591722223e-05, 2.470312967657979e-06, 0.2694266162282143, 4.7107105789066875e-06, 6.276337785794991e-05, 5.6091160181616305e-06, -2.028574840341506e-05, -7.92070073562671e-05, -2.9743975700455085e-05, 4.346471150564009e-06, -7.780926636510887e-05, -3.658609163033729e-05, -3.0627538297165384e-05, 0.006770422188073664, -6.1888627087251915e-06, -5.3978960179445316e-05, -1.0176466236964767e-06, 0.15169387832006992, 2.8080968446793535e-05, -1.611646857549425e-05, 2.9469060443420467e-05, -1.1663306167420216e-05, -2.5537245571827558e-05, -1.735990858509168e-05, -1.2248009224966626e-05, 3.4661104185335224e-05, 0.042854559875606976, 6.73614310268541e-06, 1.2691150997124036e-05, 2.8048334793575075e-05, 0.2565316745983416, -6.426441010881177e-05, -3.275229917718664e-05, 0.14649613020204574, 0.025572160636345386, 0.00578711972181195, 0.001842033007240521, null], "hessian_drift": [null, null, null, 0.24895137052950767, null, null, 0.1785968829710882, -0.007879012164404536, null, null, 0.011403623978219216, -0.01050829762530083, null, null, -0.005735588587889454, -0.0015263962669697063, 0.00020117578070021048, null, null, 0.0002269619956274336, 0.000942829005521021, 0.0005157353201502594, 0.0011134609101999006, -0.0006421861133959051, -0.00031670888225401167, 0.0003723093403397816, 0.00021216340460278633, null, null, -8.428201608477237e-05, 0.00023424651334385708, -0.0006765595968888579, -3.264697252116021e-05, 0.00011247355364511535, 0.0001788829955004693, 0.00022015581887541215, 0.07824956469291931, 0.06113754736413354, 0.06514911412199503, 0.025250045220178388, 0.011704413268082577, 5.052066947755853e-05, 2.1458564181860244e-05, 0.00027298834412089584, -1.891902130738023e-06, 2.2439050473541646e-05, 0.00012044679276357225, 6.64888979033718e-05, 9.923813545581653e-05, 4.721893651838092e-05, 0.20280831829712825, 0.08918034096533983, 0.0625185286593901, 0.02587606463896019, 0.010381623530277682, 0.24787562769355462, -1.3305292889617342e-05, 6.30482829269785e-05, -5.94974797630463e-05, -3.118036188965676e-05, -3.601977371931216e-05, 0.11864362165834005, -6.065094320658248e-06, -1.464179979874191e-05, 8.023210810213152e-05, -2.109768465825733e-06, -2.717833986111167e-07, 6.056999713771788e-06, 4.2483624367200024e-05, 2.3557561038694443e-05, -1.3043101872786786e-05, 3.6369044527140476e-05, 0.2924328864563097, 0.21280633168477286, 0.14738821618386996, -2.9749206445678374e-06, 0.1677833292169167, 0.045438321480556085, 0.04215886929458321, 0.013753867151973168, 0.005230451957932287, -1.9147611866051798e-05, -3.745304549263457e-05, 1.909607579522824e-06, -3.4226483079048858e-06, 8.468169025898774e-06, 4.70774264817191e-05, 1.71303760548133e-05, -1.740512156258967e-05, -5.4424595663120356e-05, -4.608778455255899e-05, 3.39248604153992e-06, -7.674037453403826e-05, -4.405960494980127e-05, -3.134008037104083e-05, -4.9638242904279435e-05, -7.483941533952365e-06, -4.2848720222109505e-05, -3.055962303679334e-06, 3.1384597177982286e-05, 2.915567745385386e-05, -1.105676106200428e-05, 4.438720583919151e-05, -1.3959810931672993e-05, -3.3136835468581296e-05, -2.408363035377875e-05, -1.6296934038522143e-05, 7.526874194711773e-05, 2.775401461391435e-05, 5.451060654929773e-06, 1.814171179006947e-05, 1.697962974954431e-05, 4.746637105664777e-05, -5.350823507653844e-05, -5.033995907936767e-05, 0.16080565275999006, 0.02425388368141627, 0.015983490330070557, 0.001251010835538635, null], "bfw_clamped": [null, null, null, false, null, null, true, false, null, null, true, false, null, null, false, false, false, null, null, true, false, false, false, true, false, false, false, null, null, false, false, false, false, false, false, true, false, false, false, false, true, false, true, false, false, false, false, false, false, true, false, false, false, false, true, true, true, false, true, false, true, true, true, true, false, false, false, false, false, false, false, true, false, true, true, true, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false, false, false, false, false, false, false, true, false, false, false, true, false, true, false, false, false, false, null]}, "setup": {"Algorithm": "bfw", "Classes": {"car": {"network mode": "c", "cost": "free_flow_time", "PCE": 1.0, "Value-of-time": 1.0, "Fixed cost field": null, "Fixed cost multiplier": 1.0, "matrix_totals": {"matrix": 376633.2544564052}}}, "Computer name": "runnervm0hi8g", "Maximum iterations": 500, "Procedure ID": "5c59a8898a4b4e30bf5974e1c7681011", "Target RGap": 1e-05}}', timestamp='2026-11-23 06:36:13.988061', description='') .. GENERATED FROM PYTHON SOURCE LINES 192-193 And save the skims .. GENERATED FROM PYTHON SOURCE LINES 193-195 .. code-block:: Python assig.save_skims("future_year_assignment_skims", which_ones="all", format="omx") .. rst-class:: sphx-glr-script-out .. code-block:: none ['future_year_assignment_skims_car.omx'] .. GENERATED FROM PYTHON SOURCE LINES 196-198 Run convergence study ~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 198-213 .. code-block:: Python df = assig.report() x = df.iteration.values y = df.rgap.values fig = plt.figure() ax = fig.add_subplot(111) plt.plot(x, y, "k--") plt.yscale("log") plt.grid(True, which="both") plt.xlabel("Iterations") plt.ylabel("Relative Gap") plt.show() .. image-sg:: /_auto_examples/traffic_assignment/images/sphx_glr_plot_forecasting_custom_vdfs_001.png :alt: plot forecasting custom vdfs :srcset: /_auto_examples/traffic_assignment/images/sphx_glr_plot_forecasting_custom_vdfs_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 214-215 Close the project .. GENERATED FROM PYTHON SOURCE LINES 215-217 .. code-block:: Python project.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.569 seconds) .. _sphx_glr_download__auto_examples_traffic_assignment_plot_forecasting_custom_vdfs.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_forecasting_custom_vdfs.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_forecasting_custom_vdfs.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_forecasting_custom_vdfs.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_