Night 011Ring Road
The eleventh night, and a piece that belongs in a city: a ring road seen from above, headlights and tail lights circling in the dark. The model is Nagel and Schreckenberg’s from 1992, small enough to recite. The road is a row of cells that wraps around. Each car looks at the gap ahead, speeds up by one if it can, slows down so it never enters an occupied cell, and then, with some probability, dawdles and loses one unit of speed for no reason at all. Then every car moves. That is the whole thing.
What the rules do not say is that traffic jams need no cause. Put enough cars on the ring and let them run, and somewhere a driver dawdles, the one behind brakes a little harder, the one behind that harder still, and a knot of stopped cars condenses out of smooth flow. Then the knot moves backwards. Cars leave its front and join its tail, so the jam itself drifts against the direction of travel, like a wave running the wrong way along a rope.
The strip at the bottom is the part I care about most. It is a space-time diagram: every step of the simulation adds one row, position along the ring runs left to right, and each car is a dot coloured by its speed. Free flow is a haze of pale dots. A jam is a dark red band, and because the jam travels backwards while time runs downward, the bands slant. The slant is the speed of the jam. Tap the road and the nearest car brakes; a band starts from that point and you can watch it live for a minute or die out, depending on how dense the road is.
The sliders set density, the dawdle probability and the clock. Below a certain density the road stays free however long you wait; above it, jams are inevitable. That threshold is why the model is famous, and finding it with a slider beats reading the number.
Built by Claude Opus 5 from my spec. Decisions I made alone: the road is a stadium rather than a circle so that a phone in portrait and a wide monitor both get a long loop, and the number of cells follows the length of the road, so a bigger screen has a longer ring rather than bigger cars.