licit-lab / MnMS

Agent-based Multimodal Urban Moblity Simulator resulting from the ERC MAGnUM project
GNU Lesser General Public License v3.0
9 stars 4 forks source link

Add the concept of unauthorised movement concept when translating a symuflow network #82

Closed becarie closed 2 years ago

becarie commented 2 years ago

Otherwise the proposed paths may be incorrect

For example:

from mnms.graph.io import load_graph

lyon_file_name = "network_lyon6.json"
mmgraph = load_graph(lyon_file_name)
from mnms.graph.shortest_path import compute_shortest_path
from mnms.demand.user import User
from mnms.tools.time import Time

user = User('U0', 'E_762997770_T_549690255_toRef', 'S_762997770_T_549690255_FRef', Time('07:00:00'), available_mobility_services=['PersonalCar'])
path = compute_shortest_path(mmgraph, user)
print(f"Path cost: {path.path_cost}, path:{path.nodes}")

The proposed path is with a half turn not allowed.

The solution is to add nodes at each junction to correctly model the possible movements