Home▸Transport & Urbanism▸Night Traffic Flow Simulator (2D)

Night Traffic Flow Simulator (2D)

Interactive 2D top-down night traffic simulator: cars follow a realistic car-following model around a lit ring road with glowing headlights and taillights, a timed traffic signal, and live readouts for speed, throughput and congestion.

Transport & Urbanism2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-night-traffic ↗ Open standalone

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.

⚙ Under the hood

A 2D top-down companion to the 3D night-city traffic scene: cars with glowing headlights and taillights follow the Intelligent Driver Model around a lit ring road, reacting only to the gap and closing speed of the car ahead, while a timed traffic signal periodically halts the flow so free flow, stop-and-go waves and gridlock all emerge from the same following rule.

traffic flowcar-following modelIntelligent Driver ModelIDMtraffic signalcongestionnight driving

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)