Package ai.libs.jaicore.math.random
Class RandomGenerator
- java.lang.Object
-
- ai.libs.jaicore.math.random.RandomGenerator
-
public class RandomGenerator extends java.lang.ObjectThis class serves as a way to obtain a globally synchronized random variable. Any part of the system requiring a random number should make use of the random variable provided by this class in order to assure a repeatability of experiments.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SEEDThe default value for the random value seed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.RandomgetRNG()Returns the random variable of this class.static longgetSeed()Returns the seed of the random variable singleton.static voidinitializeRNG(long seed)Initializes the random generator with the given seed.
-
-
-
Field Detail
-
DEFAULT_SEED
public static final int DEFAULT_SEED
The default value for the random value seed.- See Also:
- Constant Field Values
-
-
Method Detail
-
initializeRNG
public static void initializeRNG(long seed)
Initializes the random generator with the given seed.- Parameters:
seed- The random seed to use for initialization.
-
getRNG
public static java.util.Random getRNG()
Returns the random variable of this class.- Returns:
- The random variable of this class.
-
getSeed
public static long getSeed()
Returns the seed of the random variable singleton.- Returns:
- The seed of the random variable singleton.
-
-