Class ProbabilityMassSampler<X>
- java.lang.Object
-
- dev.nm.stat.distribution.discrete.ProbabilityMassSampler<X>
-
-
Constructor Summary
Constructors Constructor Description ProbabilityMassSampler(List<ProbabilityMassFunction.Mass<X>> outcomes, RandomLongGenerator uniformRNG)
Creates an instance with the probable values and an RNG.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description X
next()
Gets the next random element from the range of the probability distribution.void
seed(long... seeds)
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
ProbabilityMassSampler
public ProbabilityMassSampler(List<ProbabilityMassFunction.Mass<X>> outcomes, RandomLongGenerator uniformRNG)
Creates an instance with the probable values and an RNG.- Parameters:
outcomes
- the values this distribution can take and their associated probabilitiesuniformRNG
- a uniform random number generator
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments.
-
next
public X next()
Gets the next random element from the range of the probability distribution.- Returns:
- the next random outcome
-
-