CellLife

This is an attempt to simulate evolution. In the applet below simple creatures fight for survival. Those that do survive have their genes copied into a new creature. Mutation causes the design of the creatures to occasionally change. Natural selection causes those designs that are more successful to drive out the inferior ones.

The rules couldn't be simpler:


While that's running, have a read below.


Source:

The CellLife project is open source. The source files are here: I've zipped up the source code into a single file for easier download: CellLife.zip (all of 14KB!)

Have a look at the code documentation (generated by javadoc) - see, it's not difficult is it?

To use the source code:

  1. Copy the above files and this html file (index.html).
  2. Download Sun's Java Development Kit (http://java.sun.com/products)
  3. Compile with the command: javac *.java.
  4. Load index.html into a java-supporting browser and enjoy.
To generate the documentation use the command: javadoc *.java -d dox
This will create a separate directory dox for all the html files (avoids overwriting this index.html for a start).

Some simple things to change to get you started:

If you make some exciting changes or improvements to the code then duplicate this page on your own site so we can all share your wisdom. The aim of this project is to spark discussion, primarily on the Primordial Life mailing list (see below). 

Background:

There have been several attempts to simulate the evolutionary design process. Here are just a couple: Other links and information can be found at: http://alife.org.

None of the simulations I have seen even approach the sheer creativity of evolution. There are several reasons for this, firstly that by its nature evolution requires large populations and lots of time to work. More interestingly, for an evolution simulation to really take off you need the right representation not only to allow the creatures enough flexibility to create successful forms but also with the right pressures to drive the survival of those creatures that are more successful in interesting ways.

This simulation is an attempt to get at that representation. At the moment all it shows is potential. It was thoroughly inspired by the Primordial Life project but addresses two perceived issues:

Desired improvements: Changes since 26/7/00: CellLife was written by Tim J. Hutton (homepage, email).


Details:

The design of the creatures is an attempt to get closer to a physical model of real creatures interacting. It is not intended to be an accurate simulation of biological multicellular organisms, it just borrows some of the ideas.

In an attempt to keep things simple, there are just two types of cell: red and green. (Pink ones behave like greens, they are just drawn differently.) The pink cells (the roots of the tree structure) are like the 'heart' of the creature - the creature must protect its pink cell from attack else die. Green cells are intended to be like passive energy collectors (plant similarities) but are currently useless and rapidly get selected out. Red cells are intended to be the active attackers, gathering food by eating the green cells of other creatures and improving reproduction chances by killing other creatures.

The creatures are made up of a tree of cells extending outwards from the root cell. The branches of the tree move about at random unless the creatures control this movement themselves by rotating themselves either clockwise or anticlockwise around their parent.

The intention is that creatures will respond to their environment by moving into a set position or in a set manner, allowing them to adopt various positions (defensive, attacking, searching, etc.) depending on their mood.

The current implementation of the creatures' brains gives each of them a single neuron. With the orientation defined by the cell's parent being 'behind' it, the cells responds to the presence of enemy cells to its left or right. The neuron determines how the cells responds, if at all.

Sensory inputs: green_left, green_right, red_left, red_right

Possible outputs: rotate_left, rotate_right, no response


Edited highlights of the Primordial Life mailing list:

David Evans wrote (Thu, 27 Jul 2000 00:02:02 +0100):

What I thought might make an interesting evolutionary trade-off is to base the reproduction on an explicit sexual pairing. I'm assuming that at the moment when a biot dies, you replace it by spawning a new one based on the genome of a randomly selected survivor in the pool. How about if we created a new biot whenever the pink cells of two biots touched (at the moment this relatively rare encounter does nothing but bounce.) Ideally, the newborn would use a crossover-generated genome from both parents, but it could also be randomly chosen from one or the other.

In a blind, hard-wired world I would expect to see some species that flaunt their pink bits (they would lead short, but promiscuous lives) and others that are more demure (leading long, boring lives.)

With vision and brains in gear, it should lead to interesting behaviour, like defensive positions that open up into mating positions.

I realise that with the recent talk of wiring and brain boxes, that the pink cell might be considered by some to be the brain, rather than the genitals. I have, however, come across many life forms (mostly in middle-management) where the two functions seem to have merged in the same organ.

Join the Primordial Life mailing list here


Last modified: 16/2/01