Old-School Simulation Inspired by Genetic Algorithms – II

Our small team of Gentlemen Scientists has had the good fortune to have been friends, classmates and colleagues over the last three decades. Our earliest memories of dabbling in science and technology are collective affairs. Although we wrote our own code alone, we did inspire each other and share our research interests – which happily did (and still do) overlap to a great degree.

One common interest was genetic algorithms. It was always intuitively clear to us that the process of natural selection paired with gene-driven inheritance was a powerful way to search any large space of possibilities for optima. Following on from our previous post about simulating the evolutionary process, I was able to revive my own variation of the sunsmart critters in their virtual world (technical note: my BASIC files seemed to be corrupted at first, but I found eventually that they were stored in QuickBasic 4.5 “compressed” format instead of clear text).

My creatures are far less mobile; in fact they don’t move at all, and instead each creature occupies one cell in a square lattice. The evolutionary process proceeds in discrete steps, and each step (or “generation”) all organisms die and are replaced by their offspring – much like a cellular automaton. Every individual has a 12 bit genetic code (genotype) which translates directly to its appearance (phenotype) ….these “zoots” can have wings, any number of two, four or six legs, smaller or larger bodies, hats, and different colours. But the only thing that protects them from the deadly UV rays are sunglasses. A little “white dot” anywhere else on their two dimensional form means instant death.

Breeding is between a random pick of nearest neighbours with a fairly high rate of spontaneous “mutations” in genotypes superimposed.

As you might expect, the selection pressures of the incoming UV dots/rays dictate that sunglasses and small bodies are good; extroverted zoots with legs, wings and hats don’t do so well. And indeed, over test runs of thirty or so generations, the diversity of phenotypes is greatly reduced, and little shaded zoots begin to dominate the population. The distribution of colours stays random and roughly the same, illustrating neatly how traits that are orthogonal to selection pressures do not participate in the evolutionary process.

This was fun and pretty cutting-edge for back in the day. Nothing convinced us more of the correctness of the Darwinian theory than seeing it work in a tiny laboratory form on our own screens. We are not Richard Dawkins, but we do believe that getting our hands dirty with experimental science at a young age helped to inoculate us against much of the superstitious crap that we come across in our lives.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s