GenerateRandomSearch

Traffic Flow Simulator

Rule 184 is the simplest traffic model there is: a car moves forward if the cell ahead is empty, and otherwise it waits. No driver hesitates, brakes late, or does anything wrong — and above half density, a jam forms anyway and never clears. This runs the model on a ring road and draws every step, with the cars recounted each time so nothing is quietly created or lost.

What this generator does

Places cars at random on a ring road and applies rule 184: a car advances exactly when the cell ahead is empty. Every generation is drawn, and the car count and the rule itself are re-checked on each step.

How to use this tool

  1. Set the road length and how many cars are on it.
  2. Run, and read the pattern downwards — each row is one time step.
  3. Below half density, watch the traffic eventually flow freely.
  4. Above half density, watch the jam persist however long you run it.

Understanding the controls

Road length
Cells around a ring, so a car leaving one end arrives at the other and the total never changes.
How many cars
The density is this divided by the road length. Half is the threshold: below it traffic eventually flows freely, above it something is always stuck.
Steps
How many time steps to run. Each becomes one row in the picture, read downwards.
Seed
Reproduces the same starting positions, which is the only way to compare two densities on comparable starts.

Common use cases

  • Demonstrating that traffic jams need no bad drivers to form
  • Teaching cellular automata with a rule people already understand
  • Producing traffic pattern data for a modelling exercise
  • Showing the sharp change in behaviour at half density
  • Generating a striking visual for a lesson on emergent behaviour

How this generator works

Rule 184 moves a car forward exactly when the cell ahead is empty, and the whole road updates simultaneously. Because a car can only move into a cell that was empty, no two cars can ever land on the same cell and none can vanish — but the check counts them again at every step rather than relying on that argument. Every generation is also re-derived from the one before and compared, so a step that broke the rule would be caught rather than drawn.

Randomness and fairness

Uses your browser's cryptographic random source to place the cars by default. A seed switches to a reproducible sequence, which is deterministic and not cryptographically secure.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Cars move at most one cell per step, so there is no speed, no acceleration and no braking distance.
  • The road is a single lane with no junctions, no overtaking and no exits.
  • Everyone follows the rule perfectly, which is the point — the jam is not caused by anyone's behaviour.
  • Rule 184 is the simplest useful traffic model; realistic simulations add reaction time and randomised braking, which produce jams even below half density.

Privacy and your data

The simulation runs in your browser. Nothing you choose is transmitted, stored or included in analytics.