Home▸Transport & Urbanism▸2D NaSch Traffic Model — Fundamental Diagram

2D NaSch Traffic Model — Fundamental Diagram

2D Nagel-Schreckenberg cellular automaton on a single-lane ring road: the real accelerate / brake-for-gap / random-slowdown / move rules, an unrolled road view, a scrolling space-time diagram, and a live flow-vs-density fundamental diagram built from measured throughput.

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

A 2D read-out of the real Nagel-Schreckenberg cellular automaton on a closed single-lane ring: accelerate, brake to the gap ahead, randomly slow down with probability p, then move — applied to every car in parallel each step. The unrolled road strip shows cars colour-coded by speed, the space-time panel traces every car's position over recent steps so backward-travelling phantom jams are visible as diagonal bands, and the fundamental-diagram panel plots flow against density from throughput actually measured by the automaton, built up live as you explore different densities or run the auto-sweep.

⚙ Under the hood

A 2D read-out of the real Nagel-Schreckenberg cellular automaton on a closed single-lane ring: accelerate, brake to the gap ahead, randomly slow down with probability p, then move, applied to every car in parallel each step. An unrolled road strip and scrolling space-time diagram reveal backward-travelling phantom jams at high density with no obstacle, alongside a live flow-vs-density fundamental diagram built from throughput actually measured by the automaton, with an auto-sweep mode to fill in the whole curve.

traffic flowcellular automatonNagel-Schreckenbergphantom jamfundamental diagramring road2D

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

What did you find?

Add reproduction steps (optional)