Hey! Is this post going to be about Red Metropolis and telling you its 100% done and ready to go? Nope!
But seriously, ever since I took evolutionary computing a year or so back, I’ve been wanting to use what I learned in that course for something. For those of you who don’t know what evolutionary computing is, its basically all genetic algorithms and programs. Now, these aren’t algorithms that deal with genetics, its using the theory of evolution (The most fit specimens survive, each successive generation is more better then the previous, etc) to solve a problem, or at the very least come up with a really good solution.
One of the example problems we did in class was to make an algorithm that took a series of points on a graph and come up with a formula for the curve. The results were pretty cool, it would randomly assign a few formulas as a base case, all of which were terrible. It would then grade them and “mate” them (basically just copy and paste sections from each algorithm together) and in about 20-30 generations you had something that was only fractions off from the original curve. Pretty cool stuff.
Anyways, what I want to do with that is make a simplistic simulation of animals and see how they evolve. This isn’t really so much to model actual animals, but more just to see how the animals evolve and interact with each other. I think it will be cool to see if some animals become predators, or see if any develop any interesting escape mechanisms, or even pack behaviour.
Most genetic algorithms run against some sort of fitness metric, something to determine if the object in question is moving in the right direction. For this kind of simulation though there really isn’t a fitness metric I can think of, and it may not even need one. The goal is to create the best animal for the current environment. I guess the best way to determine that is how well the animal survives. If the animal is able to live comfortably (eg, get food) and live long enough (avoid predators) it will have more offspring than an animal that dies after its first offspring. That should ensure that fit animals prosper and lesser animals are either removed from the simulation, or evolve and adapt. Fun.
Now, onto actual metrics and how I plan to go about doing this. I want it to be as simplistic as possible while maintaining some key aspects, namely finding food, avoiding predators, exploring areas and finding a mate. Animals will be split into two parts, the physical representation of them (all the variables that deal with their body, eg: weight, speed, size, age, etc) and a decision tree that deals with the “brain” of the animal (its hunger, what it does in given situations, etc). I want to make everything the animal does count towards its fitness, for example, moving draining their hunger and increasing their muscles, etc. How well the animal eats should have an impact on it as well. Fat animals should increase in ability faster then starving animals. And to make things interesting in the brain side of things, I’ll probably set a limit on how many nodes on the tree are processed at once, encouraging it to be as efficient as possible.
Whew, long post. Now I’m not saying this is the next thing I’m working on, or if I’ll actually start working on it, it’s just something I’ve been thinking about lately. It would be fun to take a weekend and see what I can get done, so maybe I will.