Did you know ... | Search Documentation: |
Pack logtalk -- logtalk-3.85.0/docs/_sources/random_0.rst.txt |
.. index:: random .. _random/0:
.. rst-class:: right
object
random
Portable random number generator predicates. Core predicates originally written by Richard O'Keefe. Based on algorithm AS 183 from Applied Statistics.
| Availability:
| logtalk_load(random(loader))
| Author: Paulo Moura | Version: 2:11:0 | Date: 2023-11-24
| Compilation flags:
| static, context_switching_calls
| Implements:
| public
:ref:`pseudo_random_protocol <pseudo_random_protocol/0>`
| Uses:
| :ref:`list <list/0>`
| Remarks:
| Inherited public predicates: | Â :ref:`random_protocol/0::between/3` Â :ref:`random_protocol/0::enumerate/2` Â :ref:`pseudo_random_protocol/0::get_seed/1` Â :ref:`random_protocol/0::maybe/0` Â :ref:`random_protocol/0::maybe/1` Â :ref:`random_protocol/0::maybe/2` Â :ref:`random_protocol/0::maybe_call/1` Â :ref:`random_protocol/0::maybe_call/2` Â :ref:`random_protocol/0::member/2` Â :ref:`random_protocol/0::permutation/2` Â :ref:`random_protocol/0::random/1` Â :ref:`random_protocol/0::random/3` Â :ref:`random_protocol/0::randseq/4` Â :ref:`random_protocol/0::randset/4` Â :ref:`random_protocol/0::select/3` Â :ref:`random_protocol/0::select/4` Â :ref:`random_protocol/0::sequence/4` Â :ref:`random_protocol/0::set/4` Â :ref:`pseudo_random_protocol/0::set_seed/1` Â :ref:`random_protocol/0::swap/2` Â :ref:`random_protocol/0::swap_consecutive/2` Â
.. contents:: :local: :backlinks: top
.. index:: reset_seed/0 .. _random/0::reset_seed/0:
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.
| Compilation flags:
| static, synchronized
| Mode and number of proofs:
| reset_seed
- one
.. index:: randomize/1 .. _random/0::randomize/1:
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.
| Compilation flags:
| static, synchronized
| Template:
| randomize(Seed)
| Mode and number of proofs:
| randomize(+positive_integer)
- one
(no local declarations; see entity ancestors if any)
.. index:: seed_/3 .. _random/0::seed_/3:
seed_/3
^^^^^^^^^^^
Stores the current random generator seed values.
| Compilation flags:
| dynamic
| Template:
| seed_(S0,S1,S2)
| Mode and number of proofs:
| seed_(-integer,-integer,-integer)
- one
(none)
.. seealso::
:ref:`fast_random <fast_random/0>`, :ref:`backend_random <backend_random/0>`