Friday, April 07, 2006

Artificial modelling of natural selection

I have been writing a program in Visual Basic (and learning VB as I go along, I hasten to add) which demonstrates natural selection.
The squares are "bots" - digital life, if you will. They have "genes" which encode their sex, the age they reach before they die, the age at which they mature, and the age at which they stop being able to breed. Pink is immature female; red is mature female; maroon is senile female: aqua, blue and navy are the corresponding colours for males. A bot is "born" when an empty space (white) has both a mature female and a mature male in adjacent squares. The genes of a child are copied randomly from its parents. A bot "dies" when its age reaches the maximum age value.

The program is far from perfect yet - I'm pretty sure that it isn't protected against somebody trying to crash it. It's nowhere near Avida (although it's a lot more usable!!). Also, I'd like to develop this further to do some more research, and explore more complex selection processes. But it's a start. And I've been impressed with how much you can do with VB.