Interface RandomNumberGenerator

All Superinterfaces:
Seedable
All Known Subinterfaces:
LinearCongruentialGenerator, RandomBetaGenerator, RandomExpGenerator, RandomGammaGenerator, RandomLongGenerator, RandomStandardNormalGenerator
All Known Implementing Classes:
ARIMASim, BaumWelch, BernoulliTrial, BinomialRNG, BoxMuller, BurnInRNG, Cheng1978, CompositeLinearCongruentialGenerator, ConcurrentCachedRLG, ConcurrentCachedRNG, ConcurrentStandardNormalRNG, ContextRNG, DiscreteHMM, ExtremeValueMC, GARCHSim, HiddenMarkovModel, HMMRNG, InverseTransformSampling, InverseTransformSamplingEVDRNG, InverseTransformSamplingExpRNG, InverseTransformSamplingGammaRNG, InverseTransformSamplingTruncatedNormalRNG, KnightSatchellTran1995, Knuth1969, KunduGupta2007, LEcuyer, Lehmer, LogNormalRNG, MARMASim, MarsagliaBray1964, MarsagliaTsang2000, MersenneTwister, MixtureHMM, MixtureHMMEM, MRG, MWC8222, NormalRNG, OUSim, RandomProcess, RandomWalk, RayleighRNG, SHR0, SHR3, SimpleMC, StandardNormalRNG, ThinRNG, ThreadIDRLG, ThreadIDRNG, UniformRNG, VanDerWaerden1969, WeibullRNG, XiTanLiu2010a, XiTanLiu2010b, Ziggurat2000, Ziggurat2000Exp, Zignor2005

public interface RandomNumberGenerator extends Seedable
A (pseudo) random number generator is an algorithm designed to generate a sequence of numbers that lack any pattern. However, it is very important to know that the sequence is not random at all and that it is completely determined by a relatively small set of initial values. Knowing the generation algorithm and the states can predict the next value, as the values are generated in a deterministic way.

By default, an implementation of RandomNumberGenerator is not thread-safe, and thus should not be shared among multiple threads. If a RandomNumberGenerator instance is used in a multi-threaded program, for example, use

RandomNumberGenerator rng = RandomNumberGenerators.synchronizedRNG(new Gaussian());
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the next random double.

    Methods inherited from interface dev.nm.stat.random.Seedable

    seed
  • Method Details

    • nextDouble

      double nextDouble()
      Get the next random double.
      Returns:
      the next random number