Package jasima.core.random.discrete
Class IntDiscretized
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.discrete.IntSequence
-
- jasima.core.random.discrete.IntDiscretized
-
- All Implemented Interfaces:
Serializable,Cloneable
public class IntDiscretized extends IntSequence
Turns an arbitraryDblSequenceinto anIntSequenceby returning its values rounded to the closest integer.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jasima.core.random.continuous.DblSequence
rndGen
-
-
Constructor Summary
Constructors Constructor Description IntDiscretized()IntDiscretized(DblSequence baseStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntDiscretizedclone()Clones the current number stream.DblSequencegetBaseStream()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.voidinit()Initializes this stream.intnextInt()voidsetBaseStream(DblSequence baseStream)voidsetRndGen(Random rndGen)Sets the random number generator to be used if this stream has a random component.StringtoString()-
Methods inherited from class jasima.core.random.discrete.IntSequence
nextDbl
-
Methods inherited from class jasima.core.random.continuous.DblSequence
createStreamDefFromStream, getName, getRndGen, max, min, setName
-
-
-
-
Constructor Detail
-
IntDiscretized
public IntDiscretized()
-
IntDiscretized
public IntDiscretized(DblSequence baseStream)
-
-
Method Detail
-
init
public void init()
Description copied from class:DblSequenceInitializes this stream. This method is supposed to be called once before repeated calls toDblSequence.nextDbl()can be made.- Overrides:
initin classDblSequence
-
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.
-
setRndGen
public void setRndGen(Random rndGen)
Description copied from class:DblSequenceSets the random number generator to be used if this stream has a random component.- Overrides:
setRndGenin classDblSequence
-
clone
public IntDiscretized clone()
Description copied from class:DblSequenceClones the current number stream. This method fails with aCloneNotSupportedExceptionif there is a random number generator associated with this stream.- Overrides:
clonein classIntSequence
-
getBaseStream
public DblSequence getBaseStream()
-
setBaseStream
public void setBaseStream(DblSequence baseStream)
-
-