Module simpa.acc

Class FakeRandomGenerator

java.lang.Object
java.util.Random
org.apache.commons.math3.random.JDKRandomGenerator
simpa.acc.api.utils.FakeRandomGenerator
All Implemented Interfaces:
Serializable, RandomGenerator, org.apache.commons.math3.random.RandomGenerator

public class FakeRandomGenerator extends org.apache.commons.math3.random.JDKRandomGenerator
Imitates the random generator sampling, but actually returns fixed values which repeats after n samples. Only the nextGaussian() method is implemented.
See Also:
  • Constructor Details

    • FakeRandomGenerator

      public FakeRandomGenerator()
  • Method Details

    • isReplay

      public boolean isReplay()
    • setReplay

      public void setReplay(boolean replay)
    • nextGaussian

      public double nextGaussian()
      Returns the next value from the stored values or generates a new one, depending on the replay mode.
      Specified by:
      nextGaussian in interface RandomGenerator
      Specified by:
      nextGaussian in interface org.apache.commons.math3.random.RandomGenerator
      Overrides:
      nextGaussian in class Random
      Returns:
      The next value from the stored values.