11.12 Signalized T-intersection
Figure 62 shows an example of how to use traffic-signal-related actions and conditions. It intentionally does not expect any simulator-specific behavioral models that would cause vehicles to react to the traffic signals automatically.
In the example, Vehicle 1 approaches a signalized T-intersection.
When it gets close to the stop line (t1), it triggers a change of the traffic signal phases using the TrafficSignalControllerAction.
The intermediate traffic signal phases for the straight and the turning direction are activated.
The straight direction eventually is switched into green (t2), while the signal of the conflicting traffic is switched to red.
Once the straight signal is green as determined by the TrafficSignalControllerCondition, Vehicle 2 starts moving through the intersection.
Subsequently, a traffic light failure where the red and green bulbs are on at the same time is simulated using a TrafficSignalStateAction, forcing one signal into a broken state (t3).
The scenario then ends with a delay after that failure condition is reached, which is determined using the TrafficSignalCondition.