Package jasima.core.random.discrete
Class IntDistribution
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.discrete.IntSequence
-
- jasima.core.random.discrete.IntDistribution
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
IntBinomial,IntGeometric,IntHypergeometric,IntPoisson
public class IntDistribution extends IntSequence
Returns an arbitrarily distributed stream of integer numbers. Its distribution is determined by an arbitraryIntegerDistributionobject from the Apache Commons Math library. This class is usually not used directly but through its various sub-classes implementing particular distributions and exposing their parameters as Java Bean properties.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jasima.core.random.continuous.DblSequence
rndGen
-
-
Constructor Summary
Constructors Constructor Description IntDistribution()IntDistribution(org.apache.commons.math3.distribution.IntegerDistribution distribution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.math3.distribution.IntegerDistributiongetDistribution()doublegetNumericalMean()Returns the arithmetic mean of the values returned byDblSequence.nextDbl().Pair<Double,Double>getValueRange()This method computes the minimum and maximum support values (range of possible values) of this stream.intnextInt()protected voidsetDistribution(org.apache.commons.math3.distribution.IntegerDistribution distribution)Sets the discrete distribution to use.StringtoString()-
Methods inherited from class jasima.core.random.discrete.IntSequence
clone, nextDbl
-
Methods inherited from class jasima.core.random.continuous.DblSequence
createStreamDefFromStream, getName, getRndGen, init, max, min, setName, setRndGen
-
-
-
-
Method Detail
-
getDistribution
public org.apache.commons.math3.distribution.IntegerDistribution getDistribution()
-
setDistribution
protected void setDistribution(org.apache.commons.math3.distribution.IntegerDistribution distribution)
Sets the discrete distribution to use.
-
nextInt
public int nextInt()
- Specified by:
nextIntin classIntSequence
-
getNumericalMean
public double getNumericalMean()
Description copied from class:DblSequenceReturns the arithmetic mean of the values returned byDblSequence.nextDbl().- Overrides:
getNumericalMeanin classDblSequence
-
getValueRange
public Pair<Double,Double> getValueRange()
Description copied from class:DblSequenceThis method computes the minimum and maximum support values (range of possible values) of this stream.- Overrides:
getValueRangein classDblSequence- Returns:
- A
Paircontaining the minimum and maximum support values.
-
-