Friday, October 17, 2014

Modeling of the theory of evolution

Recently I've found my ancient code. It belongs to my favorite application, which I called "Spores". There are small entities in 2D world, moving randomly. Each spore has an RGB color. Red channel value means spore's moving speed. Higher value - faster speed. Green means expected life long. Blue - speed of recuperation for reproducing. If blue value is high, then spore can reproduce frequently. When two sexually mature spores meet, they give birth to new spore with average value of both parent spores's colors plus with some probability it can mutate. As well as mutation value can be positive, it can be negative.
So, what have we got? At the beginning we have 10 spores with (10,10,10) color.
 

They start multiply. Begin to appear mutants. And those, which colored brighter have more chance to leave their DNA/color. Red spores are quick and good if density is low. In practice it's not effective property. Blue spores can multiply more frequently. This is the most useful property when density is high and amount of spores not limited. Just because green spores live longer they can give birth more. It's the most effective property when reached maximal amount of spores.
And after some time average color of all spores begins grow. It can be observed in form's caption with current amount of spores.
If leave them for 6 hours "main properties" (blue, green) will seek to the value approximately equals max value (255) minus dispersion of mutation.
There are many ways to increase evolution speed. One of the ways is set StartTimeToDie value to 100. Spores begin to live less, new generation appear more frequently. Another way is set maximal amount of spores to higher value - more blue spores will prove themselves. Then, when they will reach new limit, set value back to low. At this stage more green spores will survive.
My next thought was creating areas with bad conditions for some properties. With this zones the same things as with spores. They have an RGB color where each channel value means amount of depression corresponding spore's channel value. It did not bring the expected results

2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete