May 31, 2005

Unautomated imagination

A slight diversion: the only poem (sort of) ever to be nominated for a Nebula Award.

The Button, and What You Know

(I shall have to take this down if more than the usual handful of readers see this. So, just enjoy.)

May 28, 2005

Sigils vs Hungarian

I'm currently on part 7 of the python challenge. I find myself actually missing Perl sigils. Partly because they make string interpolation easier, and partly because they act a little like hungarian notation (the original hungarian notation, not the useless variant most commonly seen). The sigils tell you a little about what type of variable you're looking at, which can be useful in a dynamically typed language where types are not explicitly declared.

On the other hand, I suppose I could always start using hungarian notation in Python if I really felt like it. It isn't hard to come up with naming conventions that make it obvious whether a variable is an array or a subroutine or not.

Still, I miss the ease of Perl string interpolation.

Overall impression so far: Python is looking good, but I'm not comfortable with it yet.

May 25, 2005

Long day

Hey, I've got a post in my head, but I was at a conference in Santa Fe all day, then videotaping my cousins' piano recital this evening, so I wont be able to do it justice tonight. Instead I'll just give you a picture of a weird critter:

The population I started with this swimbot refuses to evolve. The body gets a bit longer and the swimming motion improves quite a lot, but the basic body plan is apparently an evolutionary dead end.

Actually, the swimbot I detailed before, and this one, are a bit atypical. Most swimbots end up in very similar final forms. More pictures later.

May 23, 2005

Python challenge

Well, Fraxas introduced me to the Python challenge, and now I'm hooked. This means that I'm actually going to have to learn Python, instead of clinging to Perl. So I'm taking this opportunity to write down my thoughts as I learn my... uh... [counts on fingers]... 13th programming language.

First observation: taking advantage of block indenting I was going to do anyway to eliminate braces is a good idea. Anything that saves me typing, especially typing unusual characters that require the shift key, is a good thing.

May 22, 2005

Automated evolution

A short history of an artificial species, in pictures.

The initial form, once it eliminated all competitors from the primordial pool:

The thing moves by stroking one arm like a paddle against the other arm, while the little fins provide some additional thrust. Longer armed mutants moved much more quickly, and soon took over:

On the other hand, large parts are sexually atractive to these critters, so a sexy mutation began to proliferate:

Of course, sexy and fast is even better:

For a while, things were stable. Occasional efficient-swimming mutations would pop up, but would eventually be eliminated by the dominant form. All this time, the swimming motions got better and better. In particular, the swimbots became much better at turning clockwise, where before they had been much more efficient while turning counter-clockwise.

Then, a sub-population with a different colour managed to establish itself (swimbots prefer to breed with other swimbots of the same colour), and in the process aquired even larger and longer parts than the dominant form:

Up to now, most mutations affected all parts in the same way. A major advance was a swimbot whose head was controlled by different genes than the rest of its parts:

Here's a successful variation that has 4 segments in its arms instead of 3, thin parts for hydrodynamic swimming, and a tiny head. The head thrashes back and forth as the bot swims, so long heads are quite inefficient, as opposed to long arms.

At this point a new, more efficient swimming motion evolved. Instead of sculling one arm as a paddle, it wiggled like a fish. This was slightly slower at the time, but used much less energy. Since the originator was sexy rather than efficient, many of the efficiency traits were lost:

And then, slowly, regained:

With the new swimming motion, many of the fins were proving a drag, so several of them were eliminated:

My current population has been stable for quite some time now, with a good compromise between sexyness and efficiency. Among other things, the fins (now used only for turning) have been made efficient, while the body remains sexy:

May 05, 2005


Occasionally one runs across a simulation that is so fun to watch that it's marketed as a game. One such is Gene Pool. You may have seen this famous video of simulated swimming block creatures. Now you can evolve your own in 2D!

Update: version 3 uses simple block shapes, while version 4 genes control the creation and motion of whole limbs on the swimbots. Personally, I think version 3 is more interesting, but only version 4 allows people to share swimbot dna. (Even so, the save file dialog sucks.)

If any of you have actually bothered to try this out or would like to jumpstart your gene pool with a few evolved swimbots, here are some. I'll add more as they evolve, since I haven't been able to find any through Google.

May 04, 2005


I haven't posted much because I've been splurging on computer games instead of using all my spare time to program. Well, OK, I did write one little program to automate some decision making calculations for Empire (don't start playing that game, BTW) but no big projects. This is probably for the best, since in two weeks I'm going back to Los Alamos to work continuously for three months.

So, in keeping with this blog's theme, I could talk about how all games are simulations, or, if I wanted to be a little less obvious, about how all simulations are games. For now though, I'm just going to assure you that when I start programming again, I'll start posting again, even though I'll be getting paid instead of working on my own projects. I may never again manage something quite so ecclectic as the Entish post, but you never know.