Class RandomNumberGeneratorMersenne

Object
RandomNumberGeneratorMersenne
All Implemented Interfaces:
RandomNumberGenerator

public class RandomNumberGeneratorMersenne extends Object implements RandomNumberGenerator
Implements a random-number generator using the MersenneTwister algorithm.

Either one fixed constant-seed or the system clock will be used as a seed.

Author:
Owen Feehan
  • Constructor Details

    • RandomNumberGeneratorMersenne

      public RandomNumberGeneratorMersenne(boolean fixedSeed)
      Creates indicating whether to use a fixed-seed or not.
      Parameters:
      fixedSeed - if true, a fixed constant-seed. if false, the seed is the system clock.
  • Method Details

    • sampleDoubleZeroAndOne

      public double sampleDoubleZeroAndOne()
      Description copied from interface: RandomNumberGenerator
      Samples from a uniformly-distributed range between 0.0 (exclusive) and 1.0 (exclusive).
      Specified by:
      sampleDoubleZeroAndOne in interface RandomNumberGenerator
      Returns:
      the randomly-sampled number.
    • generatePoisson

      public cern.jet.random.Poisson generatePoisson(double param)
      Description copied from interface: RandomNumberGenerator
      Generates a Poisson random variable with particular parameterization.
      Specified by:
      generatePoisson in interface RandomNumberGenerator
      Parameters:
      param - the single parameter for the distribution.
      Returns:
      a random-distribution from which sampling can occur.
    • generateNormal

      public cern.jet.random.Normal generateNormal(double mean, double standardDeviation)
      Description copied from interface: RandomNumberGenerator
      Generates a Gaussian (Normal) random variable with particular parameterization.
      Specified by:
      generateNormal in interface RandomNumberGenerator
      Parameters:
      mean - mean parameter for the distribution
      standardDeviation - standard-deviation parameter for the distribution
      Returns:
      a random-distribution from which sampling can occur.