Monday, 20 June 2011

Developer Journal 102 - On Persistent Populations


I left the simulation running from Friday night, from a new population. Something had gone wrong with the serialization process so I could not load 110617-1500 (19 MB). Unfortunately the population had died out some time over the weekend. I'm not sure what's going on because there was plenty of food.

The things that come immediately to mind to try is to reduce the rate of energy usage per second and allow reproduction to occur slightly more often. I also remember that in previous successful simulation runs I had to start with a larger population of roughly at least 64 robots. Grr, I should have kept track of this.

Changing starting population from 16 to 32.
Changing old enough to reproduce time from 60 minutes to 15 minutes.
Changing long enough to reproduce again time from 60 minutes to 15 minutes.

Now to let the simulation run and see what happens. I need to set up a second computer again to let the simulation run while I continue working through my action list.

Step: 191342 NumFood: 8 NumFoodEver: 194 NumCrit: 19 NumCritEver: 59
numSick: 0
numChild: 0
0 to 10000: 2
10000 to 20000: 0
20000 to 30000: 2
30000 to 40000: 0
40000 to 50000: 0
50000 to 60000: 2
60000 to 70000: 0
70000 to 80000: 0
80000 to 90000: 1
90000 to 100000: 0
100000 to 110000: 0
110000 to 120000: 0
120000 to 130000: 0
130000 to 140000: 0
140000 to 150000: 1
150000 to 160000: 0
160000 to 170000: 2
170000 to 180000: 0
180000 to 190000: 0
190000 to 200000: 9

110620-1434 (6 MB). Looks good. The initial population had 32 robots. The number of robots dropped to 16 and then slowly increased. The numbers such as 190000 to 200000: 9, indicate that there are 9 robots that have lived to an age between 190000 to 200000 steps. I plan to change this soon to hours, minutes, and seconds to make things more intuitive.

A fair number of the initial population and the offspring die out. I'd love to know the reasons.

Yah! I just programmed a little piece of code to track how much simulation and real time has passed.

elapsed real time: 10 seconds
elapsed sim time:  3.53333 seconds
total real time:   10 seconds
total sim time:    3.53333 seconds

elapsed real time: 10 seconds
elapsed sim time:  3.7 seconds
total real time:   20 seconds
total sim time:    7.23333 seconds

elapsed real time: 10 seconds
elapsed sim time:  3.73333 seconds
total real time:   30 seconds
total sim time:    10.9667 seconds

elapsed real time: 10 seconds
elapsed sim time:  3.63333 seconds
total real time:   40 seconds
total sim time:    14.6 seconds

elapsed real time: 10 seconds
elapsed sim time:  3.66667 seconds
total real time:   50 seconds
total sim time:    18.2667 seconds

elapsed real time: 10 seconds
elapsed sim time:  3.3 seconds
total real time:   1 minute 0 seconds
total sim time:    21.5667 seconds

I need to handle what happens when the simulation is paused. Then I need to polish the code and add it to the serialization process.

I played around with different ways of handling what happens when the simulation is paused. For example, if I displayed the timers once every minute, and I've waited half a minute, and then paused, when I un-pause and wait another half a minute, the timers should be displayed. This took me ages, I stared at the screen and went through heaps of silly complicated versions. Grr. Though there is something nice about having those stats.



RELATED

No comments:

Post a Comment