TMPE icon indicating copy to clipboard operation
TMPE copied to clipboard

Ability for timed traffic lights to skip states if nobody is waiting at a red light or wanting to turn.

Open BuiIdTheBuilder opened this issue 2 years ago • 4 comments

Proposal

I propose a new TTL setting which will allow a state without any waiting cars, cars wanting to go in a specific direction if specified, or pedestrians waiting to cross if any pedestrian light is green during the state, to be skipped immediately, as if it didn't exist. If all following states have that setting enabled, or if there's for instance only 2 states where the last one has the setting, then the TTL will remain in the state without the setting (resting state).

GUI additions

pic States that may be skipped would have "conditional" next to them. pic2 Proposed additions to the state editing window.

Why this is necessary

This is necessary at timed traffic light intersections, where traffic flow on certain approaches is intermittent, or low at certain times of day (with Real time mod for example), to avoid unnecessarily changing and delaying other vehicles.

An example is a 4-way intersection of a busy arterial road with a side road. Let's say that the arterial road is always busy, and the side road only is busy during rush hour periods. It is rush hour, and everything is working perfectly as intended. Fast forward a few hours later, and there are barely any vehicles on the side road, and yet the traffic light is still changing after the minimum time has elapsed, delaying vehicles on the arterial for no reason.

Another example is a T-intersection where both roads are equally busy. The through road has a left-turning lane and a protected left turn phase. Majority of the traffic on the through road is proceeding straight or turning right, with an occasional platoon of left-turning vehicles. It works as intended when there are left-turning vehicles, but when there are no left turning vehicles, the protected stage is still served for the minimum time specified, delaying oncoming traffic for no reason.

In real life at these intersections, traffic light controllers only serve states with demand (waiting vehicles), in cyclic order as usual, so this problem never arises.

This would also make mid-block pedestrian crossings with requestable green possible.

Current solutions

Currently, it is kind of possible to have a "resting state", by changing the adaptive switching mode to "Wait > 0", but in that case the state still terminates when the maximum time elapses. Of course, the maximum time could be set to a high number like "1000", and that overcomes that problem, but another problem arises if the traffic flow on the green approaches in the 1st stage warrants a different adaptive switching mode, for example the default "Flow < wait" mode, which currently is impossible to have with a "resting state". And it also is kind of possible to have a skippable state, by setting the minimum time to 0 and changing the switching mode to "Flow = 0". "Kind of", because still, that state will be served for a fraction of a second, and also the same aforementioned problem arises if you'd want another switching mode when there is demand. These 2 solutions are not quite user-friendly, especially for beginners. And let's not forget about pedestrians too, as they too need to cross the road at some point, and with current solutions, it's not possible to detect when a pedestrian has arrived and wants to cross the road, though it is possible to occasionally have the light change in order to serve any pedestrians present, which would unnecessarily delay vehicles at a busy intersection if there aren't any pedestrians.

My proposal would reduce the time and difficulty in setting up traffic lights this way, and would make them behave more realistically.

BuiIdTheBuilder avatar Jan 18 '22 06:01 BuiIdTheBuilder

Thank you for the proposal. TTL redesign is planned in the near feature since the code is a big mess and UI is much more complicated that it could be, considering features it provides. You may think it's easy to add such small thing but the code is old and more like spaghetti. It's hard to make any changes without breaking anything.

TTL setup should be quick and fun for basic configurations and should also provide as many tools as possible to let the user create realistic solution. With regards to pedestrians... That's hard, they are not registered anywhere, pedestrian crossings are imaginary/virtual things from the code perspective, detecting is not 100% reliable so it will be tricky to keep track of them. On the other hand if we could implement pedestrian tracking system (even simplified) it could open new possibilities like for example force them to wait on non-protected pedestrian crossings so they could pile up a bit and then cross the road on one go. That would be also helpful to improve interactions between them and cars to be more realistic. As you see, one small proposal, so many things are required but missing to fully support it

krzychu124 avatar Jan 18 '22 11:01 krzychu124

See also: #289

brunoais avatar Feb 09 '22 20:02 brunoais

Really wish this was possible. It seems that if you set minimum time to 0 and switching mode to "more waiting than driving", it skips undemanded states. However I have a adaptive coordinated network of lights on an arterial, and I'd like the minimum time to be served if the state is served, otherwise it's simply skipped. Currently I'm using 0 minimum time for these states, and due to that, it sometimes ruins the green wave.

BuiIdTheBuilder avatar Apr 02 '22 09:04 BuiIdTheBuilder

What's the status on this? Today this feature came to my mind and I discovered this proposal. Has the clean-up already begun / finished? I would give programming this feature a shot if it's already feasible to do so.

Salzian avatar Aug 11 '22 20:08 Salzian