The last time I was working on the simulation, I set the number of internal neuron groups to one and the number of internal neurons to sixteen.
The reason I was doing this was to see whether the population was dying out because some agents had too few internal neurons and because other agents had too many.
When I did this, the program complained that there were more neurons than the program expected. I spent a long while tracking down the error and found out the cause. The previous programmer had written the code in a non-dynamic way with a few assumptions. The code assumed that every input and output neuron group would have only one neuron.
That was a fair enough assumption. However, my neural network has input and output communication neuron groups. These groups have eight neurons each. This was what caused the miscount.
I was lucky that the previous programmer had written code to check the number of neurons. I would prefer that the neural network code be completely dynamic.
Before I worked on specifying the number of internal neurons, I was working on improving the performance of the simulation. I changed the rendering code from non-immediate mode to immediate mode. I also modified the code to use a viewing frustum. There are more things I can do with immediate mode but the performance I've got at the moment is good enough. I need to do some more profiling to decide what to optimise.
I suspect that I can optimise the pixel reading code, the communication code and the neural network activation and update code.
Before I do more optimising, I've decided to work on getting the population to be stable.
- Remove agent death from old age
- Remove agent ability to hit
- Reduce energy drain and energy action costs
- Reduce energy usage for a period after mating as a reward for mating
- Reduce the number of agent body colours
- Modify agent vision from smudge vision to splat vision
- Increase the number of pixels for vision
- Reduce the size of the world
- Stagger the introduction of agents