Java org.apache.commons.math3.random RandomDataGenerator fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.math3.random RandomDataGenerator fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.math3.random RandomDataGenerator.

The text is from its open source code.

Constructor

RandomDataGenerator()
Construct a RandomDataGenerator, using a default random generator as the source of randomness.
RandomDataGenerator(RandomGenerator rand)
Construct a RandomDataGenerator using the supplied RandomGenerator as the source of (non-secure) random data.

Method

intnextBinomial(int numberOfTrials, double probabilityOfSuccess)
Generates a random value from the BinomialDistribution Binomial Distribution .
doublenextExponential(double mean)

Algorithm Description: Uses the Algorithm SA (Ahrens) from p.

doublenextGaussian(double mu, double sigma)
intnextInt(int lower, int upper)
longnextLong(long lower, long upper)
int[]nextPermutation(int n, int k)

Uses a 2-cycle permutation shuffle.

longnextPoisson(double mean)

Algorithm Description:

  • For small means, uses simulation of a Poisson process using Uniform deviates, as described here. The Poisson process (and hence value returned) is bounded by 1000 * mean.
  • For large means, uses the rejection algorithm described in
    Devroye, Luc.
doublenextUniform(double lower, double upper, boolean lowerInclusive)

Algorithm Description: if the lower bound is excluded, scales the output of Random.nextDouble(), but rejects 0 values (i.e., will generate another random double if Random.nextDouble() returns 0).

doublenextUniform(double lower, double upper)

Algorithm Description: scales the output of Random.nextDouble(), but rejects 0 values (i.e., will generate another random double if Random.nextDouble() returns 0).

voidreSeed(long seed)
Reseeds the random number generator with the supplied seed.