l
Cellular Automata
Cellular Automata
The Game of Life
One of the most interesting uses of compute today is modelling natural processes, eventally creating artifical intelligence
This is a celluar Automaton invented by John Conway's "Game of Life". While the Game of Life has become
something of a computational cliché, it is still
important to build it from scratch as its core principles are tied
directly to a core goal—simulating the natural world with code.
The basic idea is to start with a simple configuration of counters (organisms), one to a cell, then observe
how
it changes as you apply Conway's "genetic laws" for births, deaths, and survivals. Conway chose his rules
carefully, after a long period of experimentation, to meet three criteria:
- There should be no initial pattern for which there is a simple proof that the population can grow
without limit.
- There should be initial patterns that apparently do grow without limit.
- There should be simple initial patterns that grow and change for a considerable period of time
before
coming to end in three possible ways: fading away completely (from overcrowding or becoming too
sparse),
settling into a stable configuration that remains unchanged thereafter, or entering an oscillating
phase
in which they repeat an endless cycle of two or more periods.
In brief, the rules should be such as to make the behavior of the population unpredictable.
Conways genetic laws are delightfully simple. First note that each cell of the checkerboard (assumed to be
an
infinite plane) has eight neighboring cells, four adjacent orthogonally, four adjacent diagonally. The rules
are:
- Survivals. Every counter with two or three neighboring counters survives for the next generation.
- Deaths. Each counter with four or more neighbors dies (is removed) from overpopulation. Every
counter
with one neighbor or none dies from isolation.
- Births. Each empty cell adjacent to exactly three neighbors--no more, no fewer--is a birth cell. A
counter is placed on it at the next move.
It is important to understand that all births and deaths occur simultaneously. Together they constitute a
single
generation or, as we shall call it, a "move" in the complete "life history" of the initial configuration.
Conway
recommends the following procedure for making the moves:
- Start with a pattern consisting of black counters.
- Locate all counters that will die. Identify them by putting a black counter on top of each.
- Locate all vacant cells where births will occur. Put a white counter on each birth cell.
- After the pattern has been checked and double-checked to make sure no mistakes have been made,
remove all the
dead counters (piles of two) and replace all newborn white organisms with black counters.