object
random
Portable random number generator predicates. Core predicates originally written by Richard O’Keefe. Based on algorithm AS 183 from Applied Statistics.
static, context_switching_calls
Multiple random number generators: To define multiple random number generators, simply extend this object. The derived objects must send to self the
reset_seed/0message.Randomness: Loading this object always initializes the random generator seed to the same value, thus providing a pseudo random number generator. The
randomize/1predicate can be used to initialize the seed with a random value.
Public predicates
reset_seed/0
Resets the random generator seed to its default value. Use get_seed/1 and set_seed/1 instead if you need reproducibility.
static, synchronizedreset_seed - onerandomize/1
Randomizes the random generator using a positive integer to compute a new seed. Use of a large integer is recommended. In alternative, when using a small integer argument, discard the first dozen random values.
static, synchronizedrandomize(Seed)randomize(+positive_integer) - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
seed_/3
Stores the current random generator seed values.
dynamicseed_(S0,S1,S2)seed_(-integer,-integer,-integer) - oneOperators
(none)
See also