Package sim.util.distribution
Class AbstractDiscreteDistribution
java.lang.Object
sim.util.distribution.AbstractDistribution
sim.util.distribution.AbstractDiscreteDistribution
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Binomial,EmpiricalWalker,HyperGeometric,NegativeBinomial,Poisson,PoissonSlow,Zeta,Zipfian
Abstract base class for all discrete distributions.
- See Also:
-
Field Summary
Fields inherited from class sim.util.distribution.AbstractDistribution
randomGenerator -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMakes this class non instantiable, but still let's others inherit from it. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns a random number from the distribution; returns (double) nextInt().abstract intnextInt()Returns a random number from the distribution.Methods inherited from class sim.util.distribution.AbstractDistribution
apply, apply, getRandomGenerator, setRandomGenerator
-
Constructor Details
-
AbstractDiscreteDistribution
protected AbstractDiscreteDistribution()Makes this class non instantiable, but still let's others inherit from it.
-
-
Method Details
-
nextDouble
public double nextDouble()Returns a random number from the distribution; returns (double) nextInt().- Specified by:
nextDoublein classAbstractDistribution
-
nextInt
public abstract int nextInt()Returns a random number from the distribution.- Overrides:
nextIntin classAbstractDistribution
-