arup-group / genet

Manipulate MATSim networks via a Python API.
MIT License
43 stars 10 forks source link

Reference to stop name changes during snapping+routing on network #224

Closed KasiaKoz closed 7 months ago

KasiaKoz commented 7 months ago

The step to process outputs of pyomo model strips too much of the string. It changes the name of the stop, if the stop name begins with an 'x' - this leads to routing issues because the resulting stop doesn't actually exist in the network.


2024-01-25 11:32:24,827 - Passing problem to solver
--
2024-01-25 11:32:24,854 -
Routing Service: `some_route_id` resulted in the following Exception:
Traceback (most recent call last):
File "/src/genet/core.py", line 1827, in route_schedule
mss = modify_schedule.route_pt_graph(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/genet/modify/schedule.py", line 64, in route_pt_graph
mss.solve(solver=solver)
File "/src/genet/max_stable_set.py", line 306, in solve
self.solution = {
^
File "/src/genet/max_stable_set.py", line 307, in <dictcomp>
self.problem_graph.nodes[node]["id"]: self.problem_graph.nodes[node]["link_id"]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.11/site-packages/networkx/classes/reportviews.py", line 194, in __getitem__
return self._nodes[n]
~~~~~~~~~~~^^^
KeyError: '_stop.link:1234'

with some stop originally named x_stop