gama-platform / gama

Main repository for developing the 2024+ versions of GAMA
https://gama-platform.org
GNU General Public License v3.0
31 stars 6 forks source link

Variable duration returns negative values in some cases #279

Open lesquoyb opened 3 months ago

lesquoyb commented 3 months ago

Describe the bug I have been recording the duration of the cycles of multiple simulations for a week or so, and haven't experienced any problem, but today I noticed a case where duration returned a negative value: image This is the representation of the csv generated by these lines of code:

reflex stats {
    save [cycle, duration] to:cheminRelatifDuDossierDeSortieDeSimulation + "/baptiste - Z1 - ecriture " + executerEcritureFichiers + " - buffering "+ gama.pref_write_buffering_strategy + ".csv" rewrite:false;
}

So it really should be the value of duration without any transformation. Maybe it's an overflow but it would be weird because the average value of cycles is around 1000 so we are pretty far from that and if it's caused by something external maybe we should have seen it on more cycles ? I also have the total simulation duration written at the end of it with this line:

gama.machine_time-startTime

And its value is 10 642 228 including initialisation. The value I get by summing all the durations in the csv is 10 627 422, so almost identical which doesn't go in favour of the overflow either.

To Reproduce record many simulations and be (un)lucky I guess.

Expected behavior No negative values for duration or at least some explanation of what that would mean

AlexisDrogoul commented 2 months ago

Do you have the CSV available to see the actual values ? Couldn't it be a bug elsewhere (in saving the file, etc.) ?