Click above for a new generation.
Refresh this page to get a whole new population.

-

Petri Dish is a small project about evolving worm-like creatures. Each worm has a DNA of a certain length. The speed with which a worm travels determines its 'fitness'. In every generation, the most succesful worms mate and produce children that inherit DNA from their parents. So after a number of generations, the worms 'learn' how to move. The fastest worms leave a white trail behind them. This project was done for the Media Technology MSc Program at Leiden University, The Netherlands.

Download source code (Actionscript 3)

The text below explains in detail what methods we used.

-

THE EFFECT OF MEMORY LENGTH ON DISPLACEMENT IN WORM-LIKE CREATURES

by Lisa Dalhuijsen, Bastiaan Terhorst and Casper Kaandorp

Summary

This text discusses our research into the effects of memory length on displacement in worm-like creatures in a simulated environment. Worms with movement-defining memory sequences of different lengths were evolved using a genetic algorithms. Results show that apart from very small sequences, the length has little impact on the worm’s ability to move around.


Introduction

Worms, snakes and other elongated creatures without limbs have evolved sophisticated methods of motion. They are often seen curling about, moving in a highly efficient, fluent and beautiful manner. This motion can be considered a sequence of instructions that cause the creature to move in a certain direction. We are interested in looking into the effects of the length of this sequence with respect to the efficiency of the motion that is evolved. In other words, we will attempt to find out how much memory a wormlike being requires in order to move around efficiently. Our hypothesis is that while increased memory may increase efficiency up to a certain point, having too much of it will actually hinder development.


Approach

To simplify the problem we chose to simulate the development of a population of worm-like creatures. These worms have a certain DNA configuration that determines their sequence of movement. The population is instantiated and given a certain time to move about. Afterwards, the distance traveled is determined for each of the individuals of the population. Then, the population is evolved using a genetic algorithm.



Genetic Algorithm

We used a simple genetic algorithm to evolve the DNA of each generation of worms. The worms are constructed as a series of joints, with segments in between. The DNA consists of a series of joint numbers combined with a certain muscle contraction. Possible muscle contractions are relaxed, left, right and both left and right at the same time. Positions of joints down the chain are affected by the rotation of joints higher in the chain.

Evolution is achieved by recombining the best half of the population. This best half is also preserved into the next generation. We recombined this group using two-point crossover as follows:

  mother
  father
  child

In this way, half of the father’s DNA is combined with half of the mother’s DNA. We tried out some different methods. In the following example the parts of the DNA stay in the same position as in the original DNA string.

  mother
  father
  child

But it turned out that worms started behaving exactly alike after a few generations. We also tried to take random parts of the parents’s DNA and combine those:

  mother
  father
  child

But it turned out that this was too random – the ‘fit’ properties of the parents were lost.

The total distance that a worm travels in a certain number of iterations is the ‘fitness’ of that worm.

We opted not to include mutation as it turned out that it slowed down evolution. Even though this might cause us to end up in a local optimum faster than otherwise, our goal is actually not to evolve these worms in to an optimal motion. We are only concerned with the comparison of different DNA lengths, which is perfectly possible using this approach.



Movement Constraints

We imposed several constraints on the rotation of joints to mimic some aspects of a natural environment. We account for mass inertia and joint rotation is distributed over the worm using the head and tail as weights. Also, joints have a maximum angle of rotation, and we ensure that joints do not overlap (we assume a 2-dimensional space in which the worms move about). This provides us with a simple environment that is still realistic enough to provide us with pertinent data.


Results

One of the most striking results is that a DNA sequence of one and two yields significantly lower results than all following DNA lengths that were tested. This leads us to believe there is a minimal amount of joints contractions required to bring about any significant movement. Also, it turned out that a longer DNA string doesn’t necessarily have a positive effect on the movement of the worms. In fact, if we look at increasing DNA lengths, we see a decreasing average fitness.




Discussion

While our results show that DNA length has little significance except when using extremely small sequences, we feel there is much room for improvement in our research. For instance, the number of joints could be varied to measure its influence. Also, the lengths of segments can be varied and compared to DNA length.