ncsu-landscape-dynamics / r.pops.spread

r.pops.spread - PoPS model implemented as a GRASS GIS module
https://grass.osgeo.org/grass7/manuals/addons/r.pops.spread.html
GNU General Public License v2.0
5 stars 0 forks source link

Stochastic runs with -s are always the same on Windows #2

Closed wenzeslaus closed 6 years ago

wenzeslaus commented 6 years ago

When -s is used, next time module is executed, same values are generated. However, the goal of -s is a non-deterministic result, i.e. giving a random result to the user, not a same one all the time. This was observed on MS Windows.

wenzeslaus commented 6 years ago

cppreference.com says (https://en.cppreference.com/w/cpp/numeric/random/random_device):

... random number generator that produces non-deterministic random numbers. std::random_device may be implemented in terms of an implementation-defined pseudo-random number engine if a non-deterministic source ... is not available.... In this case each std::random_device object may generate the same number sequence. ... A notable implementation where std::random_device is deterministic is MinGW (bug 338). Community MinGW random_device support implementation (mingw-std-random_device).

The situation is more complicated as revealed in the "pending-invalid" report: #338 std::random_device not working properly (https://sourceforge.net/p/mingw-w64/bugs/338/).