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:
added a .graph attribute to the Network class that stores the igraph.Graph object
moved the read_nodes and read_links functions to be module functions, rather than object methods
removed all the deprecated link/node access methods from the Network class, including single_source_dijkstra
removed the built-in adjacency matrix and dual (link-to-link) data structure
reworked get_skim_matrix to use igraph
reworked the path attribute load method to use igraph
added a reachable_zones property to model class to store zone-to-zone indices that are within global max_dist
added a zone_paths property to model class to store lists of links between zones
updated assign_demand step to use new network API
reintroduced path-finding variable costs via "node explosion"
To do:
update nearest_pois Network method to use igraph
update the small WFRC example to use new API (the one over on WFRC works fine with the minor tweaks above)
Lower priority:
update the AMBAG example (including support for multiple modes, rather than just bike)
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:
Additionally, the runner script (the
.py
file containing the program's mainmodel.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 thenetwork.yaml
schema.Work so far:
.graph
attribute to theNetwork
class that stores theigraph.Graph
objectread_nodes
andread_links
functions to be module functions, rather than object methodsNetwork
class, includingsingle_source_dijkstra
get_skim_matrix
to use igraphreachable_zones
property tomodel
class to store zone-to-zone indices that are within globalmax_dist
zone_paths
property tomodel
class to store lists of links between zonesassign_demand
step to use new network APITo do:
nearest_pois
Network method to use igraphLower priority: