Package jasima.core.random.discrete
Class IntUniformRange
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.discrete.IntSequence
-
- jasima.core.random.discrete.IntUniformRange
-
- All Implemented Interfaces:
Serializable,Cloneable
public class IntUniformRange extends IntSequence
Generates uniformly distributed integers in the interval [min,max] (including both min and max).- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jasima.core.random.continuous.DblSequence
rndGen
-
-
Constructor Summary
Constructors Constructor Description IntUniformRange(int min, int max)IntUniformRange(String name, int min, int max)IntUniformRange(Random random, int min, int max)IntUniformRange(Random random, String name, int min, int max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMax()intgetMin()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()voidsetMax(int max)Sets the maximum value returned by this number stream.voidsetMin(int min)Sets the minimum value returned by this number stream.voidsetRange(int min, int max)StringtoString()-
Methods inherited from class jasima.core.random.discrete.IntSequence
clone, nextDbl
-
Methods inherited from class jasima.core.random.continuous.DblSequence
createStreamDefFromStream, getName, getRndGen, max, min, setName, setRndGen
-
-
-
-
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
-
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.
-
setRange
public void setRange(int min, int max)
-
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
-
getMin
public int getMin()
-
setMin
public void setMin(int min)
Sets the minimum value returned by this number stream.- Parameters:
min- The minimum to use.
-
getMax
public int getMax()
-
setMax
public void setMax(int max)
Sets the maximum value returned by this number stream.- Parameters:
max- The maximum to use.
-
-