randomGeneratorSeed
- pyagrum.randomGeneratorSeed()
Give the seed of the pseudo-random generator, to replay a sequence of draws.
- Returns:
the seed of the generator: the value given to the last call to
pyagrum.initRandomor, if it was 0, the value taken from the current time. Given topyagrum.initRandom, or used ascore.randomSeedin a filepyagrum.ini, it repeats the same sequence of pseudo-random numbers.- Return type:
int
Example
import pyagrum as gum
gum.initRandom(0) # a seed taken from the current time
seed = gum.randomGeneratorSeed()
x = gum.randomProba()
gum.initRandom(seed) # replays the same sequence
x == gum.randomProba()
# True