CodeSpriteEmbedded software consultancy
specializing in
ARM Powered systems
HomeSite MapClientsContact
Search this site 
powered by FreeFind

Free Software Downloads

Evolving Organisms

This was an experiment in Artificial Stupidity carried out in 1995, at a time when Artificial Intelligence was always in the popular press. I decided I didn't want to specify how the 'creatures' in the simulation interacted with their environment in any way, other than by setting up a pair of 'chromosomes'for six seed ants.

screenshot of ANTS program

Although the creatures were originally supposed to be ants, I added a "tail" so that we can see how they're moving, this makes them look like nematodes - small worms. The organisms live in a very simple environment. The red border is just a mechanism that I use to determine whether they have wandered out of the environment - it saves thousands of unnecessary coordinate comparisons every second. The green blobs are food, and the white space is just - well, empty space.

The two chromosomes control how the ants move when they're hunting for food, and how they move when they've found food. The most successful pairs of ants breed once they've reached a sufficient energy level and mix their chromosomes to produce new ants with totally unpredictable behaviour.

book and floppy disk graphic

The downloadable zip file contains the executable program, which runs on every system from DOS through to XP (much to my surprise), and the Borland BGI graphics library, which must be unpacked into the same directory as the executable. The zip file also has the C++ source code for the program, originally written for Borland Turbo C++. You can get much more fun out of the program by playing with the energy characteristics in the #defines at the head to the program, and the chromosomes of the first six ants in the main function. You'll see population explosions and crashes, and I've also seen 'wolf pack' behaviour. See what happens if you make the ants die if they overfeed - you may be surprised at the most successful strategy. (Hint... set MAXENERGY to something like 40000. Programmers from the bad ole days of 16-bit programs will understand why this makes the ants die when they eat too much ;) )

This program will be ported to a java applet - check back soon.