16.5.11

Experimenting with Evolution Programming 2

After today's effort, I've made some significant steps with the evolution program you see milling away in the background whenever you move your mouse in Firefox or Chrome. For a simple description of how to interact with it, wave the mouse over empty space in the background to spawn new "creatures" (squares). Over time, the creatures consume energy and so start to shrink (like a dying flower). To feed a creature to keep it alive, wave the mouse off it and back on it again. If a creature stays alive until maturity (currently 0.3 seconds), it gives birth to anywhere between 1 and 8 children into the adjacent blocks around it. Birthing happens in a reliable manner (eg, most successful births make a child in the position directly below the parent), which you'll probably notice as the creatures appearing to fall downwards like Tetris blocks. Creatures come in two colours, determined by how implicitly nervous they are - blue creatures shiver more the more nervous they are, whereas orange creatures aren't implicitly nervous enough to shiver.

Currently, I have a system that emulates:
  • Creatures (each square is a potential creature, until one is either born there, or spawned there)
  • Genes (of three genes: metabolic rate, aggressiveness, and nervousness),
  • Inheritance of genes,
  • Replication (because of the above two),
  • Energy transfer (in the form of children taking energy from parents at birth, and children absorbing the energy of the elderly if they're occupying the same space when born, causing the elderly to die and be replaced),
  • Thermodynamic behaviour for the most part (eg, ignoring energy given by the mouse through feeding and spawning creatures, energy isn't created out of nowhere, and is only "lost" as useless energy).

Random variation could be added with some careful effort, but I suspect its results wouldn't really manifest in any way noticeably different from what you currently see.

I'm still working on getting a reliable "feeding" method added to the mix, beyond children eating the elderly. What I was trying for a while - and you can still see commented out in my JS draw() function - was a feeding method that let creatures eat adjacent creatures. This was working well, but it dominated the living patterns of the creatures. With only a few creatures near one another, a checkerboard pattern would almost immediately form, with babies being born into the "holes" and getting immediately eaten by an adjacent adult with more energy.

In the attempt to get feeding working in a more complex way, I added a randomised variable that let lower-energy creatures occasionally eat higher-energy ones, but it only either slightly dampened the checkerboard effect, or resulted in flickering graphical madness.

Other than that, I encountered a few interesting phenomena. The funniest was creating what is best described as a race of immortal zombies, because creatures, when dead, were still able to feed off the living creatures near them. Another thing that happened was an explosion in the creature population when I accidentally made it possible for a parent to give birth to more children than it had the energy for.

I should mention that this idea came from a Java Applet that I found. It didn't model evolution, but it did model thermodynamics. Here it is, linked from his website, Repeat While True.


To view this content, you need to install Java from java.com

About CellShades
CellShades is derived from the concept of cellular automata, showing how complex behaviour of organic appearance can emerge from a simple set of rules. Using the mouse, the user spills liquid onto a virtual petri-dish. If the amount of liquid on any position on the grid remains above a certain level for a prolonged time, cells will emerge there. These cells will move and consume liquid to harvest energy according to a set of parameters which you may change and toy around with.

The intensity of the liquid on the grid is visualized by a color gradient from orange to purple.

Interestingly, the Applet was made in Processing, which I've seen is installed on the FBE's computers. I don't have immediate plans to try it out since there's so much software I'm already planning to get my head around as part of these experiments, but it's definitely piqued my interest.

No comments:

Post a Comment