Traffic lights

We will look at a number of problems with respect to traffic light analysis. We will assume we are at an intersection with four pairs of lights, labelled North, South, East and West; and Left and Right, as shown in Figure 1.


Figure 1. Our traffic light set up.

Now, the city imposes certain requirements on the lights.

Requirements

  • A light should be green for at least 30 seconds.
  • No vehicle should have to wait more than three minutes at a red light.
  • The North-South road has $n$% of the traffic, and the East-West road has $100 - n$% of the traffic.

You have a single timer that you can reset and indiciate a delay; for example:

1. Set lights NL, NR, SL, SR to RED, reset the timer and wait three seconds.

2. Sets WL, WR, EL, LR to GREEN, reset the timer and wait 50 seconds.

Create a set of instructions for the lights that is safe. You may wish to observe an actual traffic light and time its changes before you enagage in this exercise. You may be surprised by how much time actually passes between events.

Pedestrian Crosswalks

Next, create both pedestrian crossing lights and buttons that can be pushed. The pedestrian light may be WHITE, FLASHING-RED or RED. The light should only be turned WHITE if a pedestrian has pushed the button while the

Advanced green

You can add inductive loops to see if drivers are waiting to make left-hand turns. In these circumstances, you can add an advanced green; which is denoted by a FLASHING-GREEN.