Closed benoitgaudou closed 4 years ago
Hum... Another random number leaking in perspective 😢 Hope it's not too difficult to find.
Passing the same seed to different simulations, with the same dataset, I was able to reproduce it...
See the results I obtain when asking the simulations to write the cycle followed by a list of 5 random values:
0:[72,24,81,27,72]
0:[72,24,81,27,72]
1:[50,64,34,52,48]
1:[50,64,34,52,48]
2:[84,40,2,3,70]
2:[84,40,2,3,70]
3:[89,41,60,90,56]
3:[89,41,60,90,56]
4:[46,83,93,43,4]
4:[46,83,93,43,4]
5:[95,25,68,23,49]
5:[95,25,68,23,49]
6:[51,23,89,16,46]
6:[51,23,89,16,46]
7:[90,66,52,32,45]
7:[90,66,52,32,45]
8:[39,43,59,38,3]
8:[39,43,59,38,3]
9:[91,27,91,23,43]
9:[91,27,91,23,43]
10:[28,81,89,3,35]
10:[28,81,89,3,35]
11:[48,95,36,21,80]
11:[48,95,36,21,80]
12:[84,23,90,86,64]
12:[58,65,73,69,84]
13:[78,72,65,54,47]
13:[58,58,81,91,29]
It diverges at cycle 12 in that case (sometimes sooner when more simulations are created). I disabled all displays, by the way, as well as all policies, so as to isolate the problem.
After a bit of investigation, deactivating the move of individuals from one building to another (in reflex execute_agenda
) makes the simulations follow the same random pattern again... TBC
Deactivating the line
current_place.individuals << self;
solves the problem... So the leaking is somehow related to the management of list/containers...
I create (in COMOKIT Template Project) a new model from the template
Case Studies Comparison.template
without any modification. In thedatasets
folder, I copy theSample
dataset from COMOKIT and paste it twice in thedatasets
folder of COMIKIT Template Project.I have a model, with the same datasets, and the same seed for both simulations, so I was expecting exactly the same results in both simulations. Nevertheless the plot shows difference...