Making it simple isn’t simple
Let’s get started.
Putting together the nodes and handlers is going to be somewhat painful, and slow. It might be a bit more fun, along with giving me a way to test the general concept and implementation, if I implement the handlers to help me do a particular experiment or two. There will be no getting away from days of going through, method by method, bit by bit, but this should be a much more interesting way to get started.
When I run the random birth experiment verses the precoded replicators, I’ve noticed that the precoded replicators take much more time to reach negative name fields. Why?
For starters, let’s find out if the precoded figures actually do take longer than the random birth ones. I’ll just setup each experiment and run it until I get a stable population. Then I can save the stable population, restart the system, load that population, and run it. That will give me an idea of how long it takes each one to reach negative name fields, without the results being confused by the time it takes for the population to stabilize.
For this experiment, a stable population is one that continues replicating without ever getting completely wiped out by the death object, and which never needs the birth object to insert new figures—it’s all them and their reproduction.
As the random birth experiment is already set up, we’ll start with them.
Okay, the stable random birth population is running in the background. I’ve got a pile of other things to do today, so I’ll go do those while this one cooks. Fortunately, with multiple cores, my system seems to take about the same amount of time to reach negative name fields, despite whatever else I might be doing with it.
First run, 13 minutes and 1 second.
Second run 13 minutes and eight seconds.
Third run 13 minutes and 9 seconds.
Now to do the same thing with the precoded figures.
It’s been more than 16 minutes, and the name field of the precoded run is just barely over 100,000,000. This already confirms that the precoded figures take much much longer to reach the more than 2,000,000,000 it takes for the name field to flop over to a negative number.
It’s been a bit over a half hour, and the precoded suckers aren’t even at 200,000,000 yet. that means it would take more than five hours to finish up. We can call the fact that the precoded take longer than the random birth figures confirmed.
One possible reason could be the size of the figures. The random birth figures, once stable, are 64 to 65 numbers long, while the precoded, once stable, are 6138 to 6141 long. To check this, I can change the precoded experiment so that it will produce offspring of no more than 75 numbers in length, leaving them at around the same size as the random birth figures.
This will take a moment or two.
Oops.
I got a null pointer exception at the end of that run. I know that after 22 minutes, it was still quite away from done. I hopefully fixed the problem, and this run should run to the end. This is why I want the handlers—so I don’t have bits of code spread out across half a dozen different files to keep track of. It is taking much less time, but still going much slower than the random birth figures.
First run 28:34.
Second run 29:01.
And the third and final run is 28:34
Note that I hard coded the seed for the pseudo-random number generator, so any variations in time are because of different loads on my system, not because of the operations that are taking place—each run is identical.
I have four files open for this simple experiment. That’s how many different places I had to change code. I should be able to change just one line.
The precoded figures are taking roughly 15 minutes longer to have two billion plus children. Why?
My guess is that the precoded figures are calling the random number generator much more than the random figures are. Another possibility is that the random figures generate more children, most of whom die off quickly. I could check that by adding code to a bunch of different places, but if I do it right, I should be able to modify just one file. To make it simple, isn’t simple, but this is a pretty good place to start.