eclipse-sumo / sumo

Eclipse SUMO is an open source, highly portable, microscopic and continuous traffic simulation package designed to handle large networks. It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation.
https://eclipse.dev/sumo
Eclipse Public License 2.0
2.51k stars 1.42k forks source link

deadlock when lane-changing at stop close to lane end (trac #3079) #3079

Open behrisch opened 7 years ago

behrisch commented 7 years ago

one vehicle needs to change lanes to reach the stop lane and another vehicle wants to change lanes in the opposite direction to continue its route.

Possible reason 1: The deadlock is caused by myLeadingBlockerLength which is set by another vehicle (LC2013.cpp:1951. Reservation should take into account myLeftSpace of the calling vehicle)

Possible reason 2: Both vehicles attempt target the same stop but start out on different lanes. Vehicle A that is already on the correct lane does not yet reserve space for changing back because it's strategic foresight is still focused on stopping. Vehicle B on the neighboring lane is not aware that the stop will soon be occupied by A because MSStoppingPlace::enter is only called once the stop is reached.

This was already present in 0.25.0

Migrated from http://sumo.dlr.de/ticket/3079

{
    "status": "new", 
    "changetime": "2017-05-07T08:27:24Z", 
    "description": "one vehicle needs to change lanes to reach the stop lane and another vehicle wants to change lanes in the opposite direction to continue its route.\n\nThe deadlock is caused by myLeadingBlockerLength which is set by another vehicle (LC2013.cpp:1951. Reservation should take into account myLeftSpace of the calling vehicle)\n\nThis was already present in 0.25.0", 
    "reporter": "namdre", 
    "cc": "", 
    "resolution": "", 
    "_ts": "1494145644288310", 
    "component": "microsim - lane change", 
    "summary": "deadlock when lane-changing at stop close to lane end", 
    "priority": "major", 
    "keywords": "", 
    "time": "2017-05-07T08:27:24Z", 
    "milestone": "1.0.0", 
    "owner": "", 
    "type": "defect"
}
namdre commented 6 years ago

one work-around is to create a double connection where the stop lane ends so that both lanes allow continuation. http://sumo.dlr.de/wiki/Networks/Building_Networks_from_own_XML-descriptions#Multiple_connections_from_the_same_edge_to_the_same_target_lane http://sumo.dlr.de/wiki/NETEDIT#Connect

namdre commented 6 years ago

A possible solution would be to prevent vehicles from driving past the start of the busStop while on the wrong lane as long as the bus lane has a vehicle on it. (the no-vehicle condition is necessary to prevent deadlock in case the vehicle must enter a bus bay via lane-changing for some reason)

behrisch commented 3 years ago

@namdre I had a short dicussion recently that a topic like this may also result from rerouting short before the junction. Do you have any ideas how to fix this (except for enabling swapping ;-))

namdre commented 3 years ago

Besides extra connections, failure-to-change lanes could trigger rerouting (#8055). Also, MSVehicle::getRerouteOrigin could take the lane change state into account fairly easily.

namdre commented 3 years ago

The reference to 8782 was a typo