Skip to content
Tactiverge

Traffic-light junction timing: experiment bench

Simulation OS · playgroundEducational model, not a digital twin

Traffic-light junction timing

Share green time between two roads and a pedestrian crossing, keep every phase safe, and watch the queues.

Your level (shows more controls and deeper equations)
  1. 1. Ask
  2. 2. Hypothesise
  3. 3. Set up
  4. 4. Run
  5. 5. Record
  6. 6. Change one variable
  7. 7. Compare
  8. 8. Interpret
  9. 9. Limitations & save

If I change …, then … will …, because …

3 · Set up the parameters

5–90 s

Time the busier road gets to discharge its queue.

5–90 s

Green time for the cross road.

0–30 cars/min

How busy the main road is.

0–30 cars/min

How busy the cross road is.

2–6 s

Below 3 s the safety audit flags it.

0–4 s

Every light red while the junction clears.

3–20 s

Time pedestrians may start crossing.

4–20 s

Time to finish crossing 12 m at 1.2 m/s.

0–6 people/min

How often someone arrives at the crossing.

1 more control appear at higher levels; until then it stays at the default value.

The seed fixes any random noise. Same parameters + same seed = exactly the same result, every time, on every computer.

6 · Change one variable

Your first run is the baseline. After it, change one thing at a time.

7 · Compare on a graph

Run the model to draw your first curve here.

5 · Run log

No runs yet.

Equations

Cars leave one every 2 s after a 2 s start-up delay, so one approach discharges ⌊(g − 3)/2⌋ + 1 cars in a green of g seconds.

Assumptions (always true in this model)

  • One lane per approach, no turning traffic, no pre-emption in this bench.
  • Fixed 2 s headway and 2 s start-up lost time; nobody leaves on amber.
  • 15-minute run; arrivals from a seeded random generator.
Text description of what the chart shows

A line chart of queue length against time over 15 minutes. The north–south and east–west queues rise during their red phases and fall during green, forming a saw-tooth pattern; a third series shows pedestrians waiting for the walk phase.

Did the result support your hypothesis? Use the numbers from the comparison table and link them to an equation.

Which assumptions could change your answer in the real world? For example: Real junctions have turning movements, platoons from neighbouring lights and driver variation.

Export and save

Exports use the ticked runs (or every run if none are ticked). Your draft saves automatically in this browser only. The Journal is private to you.

Valid parameter ranges

ParameterRangeDefault
North–south green5 to 90 s25
East–west green5 to 90 s25
North–south arrivals (each approach)0 to 30 cars/min10
East–west arrivals (each approach)0 to 30 cars/min5
Amber2 to 6 s3
All-red clearance0 to 4 s2
Pedestrian walk3 to 20 s7
Flashing don't walk4 to 20 s10
Pedestrian arrivals0 to 6 people/min0.5
Pedestrian phase (0 every cycle, 1 on demand)0 to 10

Independent reference checks

  • Default plan cycle

    Hand sum: 25 + 25 + 2×3 + 2×2 + 7 + 10 + 2 = 79 s.

  • Empty roads

    With arrival probability 0 nobody arrives, so nobody waits or departs.

Checked automatically on every change to the code. Educational model, not engineering-grade.

Where this model stops being right

  • Real junctions have turning movements, platoons from neighbouring lights and driver variation.