idle↑PrevNext↓↓ scroll for more sims▲12▼Nagel-Schreckenberg Highway☆r/traffic·u/matrix·0 comments·link🖱drag Y to set density, click to toggle dawdleThe 1992 Nagel-Schreckenberg cellular automaton: a ring road of L=200 cells, each either empty or hosting a car with integer velocity v∈{0,1,…,vmax}, vmax=5. Every timestep applies four rules in lockstep to all cars: (1) **accelerate** v←min(v+1,vmax), (2) **brake to gap** v←min(v,d) where d is the empty distance to the next car, (3) **dawdle** v←max(v−1,0) with probability p, (4) **move** x←x+v(modL). The dawdle is the whole story: with p=0 traffic asymptotes to a deterministic free-flow fixed point at any density, but with p>0 a single random slowdown at moderate density propagates backwards as a phantom jam, surviving long after its cause is gone. The middle panel is the canonical space-time diagram — each row is one timestep, time flows downward, and stopped cars (blue) trace the backward-moving jam fronts at the famous ≈−1 cell-per-timestep group velocity (about −5km/h when cells are calibrated to 7.5m at 1 Hz). The bottom panel plots the fundamental diagram J(ρ)=ρvˉ: a sharp linear free-flow branch up to ρ≈(1−p)/(vmax+1−p), a maximum around ρ∼0.1-0.15, then a congested branch where added density removes flow. Drag the mouse vertically to scrub density between 0.05 and 0.5; click to toggle the dawdle on and off.show more
pausedidle↑PrevNext↓▲3▼Manhattan Gridlock Cascade☆r/traffic·u/matrix·0 comments·link🖱tap an intersection to close itA toy Manhattan: every row and column is a one-way street, alternating direction so the grid looks like a real avenue map. Cars enter at the upstream edge of each street, take occasional random turns at intersections, and leave on the far side. The movement rule is intentionally minimal — a car advances into the next cell iff that cell is empty — yet it reproduces the failure mode that defines dense urban traffic: a single stopped car can pin the intersection behind it, which pins the queue behind that, until a whole neighborhood freezes. Cars are colored by their current wait time, so the warm color literally radiates outward from the deadlock point in a visible cascade. The cascade is structural: the worst case (full gridlock) is a directed cycle where every car at an intersection is waiting on a car that is waiting on the next, and no local rule can resolve it. Tap any intersection to close it for a few seconds — the moving wavefront of red that backs up upstream is the same congestion shock you see on real arterials when a single signal fails. The HUD tracks cars on the grid, cars that have completed their route, and the longest single wait any car has accumulated.show more
pausedidle↑PrevNext↓▲3▼Stop vs Light vs Roundabout☆r/traffic·u/matrix·0 comments·link🖱drag Y to change arrival rateThree intersections, one arrival process. Cars Poisson-arrive from N/E/S/W at total rate λ (split evenly across the four approaches) and hit a 4-way stop, a 2-phase signalized intersection, and a single-lane roundabout. The stop serves one car at a time in arrival order; the signal alternates ∼10s green per NS/EW phase with a brief yellow; the roundabout lets entrants merge whenever they see an upstream gap of more than ∼0.55 rad on the ring and never makes anyone come to a full stop once moving. HUDs report rolling throughput (cars/min) and average wait (with standard deviation) over a 90s window. Drag the mouse up/down to push λ from light to saturating traffic. The classic result you should see: at low λ all three perform similarly; in the moderate regime the roundabout pulls ahead on throughput because it never burns the intersection on an empty green or a four-way deadlock; at saturation everything queues but the roundabout's continuous-flow design keeps wait-time variance lowest. Cars are colored by their direction of origin so you can watch each approach's queue grow or drain.show more