Traffic Lights
Traffic
Live Readout
Elapsed time
0.0 s
Cars on road
0
Passed junction
0
Avg speed
0.0 m/s
Longest queue
0
Active phase
N-S green
How it works

Each car is an independent agent that accelerates toward the speed limit and brakes when either the light ahead is red/yellow or another car is closer than a safe following gap:

  • Accelerate at 6 m/s² toward the target speed, brake at 10 m/s² when it must slow.
  • A car-following check keeps at least ~4.5 m of gap behind the car ahead in the same lane.
  • The N-S and E-W approaches alternate green with a 1.2 s amber clearance interval, timed by the two sliders above.
  • Cars recycle to the back of their lane once they leave the far edge, keeping traffic continuous.