object
fast_random
ï
Fast portable random number generator predicates. Core predicates originally written by Richard OâKeefe. Based on algorithm AS 183 from Applied Statistics.
logtalk_load(random(loader))
static, context_switching_calls
Single random number generator: This object provides a faster version of the
random
library object but does not support being extended to define multiple random number generators.Randomness: Loading this object always initializes the random generator seed to the same value, thus providing a pseudo random number generator. The
randomize/1
predicate 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, synchronized
reset_seed
- one
randomize/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, synchronized
randomize(Seed)
randomize(+positive_integer)
- one
Protected predicatesï
(no local declarations; see entity ancestors if any)
Private predicatesï
seed_/3
ï
Stores the current random generator seed values.
dynamic
seed_(S0,S1,S2)
seed_(-integer,-integer,-integer)
- one
Operatorsï
(none)
See also