Headlights (front) Taillights (rear) Signal green / red

Night Traffic Flow Simulator (2D)

This 2D companion to the 3D night-city traffic scene draws a single lit ring road from directly above: a stream of cars with glowing white headlights and red taillights follows the Intelligent Driver Model, each driver reacting only to the gap and closing speed of the car ahead, while a timed traffic signal partway around the loop periodically halts the flow. Adjust the traffic density, the drivers' desired speed limit, and the signal's cycle length and green share to see free flow, stop-and-go waves, and full gridlock emerge from the same simple following rule, tracked live through average speed, throughput and a congestion readout.