in reply to Using Perl to simulate evolution.

Two points. Yes it can be done in perl, it can be done in any programming language. I've done it in QBasic and in VisualBasic (screen saver fun).

Second point, "Like in real-world evolution, the mutations couldn't be completely random, and hopefully would help the creatures to survive -- but other creatures will also be evolving." errr what? Real-world mutations *are* random and arn't driven towards helping creatures survive. Sometimes mutations help and sometimes they give an individual enough of a benefit that they will have higher survival rates and so that mutation will survive. Realy the point is you want your mutations random because you don't know what will make things survive better. In the paste when playing with this problem I found that picking a set of attributes (like 20 or so) and storing them in a string (the dna if you will), then randomly mutating and crossing genes from two individuals can work. You have to be pretty carefull about how you store and retrieve the data or eventualy you get a mess.

One other thing I experimented with was having characters in the gene that mean different things. I.e. some of them related to the drawing of the creature and some the color, others the speed, turn rate etc. Then to figure out what attributes the creature has your read there dna. I'm not sure thats clear so here is an example. Lets say that a = speed++, b = speed--, c = turn rate ++, d = turn rate --. Then we take a creature whos DNA is "aaabbabcd", they have a speed of (4 - 2) and a turn rate of (0). In this way you can mutate the dna but you are always gauranteed to get the data you need, some creatures like this one will die pretty fast because they can't turn, etc. This could be expanded with more complex multi letter genes in the DNA but you get the idea. Just a few ideas, good luck and share what you come up with!


___________
Eric Hodges