classRandom extends java.util.Random with Serializable
Single source of Random number generators from within the Cog core
software. Outside the core, cog.Library.Random is generally used.
Usage:
new cogx.utilities.Random() returns generator per the global policy on
determinism (see Random.Deterministic)
new cogx.utilities.Random(seed) returns seeded (i.e. deterministic) RNG
Ultimately, all of the underlying java.util.Random rng's have their
seeds set. The seeds are taken from the seedGenerator, itself a random
number generator. When the Deterministic flag is set, the seedGenerator
is itself seeded, so all the other rng's have deterministic seeds. When
the Deterministic flag is not set, the seedGenerator is not seeded and
so returns a random sequence of seeds to the various rng's that get created.
Cog's Random here has extra hooks to help maintain randomly initialized
fields. The idea is that such a field should look the same to multiple
observers, and also reset back to the same initial state. A field's init
function is guaranteed to be called starting with the first field point
(with all-zero coordinates), plus Cog will ask for the field points contents
in a deterministic manner.
User: Dick Carter
Date: 12/12/12
Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, java.util.Random, Serializable, AnyRef, Any
Single source of Random number generators from within the Cog core software. Outside the core, cog.Library.Random is generally used.
Usage:
new cogx.utilities.Random() returns generator per the global policy on determinism (see Random.Deterministic)
new cogx.utilities.Random(seed) returns seeded (i.e. deterministic) RNG
Ultimately, all of the underlying java.util.Random rng's have their seeds set. The seeds are taken from the seedGenerator, itself a random number generator. When the Deterministic flag is set, the seedGenerator is itself seeded, so all the other rng's have deterministic seeds. When the Deterministic flag is not set, the seedGenerator is not seeded and so returns a random sequence of seeds to the various rng's that get created.
Cog's Random here has extra hooks to help maintain randomly initialized fields. The idea is that such a field should look the same to multiple observers, and also reset back to the same initial state. A field's init function is guaranteed to be called starting with the first field point (with all-zero coordinates), plus Cog will ask for the field points contents in a deterministic manner.
User: Dick Carter Date: 12/12/12