Class Poisson
java.lang.Object
random.AbstractDistribution
random.discrete.DiscreteDistribution
random.discrete.Poisson
- All Implemented Interfaces:
StorableDistribution
Poisson distribution, typically used to model arrival processes in the JMT simulation engine.
-
Field Summary
Fields inherited from class DiscreteDistribution
cached, CDFList, CDFListCalculatedFields inherited from class AbstractDistribution
engine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecdf(double lambda, int x) doublecdf(int x) doubleobtain the cumulative distribution from the distributionprotected doublecheckCached(double value) protected intcheckCached(int value) intgetlower()intgetUpper()intnextRand()These functions are used to direct initialize the Discrete Distribution.protected intnextRand(double lambda) intGenerate random variables that follow an probability distributionprotected doublepmf(double lambda, int x) doublepmf(int x) doubleobtain the probability distribution from the distributiondoubleprotected doubletheorMean(double lambda) doubleCalculate the Mean value from the parameter of the distributiondoubleprotected doubletheorVariance(double lambda) doubleCalculate the Variance from the parameter of the distributionprotected <T> TunboxParameter(Parameter p, Function<Double, T> function) booleanupdatePar(double lambda) booleanSub-class must implement this method to update parameter.Methods inherited from class DiscreteDistribution
binarySearch, createdCDFList, createdCDFList, inverseTransformSampling, outdatedMethods inherited from class AbstractDistribution
setRandomEngine
-
Constructor Details
-
Poisson
public Poisson() -
Poisson
-
Poisson
-
-
Method Details
-
updatePar
-
updatePar
Description copied from class:DiscreteDistributionSub-class must implement this method to update parameter.- Specified by:
updateParin classDiscreteDistribution- Throws:
IncorrectDistributionParameterException
-
getUpper
public int getUpper()- Specified by:
getUpperin classDiscreteDistribution
-
getlower
public int getlower()- Specified by:
getlowerin classDiscreteDistribution
-
unboxParameter
protected <T> T unboxParameter(Parameter p, Function<Double, T> function) throws IncorrectDistributionParameterException -
checkCached
protected int checkCached(int value) -
checkCached
protected double checkCached(double value) -
nextRand
protected int nextRand(double lambda) -
nextRand
public int nextRand()Description copied from class:DiscreteDistributionThese functions are used to direct initialize the Discrete Distribution. once invoke parameter constructor with the distribution parameter, set cached = true. if not cache the parameter, only method with `Parameter` are available.- Specified by:
nextRandin classDiscreteDistribution
-
nextRand
Description copied from class:DiscreteDistributionGenerate random variables that follow an probability distribution- Specified by:
nextRandin classDiscreteDistribution- Parameters:
p- parameter of the distribution.- Returns:
- int - random variables that follow an probability distribution
- Throws:
IncorrectDistributionParameterException
-
pmf
protected double pmf(double lambda, int x) -
pmf
public double pmf(int x) - Specified by:
pmfin classDiscreteDistribution
-
pmf
Description copied from class:DiscreteDistributionobtain the probability distribution from the distribution- Specified by:
pmfin classDiscreteDistribution- Parameters:
x- int - random variable indicating where to evaluate the pmf.p- parameter of the distribution.- Returns:
- double - the probability weight evaluated at x.
- Throws:
IncorrectDistributionParameterException
-
cdf
protected double cdf(double lambda, int x) -
cdf
public double cdf(int x) - Specified by:
cdfin classDiscreteDistribution
-
cdf
Description copied from class:DiscreteDistributionobtain the cumulative distribution from the distribution- Specified by:
cdfin classDiscreteDistribution- Parameters:
x- int - random variable indicating where to evaluate the cdf.p- parameter of the distribution.- Returns:
- double - the probability weight cumulated at x.
- Throws:
IncorrectDistributionParameterException
-
theorMean
protected double theorMean(double lambda) -
theorMean
public double theorMean()- Specified by:
theorMeanin classDiscreteDistribution
-
theorMean
Description copied from class:DiscreteDistributionCalculate the Mean value from the parameter of the distribution- Specified by:
theorMeanin classDiscreteDistribution- Parameters:
p- parameter of the distribution.- Returns:
- double - theoretic mean value of the distribution.
- Throws:
IncorrectDistributionParameterException
-
theorVariance
protected double theorVariance(double lambda) -
theorVariance
public double theorVariance()- Specified by:
theorVariancein classDiscreteDistribution
-
theorVariance
Description copied from class:DiscreteDistributionCalculate the Variance from the parameter of the distribution- Specified by:
theorVariancein classDiscreteDistribution- Parameters:
p- parameter of the distribution.- Returns:
- double - theoretic variance value of the distribution.
- Throws:
IncorrectDistributionParameterException
-