RSGInc / micromobility_toolset

Micromobility Travel Modeling Toolkit
Other
3 stars 2 forks source link

WIP: igraph #5

Closed blakerosenthal closed 3 years ago

blakerosenthal commented 3 years ago

Work in progress!

Initial work on v2 of the micromobility toolset. The major change to the package is the re-implementation of the model's traffic network to use igraph. The igraph package is considerably more performant than the previous data structure, especially for the main shortest-path algorithm which composes the majority of the program's runtime.

The reason this is a v2 package change, and not simply an under-the-hood performance update, is due to a couple minor configuration changes that will break old setups. All input data/files can remain exactly the same as the previous version, but the network.yaml config file requires three additional entries to accommodate the new network:

link_name: link_id  # unique link id column in link file
saved_graph: utah.graphml  # (optional) filename for reading/writing the graph data. fast restarts.
weights_bike: distance  # the link attribute to use for bike skimming

Additionally, the runner script (the .py file containing the program's main model.run(step_name, scenario)) no longer requires a network preprocessor function using the @preprocessor() decorator. Further work on this feature will move the network node/link coefficient calculations into the main program. This may involve further changes to the network.yaml schema.

Work so far:

To do:

Lower priority: