Class RandomGenerator


  • public class RandomGenerator
    extends java.lang.Object
    This 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 int DEFAULT_SEED
      The default value for the random value seed.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Random getRNG()
      Returns the random variable of this class.
      static long getSeed()
      Returns the seed of the random variable singleton.
      static void initializeRNG​(long seed)
      Initializes the random generator with the given seed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.