Templates
Description
set_seed(Seed) reinitializes the random number generator seed with Seed.
randomize reinitializes the random number generator. This predicates calls set_seed/1 with a random value depending on the absolute time.
Errors
Seed is a variable | instantiation_error | |
Seed is neither a variable nor an integer | type_error(integer, Seed) | |
Seed is an integer < 0 | domain_error(not_less_than_zero, Seed) | |
Portability
GNU Prolog predicates.
Templates
Description
get_seed(Seed) unifies Seed with the current random number generator seed.
Errors
Seed is neither a variable nor an integer | type_error(integer, Seed) | |
Seed is an integer < 0 | domain_error(not_less_than_zero, Seed) | |
Portability
GNU Prolog predicate.
Templates
Description
random(Number) unifies Number with a random floating point number such that 0.0 ≤ Number < 1.0.
Errors
Number is not a variable | uninstantiation_error(Number) | |
Portability
GNU Prolog predicate.
Templates
Description
random(Base, Max, Number) unifies Number with a random number such that Base ≤ Number < Max. If both Base and Max are integers Number will be an integer, otherwise Number will be a floating point number.
Errors
Base is a variable | instantiation_error | |
Base is neither a variable nor a number | type_error(number, Base) | |
Max is a variable | instantiation_error | |
Max is neither a variable nor a number | type_error(number, Max) | |
Number is not a variable | uninstantiation_error(Number) | |
Portability
GNU Prolog predicate.