Thursday, 10 November 2011

Developer Journal 140

It's come back to bite me. Changing from genome version alpha to genome version bravo.

In version alpha, you retrieve the gene you want using a mathematical formula. There was an order to the sequence of genes. The advantage of this is that retrieving the gene you want is fast. The disadvantage is that adding new genes is hard because you have to modify the mathematical formula.

In version bravo, you retrieve genes by doing a search. There is no order to the sequence of genes. Each gene has a number of tags to uniquely identify it. The advantage of this is that adding new genes is easy. The disadvantage is that retrieving the gene you want is slow.

Starting up the simulation with a new population has become very slow. Not only that, when I ran the simulation last night, all of the robots died. Argh! I don't know what it is and it's hard to check because running the simulation takes time.

You have to make your changes small. You have to make sure your changes work. I wish I could have figured out a way to go from version alpha to bravo in smaller steps.

You have to keep an eye on how long things take. You have to time them.

Hopefully the population died because the gender constraint was active.

I added a few timers to look at how long things took to start up. The program takes 36 seconds for 8 robots. 6 seconds is for things like starting up the graphics and physics engine. Each robots takes about 3.75 seconds to start up. That doesn't sound like much but when you have about 128 robots that's 480 seconds or 8 minutes!

The majority of the time for creating a robot is creating the neural network and a large part of that is due to the searching for the required gene through the genome again and again.

I can't fix that now, indeed I'm not even sure of how to fix it other than to go back to version alpha but that has it's own problems, namely inserting new genes is difficult.

The good thing about this is that I know what's going, how long things are taking, and that it's not taking too long. This frees me from having to tinker with the genome for now. That means I can tinker with the neural network code to add neurons and synapses on the fly.

The easiest part of projects is at the start where you're day dreaming. The hard scary part is when you get to it and actually try to finish it.

Adding a neuron group looks easy. Adding a neuron to an existing group looks hard but it's not something I have to work on now. I'll have to work on it when I do things like increase the number of input neurons for vision on the fly.

1 comment:

  1. Have you considered moving your project to ec2 cluster gpu?