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.57k stars 1.44k forks source link

NEMA trySwitch should return a dynamic SUMOTime depending on internal state #9938

Closed mschrader15 closed 2 years ago

mschrader15 commented 2 years ago

@qichaow for simulations with a step-length< 1, this return of a 1 causes the controller to miss detector calls, as well as not honor vehicle extension timers with < 1 second resolution.

https://github.com/eclipse/sumo/blob/671b0ad07284c1923428a7405e9b1f0ed43846f5/src/microsim/traffic_lights/NEMAController.cpp#L718

At the same time, I believe there are scenarios where the code doesn't need to execute until the minimum timer for a phase is exhausted.

We could make it dynamically point to the next event similar to the actuated traffic light logic https://github.com/eclipse/sumo/blob/a18a5a093632570324d3a1d0348fd3c8e19e1322/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp#L578

mschrader15 commented 2 years ago

This is no longer relevant