Class AliasMethod
- java.lang.Object
-
- org.processmining.statisticaltests.helperclasses.AliasMethod
-
public final class AliasMethod extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AliasMethod(double[] probabilities)Constructs a new AliasMethod to sample from a discrete distribution and hand back outcomes based on the probability distribution.AliasMethod(double[] probabilities, java.util.SplittableRandom random)Constructs a new AliasMethod to sample from a discrete distribution and hand back outcomes based on the probability distribution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetProbabilitiesSize()intnext()Samples a value from the underlying distribution.
-
-
-
Constructor Detail
-
AliasMethod
public AliasMethod(double[] probabilities)
Constructs a new AliasMethod to sample from a discrete distribution and hand back outcomes based on the probability distribution.Given as input a list of probabilities corresponding to outcomes 0, 1, ..., n - 1, this constructor creates the probability and alias tables needed to efficiently sample from this distribution.
- Parameters:
probabilities- The list of probabilities.
-
AliasMethod
public AliasMethod(double[] probabilities, java.util.SplittableRandom random)Constructs a new AliasMethod to sample from a discrete distribution and hand back outcomes based on the probability distribution.Given as input a list of probabilities corresponding to outcomes 0, 1, ..., n - 1, along with the random number generator that should be used as the underlying generator, this constructor creates the probability and alias tables needed to efficiently sample from this distribution.
- Parameters:
probabilities- The list of probabilities.random2- The random number generator
-
-