Open chen-98 opened 3 years ago
To enable automated periodic rerouting you can set options --device.rerouting.probability 1 --device.rerouting.period 30. However, the routing algorithm does not yet check for lane changing restrictions. Hence, vehicles will always prefer the shorter route via edge '5'. If you distort the distance perception by setting --weights.random-factor 10 you will see some vehicles that take the detour.
fixing this is surprisingly complex:
To enable automated periodic rerouting you can set options --device.rerouting.probability 1 --device.rerouting.period 30. However, the routing algorithm does not yet check for lane changing restrictions. Hence, vehicles will always prefer the shorter route via edge '5'. If you distort the distance perception by setting --weights.random-factor 10 you will see some vehicles that take the detour.
Is it helpful to divide the edge into two parts(split the edge in the line between lane 5 and 4) ? So that the routing algorithm can consider this actual road segment as two parallel edge. Maybe this way can help us avoid the checking problem of algorithm.
And if it is helpful, how to realize it by coding? Thank you very much!
By modeling the lane-changing restriction via distinct parallel edges you would indeed avoid this situation. But you still wouldn't see the desired detour. The vehicle would simply wait on the predecessor edge until it manages to reach the right parallel edge.
lane based routing could be an option here and would also help in respecting lane change restrictions in general. So optionally building a lane based graph could be a solution. cost assignment will be difficult though
I drawn a network to test the lane attribute 'changeLeft'. I definded a right turn flow at the intersection. And disallow lane change at the income edge of intersection. To make sure each car can reach destination. I provide a alternative route. But I found that if a car can't change to right turn lane in time, it will stop at the end of the income edge until being teleport instead of follow alternative route. So, how to let car(defined by flow) change route dynamically instead of jam at the junction. Atteched the project files.
plain_test.zip