I have fond memories of programming variants of Dawkin's Biomorphs program in my early teens. I even sent him one of my creations, to which a grad student of his replied with kind encouragement!
I have other JavaScript-based emergence and artificial life projects planned so if you liked these, you should sign up for the mailing list to get notified when new projects are released: http://www.emergentmind.com/newsletter
If anyone reading this finds these topics fascinating as well I'm always down for a chat: matthew.h.mazur@gmail.com or @mhmazur - cheers!
I vaguely remember in Dawkins' book that he said he was going to put a touch-sensitive screen near some flowers to see if any of the biomorphs would attract bees. The idea was that the biomorphs would evolve to be ever more pleasing to bees, and it would be interesting to see what patterns they took. Does anyone else recall this, or is it a figment of my imagination? I don't suppose anyone has tried this? Could be fun to try with an iPad.
This sounds like a great project! Worth bearing in mind though that computer screens only output in RGB, whereas the colour vision of bees is shifted to that of people; it's more G-B-UV than RGB.
I wrote a small script that evolves them based on a scoring function, paste in your console and run evolve(1000, score)
function evolve(numGenerations, scoringFn, stepInterval) {
var children = document.querySelectorAll('[id*=child]'), generation = 0
if (stepInterval == null) stepInterval = 10
function run() {
var i, child, ctx, data, score, winner, winningScore = -Infinity
for (i = children.length - 1; i >= 0; i--) {
child = children[i]
ctx = child.getContext('2d')
data = ctx.getImageData(0, 0, 318, 148)
score = scoringFn(data)
if (score > winningScore) {
winningScore = score
winner = i
}
}
children[winner].click()
if (++generation < numGenerations) setTimeout(run, stepInterval)
// console.log(winner, winningScore)
}
run()
}
function score(imageData) {
var i, r, g, b, rv = 0,
data = imageData.data, l = data.length
for (i = 0; i < l; i += 4) {
r = 255 - data[i]
g = 255 - data[i+1]
b = 255 - data[i+2]
a = data[i+3] / 255
rv += (r + g + b) * a
}
return rv
}
By the way, anyone who is new to the whole artificial life area should also take a look at Chris Adami's Avida: video [0], site [1]. Some Nature papers even came out of it, e.g. [2].
I'm going to shamelessly plug two abandonware projects of mine, being an agent-based neural network evolution sim [3] and a spatial game theory lab [4]. These might be interesting to people who like this kind of stuff.
But there's a huge amount of other stuff out there, e.g. projects like DarwinPond and prolific researchers like Martin Nowak [5].
I used to be really into artificial life simulations. Here are some directories to tons of projects like that. You will need to use web archive for a good deal of this stuff though. And a recent update of Java seems to have broken a lot of the older web based ones.
My favorite is Darwinbots, which has a lot more physics and features and things to tinker with than the average simulation. You can also directly program the bots to do whatever.
It does not take that many generations to select for traits when the diversity is already in place. This is wonderfully illustrated by these biomorphs. But when you are waiting for an innovation to appear---something not yet in the gene pool---you will have to wait a very long time. The spontaneous occurrence of innovation is exceedingly rare, and you will have to wait over Evolutionary timescales to see it happen.
When the biomorph gets too big for its canvas, I automatically reduce its branching depth until it's not too large. If you keep clicking on children that make it evolve towards larger entities, eventually it will shrink and look something like the biomorph in your screenshot.
Someone suggested that rather than automatically reduce its size, I should just make them unclickable (ie, you can only choose a child that fits within the canvas).
What do you think? Any other ideas?
Edit: I just updated the implementation so that instead of automatically reducing the child biomorph's size if it's too large, it simply becomes unclickable (you'll also get an notice if you try to click it). Should be a bit better -- thanks for the nudge!
This reminds me of programming something from A. K. Dewdney's Armchair Universe on my Amiga in the late '80s. I think it originally appeared in Scientific American.
It started off with bugs that just sort of juggled, but the ones that survived eventually glided around eating things.
Very cool! Can you implement a reverse button to store the last few sets? I notice that sometimes there is a mutation that shows up in all the offspring at once.
Heres's also a fun little video of vintage Dawkins showing off his program: http://www.youtube.com/watch?v=oDxaCJmlIGo
I have fond memories of programming variants of Dawkin's Biomorphs program in my early teens. I even sent him one of my creations, to which a grad student of his replied with kind encouragement!