User Tools

Site Tools


proj

This is an old revision of the document!


Cellular Automata

Cellular Automata (CA) (http://en.wikipedia.org/wiki/Cellular_automaton) represent a discrete model, primarily of computation itself - but also applicable to physics, complexity science, and biology among others. CA were discovered in the 1940s by Stanislaw Ulam and John von Neumann while they were both working on the Manhattan project to develop the first nuclear weapons.

CA are characterized by a regular grid or lattice of cells, each in a finite number of states (ex. {on,off} or {1,0}). The grid should be theoretically infinite, but due to the physical limitations of computers, these are usually simulated on a finite grid. Some implementations therefore, have an edge, and in others the cells are arranged in a toroidal (http://en.m.wikipedia.org/wiki/Torus) fashion, that is, cells at the “top” of the lattice are neighbours to those at the “bottom” and those at the “left edge” are neighbours to those on the “right edge”. The toroidal solution is often regarded as being more elegant than the version with an edge.

Typically, the evolution of a CA system is completely deterministic, and follows from the initial state at time t = 0 and a new state of the grid is computed each time step (advancing the time by 1). The next generation is computed from the last by applying a (usually) fixed mathematical rule or function to each cell, typically a function of the cell's current state and the states of nearby cells (in the neighbourhood). Typically this function is applied to all cells simultaneously i.e. the next state of cells is not considered on the current time step. There are exceptions to these such as stochastic cellular automata (http://en.wikipedia.org/wiki/Stochastic_cellular_automaton), and asynchronous cellular automata (http://en.wikipedia.org/wiki/Asynchronous_cellular_automaton). Extending the concept of CA beyond deterministic rules to include probabilistic rules leads into the study of multi-agent systems, such as agent-based models of complex social phenomena.

Conway's Game of Life

Possibly the most famous CA is Conway's Game of Life (sometimes just called “Life” by aficionados) which was invented by John Conway in 1970. It is a “game” in the sense that the player assigns the initial state of the game, and can observe its evolution. This game is very well known in computing and mathematics circles, to the point where a propagating Life configuration called a “Glider” (http://www.argentum.freeserve.co.uk/lex_g.htm#glider) has been unofficially adopted as the symbol or mascot for “hackers” in the classic sense i.e. computing enthusiasts (see: http://tools.ietf.org/html/rfc1983 & ctrl+f search “hacker”).

Figure 1. A Glider in Life (source: WikiMedia Commons)

Specifically, Life consists of a two-dimensional lattice of cells that have two possible states: {alive, dead}. Considering a cell's 8-neighbourhood a cell's next state is computed as follows:

  • Any live cell with fewer than two live neighbours dies, as if caused by under-population.
  • Any live cell with two or three live neighbours lives on to the next generation.
  • Any live cell with more than three live neighbours dies, as if by overcrowding.
  • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

For more information you can consult (as a starting point): http://en.wikipedia.org/wiki/Conway's_Game_of_Life

Figure 2. The red cells are the 8-neighbourhood (or Moore Neighbourhood) of the blue cell in the center. (source: WikiMedia Commons)

Interestingly, it has been demonstrated that the game of life can simulate a Universal Turing Machine ( http://en.wikipedia.org/wiki/Universal_Turing_machine) - meaning it is capable of computing any computable value, as with a “general purpose” computer. Also interestingly, self-replicating structures are possible: http://youtube.com/watch?v=A8B5MbHPlH0

Course Project

Your project will be to create a Cellular Automata Laboratory with GUI using the Java™ programming language. Initially, the application will implement Conway's Game of Life, but will be extensible or reusable to implement other rule-sets for general Cellular Automata. Have a look at http://www.julianpulgarin.com/canvaslife/ for an idea of potential features, although that example is implemented in Javascript. You may also consider the file format demonstrated at http://www.bitstorm.org/gameoflife/lexicon for sharing Life configurations. Other possible features include drag and drop, and copy and paste for Life configurations.

proj.1403708635.txt.gz · Last modified: 2014/06/25 15:03 by marek