Class RandomSingleton

java.lang.Object
nz.org.riskscape.engine.RandomSingleton

public class RandomSingleton extends Object

A global source of randomness for a riskscape process to aid reproducability of results

  • Constructor Details

    • RandomSingleton

      public RandomSingleton()
  • Method Details

    • get

      public static Random get()
      Returns:
      a Random object
    • setSeed

      public static void setSeed(long newSeed)

      Replace the RANDOM object with a new one with the given seed.

    • getSeed

      public static Long getSeed()
      Returns:
      the random seed that was last used with setSeed(long). Will be null if using a default, randomly seeded Random object.