[wp_sitemap_page]

Evolution simulation

Many people claim that evolution is impossible because nothing can emerge from randomness. But is randomness the only factor in evolution? What if there are other forces at play that shape the diversity and complexity of life? To explore this question, I created an algorithm that simulates evolution and reveals some surprising results.

The code is found on GitHub.

Consider an empty world. Void of meaning and possibilities. In this world, a robot snaps into existence. Not able to see anything. Its visual input is as empty as the universe it got created into. The robot does not have a will. It just does something random. What it does not know is, that there are 50 other robots also created at the same time. They all act differently. Some are wandering around, some are standing still and some are turning in circles. Then suddenly, there is a change for one robot. Its input changes. It sees something red. The others that are at the same place see it too. So, they act randomly. Some are moving towards it, some don’t. What is it with this red thing? The closer a robot gets, the more clearly it sees it, until it can touch it. For void thou art, and unto void shalt thou return. The robot disappears. Every robot touching the red things disappears. Dies. After some time, only those robots remain, which either do not move or if they do, they don’t touch the red thing. This happens automatically, just by the laws of this universe. As the robots disappear, new random ones get created and thrown into the world such that the population is not dying out. And the evening and the morning were the first day.

On the second day, they faced a new problem. Namely, there were some rumors about a green thing. Most of the robots acted the same towards the greens, as evolution favored the cautious individuals. But some robots just vanish without touching the reds. Their lifespan ran out, and they have not figured out the secret of survival. Well, most didn’t. Some had the random behavior to go towards the green things. And when they touched, something magical happened. They, one, increased their lifespan unknowingly, and two, reproduced. They spawned a copy of themselves which is very similar to them but just slightly different. With a random variation in behavior. This changes everything. Instead of not dying, the game became reproducing. Soon, all robots avoided the red stuff and searched for the green stuff.

Now the next stage is approaching. Before, caution was key. Don’t move too fast to reduce the risk of accidentally touching the red mines. But after some time, some robots just randomly got faster, and they were always first at the green magic fruit. The cautious ones starved to death because the faster ones got there first. So, speed is key. But, they have to risk more now. Many robots are now dying because of the mines, but as long as they reproduce faster they dominate this world.

The last stage. Now the robots evolved to a useful behavior without human intervention, just by exposure to this very specific environment. There is now only one last optimization remaining. They slowly but surely have to avoid the mines and increase their base speed to their max. After this development, an equilibrium is reached and from pure randomness without programming there emerged intelligent behavior regarding this environment.

Not so optimized robots
Optimized robots
Field of view of the robots visualized

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *