public class RandomHelper
Constructor and Description |
---|
RandomHelper(Random random) |
Modifier and Type | Method and Description |
---|---|
static void |
main(Rail<String> id$7) |
Boolean |
nextBoolean() |
Boolean |
nextBoolean(Double p) |
Double |
nextDouble() |
Double |
nextDouble(Double max) |
Double |
nextExponential(Double lambda)
Get a sample from an exponential distribution, whose expected value is
lambda . |
Float |
nextFloat() |
Float |
nextFloat(Float max) |
Double |
nextGaussian() |
Int |
nextInt(Int max) |
Long |
nextLong(Long max) |
Double |
nextNormal(Double mu,
Double sigma)
Get a sample from a normal distribution, whose mean
mu and variance sigma ^2. |
Double |
nextUniform(Double min,
Double max)
Get a sample from a uniform distribution between
min and max . |
public Random random
public Gaussian g
public Boolean nextBoolean()
public Boolean nextBoolean(Double p)
public Double nextDouble()
public Double nextDouble(Double max)
public Float nextFloat()
public Float nextFloat(Float max)
public Int nextInt(Int max)
public Long nextLong(Long max)
public Double nextGaussian()
public Double nextUniform(Double min, Double max)
min
and max
.public Double nextNormal(Double mu, Double sigma)
mu
and variance sigma
^2.public Double nextExponential(Double lambda)
lambda
.
Cf: the standard notation may prefer the expected value to be 1 / lambda
,
but here it is lambda
so lambda can take even zero.public static void main(Rail<String> id$7)