Open Robinlovelace opened 1 month ago
Hey Robin, This is a nice hackaton you are going to have here. Let me just make a few comments:
The AequilibraE Route Choice capability is substantially different from all other alternatives you have there, as it has proper route choice (i.e. discrete choice) built on top of path-finding. I recommend the Link Penalisation algorithm for performance.
AequilibraE has a non-negligible overhead in building the Graph in memory. Still, the performance should be at least one order of magnitude better than your minimum for the network size I imagine. You will have to keep the graph in memory.
AequilibraE has a specific treatment for centroids and centroid connectors. If you plan to do computation ALWAYS from node to node, just prepare the graph with all nodes as centroids and use _graph.set_blocked_centroidflows(False)
For simple path-finding tasks, you can refer to this notebook, which shows how to use the PathResults() class to compute and hold paths (sequence of links, nodes and predecessors preserved). This object also allows you to re-trace a different path for the same origin based on the predecessors in place.
In case you want to use AequilibraE only for path computation, a good example is this notebook, which is basically performing assignment (and preparing the graph along the way) from a text-based network. It could be the case of storing the network in something like parquet in your case
Great stuff, will give it a spin, many thanks jumping on this Pedro!
OK, starting slow, have got the example code running in Quarto, looking good!
@pedrocamargo sorry to bother but looking at https://aequilibrae.com/python/latest/_auto_examples/aequilibrae_without_a_model/plot_assignment_without_model.html I'm not sure how to import the OSM network. See code and commit below for where we've got to (not far):
# Create a project for Leeds
from aequilibrae.project import Project
p = Project()
#| eval: false
p.new('leeds_project')
p.open('leeds_project')
import geopandas as gpd
zones = gpd.read_file('input_data/zones_msoa_leeds.geojson')
# p.network.create_from_osm(model_area = zones, modes = ['car'])
# Fails with
p.network.create_from_osm(place_name = 'Leeds, UK')
AttributeError Traceback (most recent call last)
Cell In[17], [line 1](vscode-notebook-cell:?execution_count=17&line=1)
----> [1](vscode-notebook-cell:?execution_count=17&line=1) p.open('leeds_project')
[2](vscode-notebook-cell:?execution_count=17&line=2) import geopandas as gpd
[3](vscode-notebook-cell:?execution_count=17&line=3) zones = gpd.read_file('input_data/zones_msoa_leeds.geojson')
@Robinlovelace , you don;t need to open the project after creating it. It is already open:
Based on this, will try to apply it to Leeds: https://aequilibrae.com/python/latest/_auto_examples/assignment_workflows/plot_route_choice_set.html#sphx-glr-auto-examples-assignment-workflows-plot-route-choice-set-py