BayAreaMetro / tm2py

Travel Model Two - python edition
https://bayareametro.github.io/tm2py/
Apache License 2.0
2 stars 8 forks source link

🚀 Feature: Change approach to creating reliability skims #146

Open DavidOry opened 1 month ago

DavidOry commented 1 month ago

User Story

The initial version of tm2py faithfully translated the Cube version of the highway procedures into EMME. In Cube, the reliability calculations required skimming the roadway network, doing some roadway calculations, doing an assignment, and then skimming the final best paths. In the assignment algorithm we are using in EMME, creating skims requires doing a roadway assignment. Therefore, the current procedures do two roadway assignments for every iteration, which is costly in terms of runtime. Per @inrokevin, there are procedures in EMME to do a skim without doing an assignment. We will implement these to reduce runtime.

Progress:

Priority

High

Level of Effort

~ 40 hours of work

Resolution Ideas

For @i-am-sijia to sync with @inrokevin to understand how to create these skims in EMME. @inrokevin: can this be done in the current version of EMME?

Project

ActivitySim/Emme Conversion, Task Order 5

Who should be involved?

Users: @lmz Reviewers: @gregerhardt, @inrokevin

Risk

Yes, the reliability calculations may fail.

Tests

gregerhardt commented 1 month ago

Note that reliability does not appear to be a big priority to MTC in that we don't have it in TM1, and the planners are not clamoring for it. So one question--would there be additional runtime savings from excluding reliability altogether? We have to skim anyway, so maybe it doesn't matter one way or another. But it would be valuable to understand that in the context of this task.

DavidOry commented 1 month ago

Note that reliability does not appear to be a big priority to MTC in that we don't have it in TM1, and the planners are not clamoring for it. So one question--would there be additional runtime savings from excluding reliability altogether? We have to skim anyway, so maybe it doesn't matter one way or another. But it would be valuable to understand that in the context of this task.

Understood. My current hypothesis is that modifying the skimming to not do the assignment and leaving it in would be the lowest cost path. But once we get a sense of the runtime of the alternate skimming approach, we can make a more informed assessment vis a vis just removing it altogether.

i-am-sijia commented 4 weeks ago

Currently within each global iteration, every time-period's assignment is done twice. The first assignment is just the assignment-only, to the get congested volume for calculating reliability of each link and store it as a link attribute to be skimmed in the second assignment. The second assignment is both assignment and skimming, skimming is done via EMME path analysis feature in the SOLA assignment. According to @inrokevin, for each path analysis (aka each skim), it's running a SOLA to get the equilibrated path. That's why the second assignment is taking long time to run. For example, in one of my test assignment with a relaxed convergence metric, AM's first assignment (assign only) took 8 minutes, while its second assignment (assign and skim) took 1 hour. One consideration might be to reduce skims to reduce the run time.

@inrokevin also suggested the following options on reliability:

  1. Use a very loosely converged assignment for the initial run to seed the reliability factors for skimming
  2. Use the shortest path tool to extract non-equilibrium results for the reliability portion of the travel cost
    • How is the reliability result used in the rest of the model? (Reliability skims are used in mode choice) Will it be a big deal if the reliability result is slightly off given that the total travel time will be the same?
    • This looks somewhat like the way it was done in TM2.1?
  3. Test the path-based assignment:
    • This will be much slower for than an equivalent run of SOLA, BUT it saves the paths
    • Post-assignment analysis is much faster
    • Plus the paths from a previous global iteration can be used to warm start the assignment for the next iteration.
    • It will also NOT be necessary to run the assignment twice in order to have equilibrated reliability skim results.
    • We will need to look into using Pre-compiled functions, really speeds up this assignment
    • My expectations are that Path-based will not win out head-to-head, given the complexity of the network and VDFs, but since it is single-threaded it might be a candidate if we run multiple time periods in parallel