Class RandomGenerator

java.lang.Object
org.episteme.core.mathematics.random.RandomGenerator

public class RandomGenerator extends Object
High-quality random number generator utilities.

Provides various distributions and seed management.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • RandomGenerator

      public RandomGenerator()
    • RandomGenerator

      public RandomGenerator(long seed)
  • Method Details

    • nextReal

      public Real nextReal()
      Returns random Real in [0, 1).
    • nextReal

      public Real nextReal(Real min, Real max)
      Returns random Real in [min, max).
    • nextInteger

      public Integer nextInteger(int min, int max)
      Returns random Integer in [min, max].
    • nextNatural

      public Natural nextNatural(int bound)
      Returns random Natural in [0, bound).
    • nextBoolean

      public boolean nextBoolean()
      Returns random boolean.
    • nextGaussian

      public Real nextGaussian()
      Returns random Real from standard normal distribution N(0,1).
    • nextGaussian

      public Real nextGaussian(Real mean, Real stdDev)
      Returns random Real from normal distribution N(mean, stdDev).
    • nextExponential

      public Real nextExponential(Real lambda)
      Returns random Real from exponential distribution with rate lambda.
    • shuffle

      public <T> void shuffle(T[] array)
      Shuffles an array in-place (Fisher-Yates algorithm).
    • choice

      public <T> T choice(T[] array)
      Returns random element from array.
    • setSeed

      public void setSeed(long seed)
      Sets the seed for reproducibility.