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
Otherwise the proposed paths may be incorrect
For example:
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