COMOKIT / COMOKIT-Model

A GAMA (http://gama-platform.org) model on the assessment and comparisons of intervention policies against the CoVid19 pandemics
https://comokit.org
GNU General Public License v3.0
25 stars 18 forks source link

Same dataset, same seed -> different results ... #30

Closed benoitgaudou closed 4 years ago

benoitgaudou commented 4 years ago

I create (in COMOKIT Template Project) a new model from the template Case Studies Comparison.template without any modification. In the datasets folder, I copy the Sample dataset from COMOKIT and paste it twice in the datasets 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...

Screenshot 2020-05-11 at 10 34 44
AlexisDrogoul commented 4 years ago

Hum... Another random number leaking in perspective 😢 Hope it's not too difficult to find.

AlexisDrogoul commented 4 years ago

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.

AlexisDrogoul commented 4 years ago

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

AlexisDrogoul commented 4 years ago

Deactivating the line

current_place.individuals << self;

solves the problem... So the leaking is somehow related to the management of list/containers...

AlexisDrogoul commented 4 years ago

Should be fixed in https://github.com/gama-platform/gama/commit/ac17bc33241004169238942449757dcc82661f91