Biham-Middleton-Levine traffic model

Your browser does not support the <canvas> element.

Iteration count:

This is a JavaScript implementation of the Biham-Middleton-Levine traffic model, a self-organizaing cellular automaton.
There are two types of pixels, or "cars": red cars, which can only move to the right, and blue cars, which can only move to the bottom.
At each step, a car may only advance if the pixel in front is not occupied by another car.
You can adjust the density (initial ratio of car pixels over total number of pixels) with the slider. If you change the density, the automaton will be reinitialized.
The result may change drastically depending on the initial density. Naturally, high values will result in the traffic eventually going into a "jammed" state. Some values provide interesting results.
While the base rules are simple, the behaviour that derives may prove to become complex and has been a subject of study. Check the Wikipedia page for more information.