Genetic Creatures

EDIT: fixed Dropbox link to sources & PDF. Thanks Mike!

As an elective course taken in order to fulfill requirements to complete my B.Sc., I took the course Introduction to Computational Physics, taught by Professor Karliner at Tel Aviv University. The course was a mash-up of many interesting computational techniques, most of which are used to perform approximations of physical systems.

The course included a short practical project chosen by the student. I decided to use a genetic algorithm to “breed” a kind of simulated life-form. The plan was elaborate, and I considered many complex ideas, but eventually stayed with the simplest creature I could come up with. It took form as a 3D box with four boxy “paddle” appendages. I used the Bullet physics engine, and I made the rest with C++ in Visual Studio.

Videos of the wild creatures in action after the jump.

Here is Generation Zero of a random batch:

After many unsuccessful attempts at tweaking the breeding algorithm, damping was added to the simulation, and the populations began to converge after only a few generations…

Afterwards, to up the ante, I changed the plane to accept different inclines. This demanded that the creatures climb up, instead of just in any arbitrary direction.

Finally, here is a video of the creatures reacting and adapting to an erroneous fitness function. This function mistakenly demands that the creatures go as far as possible to their right (roughly in the direction of the camera). This leads to some strange and lopsided behavior.

All the code and some binaries are available for download. You can also find a more formal writeup in .PDF format.

3 Responses

Subscribe to comments via RSS

  1. […] A software project demonstrating a genetic algorithm, using quadrupedal creatures simulated in 3D Posted on July 7, 2012 at 3:15 pm by eli · Permalink In: Uncategorized · Tagged with: academia, learning, physics, retrospective, studies, tau, tel aviv, tel aviv university, university […]

  2. Written by Mike
    on March 26, 2013 at 8:00 pm

    Hi, I would be very interested to read your write up for this project. Would it be possible to re-upload the pdf if you still have it?

    Well done on this by the way!

  3. Written by eli
    on March 26, 2013 at 9:07 pm

    Hi Mike —
    Thanks for your kind words, and for pointing out that the link is dead. I’ve fixed it, you should be able to see the files now.

Subscribe to comments via RSS