BoxCar2D (see here) is a little in-browser model of evolution by natural selection, using two-dimensional box cars. It randomly generates a population of wheeled polygonal vehicles, tests them on a jagged track, and uses the best-scoring vehicles to breed the next generation. That's all it does. There's no real point, no goal, and no end. It runs indefinitely, until you close your browser window, breeding faster and faster little coloured vehicles for your amusement. And a little graph shows the population's progress.

Each vehicle's body is a set of 8 vectors, of random direction and length, radiating outwards from a common point, and the ends of adjacent vectors are connected. At the end of each vector there can be a wheel, which is attached by a small arm, each of variable size, and the arm being at a variable angle to the body. Each vehicle has its own "chromosome", which encodes this information. When a vehicle runs the course, the distance that it manages to travel and the time it takes determine the probability of it being allowed to contribute to the next generation. Pairs of vehicles mate by a two-point swap of their chromosomes; that is, if you line up their chromosomes, choose two points alongside their lengths, and swap whatever information lies between those points, the result is their two progeny. There is also a mutation rate, set by the user, which is the probability that each element of each chromosome will be randomly changed during the breeding process. And by this process, vehicles (on average) become more effective at traversing the terrain.

There is also a voting feature, which allows the user to vote a vehicle up or down as it is being tested. Voting it up increases its chances of being in the breeding pool for the next generation, and voting it down removes it from the running altogether. This allows the user to be like a dog breeder, manipulating the gene pool quite directly. Or it could be interpreted as being something like the the idea of "divinely guided evolution".

The first generation is a random mess, most of the vehicles barely move at all, and there is a high incidence of bodies without wheels, completely inert. But in just a few generations, some very effective vehicles have been bred, and there are usually (in my experience) a couple of different "species" operating with different body shapes. And after a few more generations, a degree of uniformity generally prevails, with slight variations on a theme competing with each other. I find the first two or three generations to be the most interesting, since they have a much greater variety of strange, alien vehicles, most of which are quickly eliminated.

Watching these things move gives me a strange feeling. I feel as if I were watching some kind of freak show, where distorted things struggle with their own bodies. Especially in the first few generations, a large proportion of them seem to be betrayed by themselves, with a single extreme limb ruining what could have been a good design. And yet they lumber on, dragging their broken bodies uphill, until they come to a stop, their wheels still grinding against the ground. They're digital representations of theoretical vehicles, and like Camus' Sisyphus they do not resent their own hardships, but it still makes me feel pity. And there is a terrible futility about the whole exercise, with huge amounts of waste and fruitless effort for comparatively little gain. The waste can be completely unnecessary, too; since the program has no sense of which way up a vehicle "should" be, a perfectly good vehicle can be dropped on its back at the start, and never have a chance. But that's nature, and pitying them is just the pathetic fallacy.

One thing that it still needs, though, to be a proper evolutionary model, is a system of cost. Right now, it is evolution in a world of freely available energy, where there is no downside to having superfluous parts. As far as I can see, in this model it is always an advantage to have larger wheels, but in reality this is a bit absurd. If the size and number of wheels (and possibly the size of the chassis) were taken into account in scoring each vehicle, it would be much more realistic, at least in spirit. It would then favour those vehicles that are not only more effective than others, but also those that are more efficient. Tradeoffs are what natural selection is all about. This is why no animal has eyes on every limb and a brain the size of a watermelon.

Log in or register to write something here or to contact authors.