public class SeededRandom
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
org.apache.commons.math3.random.RandomGenerator |
generator |
| Constructor and Description |
|---|
SeededRandom(org.apache.commons.math3.random.RandomGenerator generator) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.math3.distribution.BetaDistribution |
beta(double alpha,
double beta)
Returns a generator for the Beta distribution with given parameters.
|
org.apache.commons.math3.distribution.BinomialDistribution |
binomial(int n,
double p)
Returns a generator for the Binomial distribution with given parameters.
|
org.apache.commons.math3.distribution.CauchyDistribution |
cauchy(double median,
double scale)
Returns a generator for the Cauchy distribution with given parameters.
|
org.apache.commons.math3.distribution.ChiSquaredDistribution |
chiSquared(double degreesOfFreedom)
Returns a generator for the Chi Squared distribution with given degrees of freedom.
|
static SeededRandom |
create()
Deprecated.
use
create(long seed) if wanting to directly create with seed (unadvised
without due cause) |
static SeededRandom |
create(long seed) |
static org.apache.commons.math3.random.RandomGenerator |
createGenerator(long seed) |
org.apache.commons.math3.distribution.UniformIntegerDistribution |
discrete(int lower,
int upper)
Returns a generator of integer values in the range lower <= n <= upper
|
org.apache.commons.math3.random.EmpiricalDistribution |
empiricalFromSource(Source dataSource)
Returns a smoothed distribution based on source
|
org.apache.commons.math3.distribution.EnumeratedIntegerDistribution |
enumeratedInteger(int[] ints,
double[] ps)
Returns a generator for the Enumerated Integer distribution, with given parameters.
|
org.apache.commons.math3.distribution.EnumeratedRealDistribution |
enumeratedReal(double[] doubles,
double[] ps)
Returns a generator for the Enumerated Real distribution, with given parameters.
|
org.apache.commons.math3.distribution.ExponentialDistribution |
exponential(double mean)
Returns a generator for the Exponential distribution with given mean.
|
org.apache.commons.math3.distribution.FDistribution |
f(double numeratorDegreesOfFreedom,
double denominatorDegreesOfFreedom)
Returns a generator for the F Distribution with given degrees of freedom.
|
org.apache.commons.math3.distribution.GammaDistribution |
gamma(double shape,
double scale)
Returns a generator for the Gamma distribution with given parameters.
|
org.apache.commons.math3.distribution.NormalDistribution |
gaussian(double mean,
double standardDeviation)
Returns a generator for the Gaussian (or Normal) distribution with given parameters.
|
org.apache.commons.math3.distribution.GeometricDistribution |
geometric(double p)
Returns a generator for the Geometric distribution with given parameter.
|
boolean |
getNextBoolean() |
boolean |
getNextBoolean(double probability) |
double |
getNextDouble() |
double |
getNextDouble(double n) |
float |
getNextFloat() |
float |
getNextFloat(float n) |
int |
getNextInt() |
int |
getNextInt(int n) |
java.util.Random |
getRandom() |
long |
getSeed()
Note: If you setSeed to the generator directly - you will override the value actually used in your random generation
however when you get the value here it will be different.
|
org.apache.commons.math3.distribution.HypergeometricDistribution |
hypergeometric(int populationSize,
int numberOfSuccesses,
int sampleSize)
Returns a generator for the Hypergeometric Distribution, with given parameters.
|
org.apache.commons.math3.distribution.LevyDistribution |
levy(double mu,
double c)
Returns a generator for the Levy Distribution, with given parameters.
|
org.apache.commons.math3.distribution.LogNormalDistribution |
logNormal(double scale,
double shape)
Returns a generator for the Log Normal distribution with given parameters.
|
org.apache.commons.math3.distribution.MixtureMultivariateNormalDistribution |
mixtureMultivariateNormal(double[] weights,
double[][] means,
double[][][] covariances)
Returns a generator for the Mixture Multivariate Normal Distribution.
|
org.apache.commons.math3.distribution.MultivariateNormalDistribution |
multivariateNormal(double[] means,
double[][] covariances)
Returns a generator for the Multivariate Normal Distribution
|
org.apache.commons.math3.distribution.NormalDistribution |
normal(double mean,
double standardDeviation) |
org.apache.commons.math3.distribution.ParetoDistribution |
pareto(double scale,
double shape)
Returns a generator for the Pareto distribution with given parameters.
|
org.apache.commons.math3.distribution.PascalDistribution |
pascal(int r,
double p)
Returns a generator for the Pascal Distribution
|
org.apache.commons.math3.distribution.PoissonDistribution |
poisson(double mean)
Returns a generator for the Poisson distribution with given mean.
|
void |
setSeed(long newSeed)
Updates the random number generator with a new seed value.
|
org.apache.commons.math3.distribution.TDistribution |
t(double degreesOfFreedom)
Returns a generator for the Student's T Distribution, with given degrees of freedom.
|
org.apache.commons.math3.distribution.TriangularDistribution |
triangular(double a,
double c,
double b)
Returns a generator for the Triangular distribution, with given parameters.
|
org.apache.commons.math3.distribution.UniformRealDistribution |
uniform(double lower,
double upper)
Returns a generator of floating point values in the range lower <= n < upper
|
org.apache.commons.math3.distribution.WeibullDistribution |
weibull(double alpha,
double beta)
Returns a generator for the Weibull distribution, with given parameters.
|
org.apache.commons.math3.distribution.ZipfDistribution |
zipf(int numberOfElements,
double exponent)
Returns a generator for the Zipf Distribution
|
public SeededRandom(org.apache.commons.math3.random.RandomGenerator generator)
public static org.apache.commons.math3.random.RandomGenerator createGenerator(long seed)
@Deprecated public static SeededRandom create()
create(long seed) if wanting to directly create with seed (unadvised
without due cause)ModelContextAccessor.map(model).getPrng if not within model. AgentBasedModel.getcontext.getPrng if already within a model.
public static SeededRandom create(long seed)
public java.util.Random getRandom()
public boolean getNextBoolean()
public boolean getNextBoolean(double probability)
public int getNextInt()
public int getNextInt(int n)
public double getNextDouble()
public double getNextDouble(double n)
public float getNextFloat()
public float getNextFloat(float n)
public long getSeed()
public void setSeed(long newSeed)
newSeed - public org.apache.commons.math3.distribution.BetaDistribution beta(double alpha,
double beta)
https://en.wikipedia.org/wiki/Beta_distribution
alpha - beta - public org.apache.commons.math3.distribution.BinomialDistribution binomial(int n,
double p)
n - Number of trialsp - Probability of successpublic org.apache.commons.math3.distribution.CauchyDistribution cauchy(double median,
double scale)
median - scale - public org.apache.commons.math3.distribution.ChiSquaredDistribution chiSquared(double degreesOfFreedom)
degreesOfFreedom - public org.apache.commons.math3.distribution.UniformIntegerDistribution discrete(int lower,
int upper)
lower - upper - public org.apache.commons.math3.distribution.EnumeratedIntegerDistribution enumeratedInteger(int[] ints,
double[] ps)
ints - Random variable valuesps - Random variable probabilitiespublic org.apache.commons.math3.distribution.EnumeratedRealDistribution enumeratedReal(double[] doubles,
double[] ps)
doubles - Random variable valuesps - Random variable probabilitiespublic org.apache.commons.math3.distribution.ExponentialDistribution exponential(double mean)
mean - public org.apache.commons.math3.distribution.FDistribution f(double numeratorDegreesOfFreedom,
double denominatorDegreesOfFreedom)
numeratorDegreesOfFreedom - denominatorDegreesOfFreedom - public org.apache.commons.math3.distribution.GammaDistribution gamma(double shape,
double scale)
shape - scale - public org.apache.commons.math3.distribution.GeometricDistribution geometric(double p)
p - public org.apache.commons.math3.distribution.NormalDistribution gaussian(double mean,
double standardDeviation)
mean - standardDeviation - public org.apache.commons.math3.distribution.NormalDistribution normal(double mean,
double standardDeviation)
public org.apache.commons.math3.distribution.HypergeometricDistribution hypergeometric(int populationSize,
int numberOfSuccesses,
int sampleSize)
populationSize - numberOfSuccesses - sampleSize - public org.apache.commons.math3.distribution.LevyDistribution levy(double mu,
double c)
mu - c - public org.apache.commons.math3.distribution.LogNormalDistribution logNormal(double scale,
double shape)
scale - shape - public org.apache.commons.math3.distribution.MixtureMultivariateNormalDistribution mixtureMultivariateNormal(double[] weights,
double[][] means,
double[][][] covariances)
weights - means - covariances - public org.apache.commons.math3.distribution.MultivariateNormalDistribution multivariateNormal(double[] means,
double[][] covariances)
means - covariances - public org.apache.commons.math3.distribution.PascalDistribution pascal(int r,
double p)
r - p - public org.apache.commons.math3.distribution.ParetoDistribution pareto(double scale,
double shape)
scale - shape - public org.apache.commons.math3.distribution.PoissonDistribution poisson(double mean)
mean - public org.apache.commons.math3.distribution.TDistribution t(double degreesOfFreedom)
degreesOfFreedom - public org.apache.commons.math3.distribution.TriangularDistribution triangular(double a,
double c,
double b)
a - Minimum valuec - Peak valueb - Maximum valuepublic org.apache.commons.math3.distribution.UniformRealDistribution uniform(double lower,
double upper)
lower - upper - public org.apache.commons.math3.distribution.WeibullDistribution weibull(double alpha,
double beta)
alpha - beta - public org.apache.commons.math3.distribution.ZipfDistribution zipf(int numberOfElements,
double exponent)
numberOfElements - exponent - public org.apache.commons.math3.random.EmpiricalDistribution empiricalFromSource(Source dataSource)
dataSource - Histogram representing a distribution