Saturday, 29 January 2011

BoxCar 2D

BoxCar 2D is a neat little evolutionary algorithm, that over time evolves dune buggies (inside a physics engine) that have to traverse an ever more rugged landscape.

BoxCar 2D screen shot
The little plateaus in the maximum fitness achievement give a lot of information about the environment. Will it ever get over that nasty spike at 396? Yes! But then there's that steep hill at 420... It finally powered over that at generation 39. But how long until it passes that gully around 490? At generation 54, it hauls itself out, and gets as far as the next bad obstacle at 529. Even after 700 generations, it can't get past that one... (Okay, I've been running this for too long, I admit. It's quite hypnotic. And it's fun watching later generations just power over obstacles that were literally insurmountable by their ancestors.)

average fitness over 400+ generations
What this shows is a combination of the power of evolution, and the restriction of a fixed representation. The algorithm can get so far, but to get further, there needs to be more novelty available. Look at the graph of average fitness. It rapidly shoots up to several 100 (here, fitness = distance travelled), but then it's just a noisy constant, with no overall improvement. Looking at the vehicles produced, it's easy to see why. They rapidly find good solutions within the constraints of a rigid octagonal body with wheels fixed to the vertices, but can then go no further. Watching the cars race across the terrain, it's clear they need more, maybe a flexible body, maybe something else. But they're locked into the one representation: that needs to change, to develop, too. I look forward to something like BoxCar 2D but with added evo-devo!

Monday, 24 January 2011


Watched the DVD of Bill Bailey's Dandelion Mind show last night. Brilliant, as usual. There was a great Internet abbreviation song, including the marvelous punchline roflysst (Rolling On Floor Laughing Yet Somehow Still Typing).

spotting the placebo

A lovely letter in New Scientist (22 Jan 2001, p26):
From Phillip Gething

As part of my training to join a medical research ethics committee, I attended lectures on drug trials. We were told of a trial in which a patient spotted when her drugs had been switched, even though great efforts had been made to make the capsules appear identical. When asked by her GP why she thought the drugs had been changed, the patient replied, "I always put them down the loo. Until recently they always floated, now they always sink."

Fleet, Hampshire, UK
Being able to spot the placebo clearly wasn't the main problem here!

Saturday, 22 January 2011

lowercasing file names

(thanks to Ian Toyn)

find . -exec chmod u+w {} \;
for i in `find . ! -type d -name '*[A-Z]*' -print`
    oldname=`basename $i`
    newname=`echo $oldname | tr '[A-Z]' '[a-z]'`
    mv $i `dirname $i`/$newname
for i in `find . -type d -name '*[A-Z]*' -print`
    oldname=`basename $i`
    newname=`echo $oldname | tr '[A-Z]' '[a-z]'`
    mv $i `dirname $i`/$newname

PDF diagrams in LaTeX

Convert postscript to pdf using
$ epstopdf .[e]ps
$ ls *.pdf
include in LaTeX file:


deleting Temporary Internet Files

In an MSDOS command window:
1) cd to C:\Documents and Settings\MyUser\Local Settings\Temporary Internet Files\Content.IE5
(possibly have to do this one dir level at a time)
2) dir /a > tmp.txt (note the /a ; file name is not important)
3) edit tmp.txt to contain only lines like: rmdir /q /s VH8D5Q5L (/q is quiet mode; /s forces deletion of files/subdrs)
4) paste contents of tmp.txt into cmd window