2D NaSch Traffic Model — Fundamental Diagram

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.