public interface RandomNumberGenerator
Modifier and Type | Method and Description |
---|---|
cern.jet.random.Normal |
generateNormal(double mean,
double standardDeviation)
Generates a Gaussian (Normal) random variable with particular parameterization.
|
cern.jet.random.Poisson |
generatePoisson(double param)
Generates a Poisson random variable with particular parameterization.
|
default double |
sampleDoubleFromRange(double endExclusive)
Generates a uniformly random floating-point number within a range from
0
(exclusive) to endExclusive . |
default double |
sampleDoubleFromRange(double startExclusive,
double endExclusive)
Generates a uniformly random floating-point number within a range.
|
default double |
sampleDoubleFromZeroCenteredRange(double halfWidth)
Generates a uniformly random floating-point number centered around
0 ranging from
[-halfWidth,+halfWidth] (both exclusive). |
double |
sampleDoubleZeroAndOne()
Samples from a uniformly-distributed range between 0.0 (exclusive) and 1.0
(exclusive).
|
default <T> T |
sampleFromList(List<T> list)
Samples uniformly an element from a list.
|
default int |
sampleIntFromRange(int endExclusive)
Generates a uniformly random discrete number within a range from 0 (inclusive) to
endExclusive . |
default int |
sampleIntFromRange(int startInclusive,
int endExclusive)
Samples from a uniformly random discrete number within a range.
|
default long |
sampleLongFromRange(long endExclusive)
Generates a uniformly random discrete number within a range from 0 (inclusive) to
endExclusive . |
double sampleDoubleZeroAndOne()
cern.jet.random.Poisson generatePoisson(double param)
param
- the single parameter for the distribution.cern.jet.random.Normal generateNormal(double mean, double standardDeviation)
mean
- mean parameter for the distributionstandardDeviation
- standard-deviation parameter for the distributiondefault <T> T sampleFromList(List<T> list)
T
- type of elements in the list.list
- the list to sample an element from.default int sampleIntFromRange(int endExclusive)
endExclusive
.endExclusive
- the final number in the range (excluded from consideration).default long sampleLongFromRange(long endExclusive)
endExclusive
.endExclusive
- the final number in the range (excluded from consideration)default double sampleDoubleFromRange(double endExclusive)
0
(exclusive) to endExclusive
.endExclusive
- the final number in the range (excluded from consideration).default int sampleIntFromRange(int startInclusive, int endExclusive)
startInclusive
- the starting number in the range (included).endExclusive
- the final number in the range (excluded from consideration).default double sampleDoubleFromRange(double startExclusive, double endExclusive)
startExclusive
- the starting number in the range (excluded from consideration).endExclusive
- the final number in the range (excluded from consideration).default double sampleDoubleFromZeroCenteredRange(double halfWidth)
0
ranging from
[-halfWidth,+halfWidth]
(both exclusive).halfWidth
- half the total width of the distribution (i.e. the width of one side)Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.