Package jasima.core.random.continuous
Class DblUniformRange
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.continuous.DblUniformRange
-
- All Implemented Interfaces:
Serializable,Cloneable
public class DblUniformRange extends DblSequence
Returns a uniformly distributed real number in the range [min, 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 DblUniformRange(double min, double max)DblUniformRange(String name, double min, double max)DblUniformRange(Random random, double min, double max)DblUniformRange(Random random, String name, double min, double max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMax()doublegetMin()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.doublenextDbl()Returns the next number in this number stream.voidsetMax(double max)Sets the maximum value returned by this number stream.voidsetMin(double min)Sets the minimum value returned by this number stream.voidsetRange(double min, double max)StringtoString()-
Methods inherited from class jasima.core.random.continuous.DblSequence
clone, createStreamDefFromStream, getName, getRndGen, max, min, setName, setRndGen
-
-
-
-
Method Detail
-
setRange
public void setRange(double min, double max)
-
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
-
nextDbl
public double nextDbl()
Description copied from class:DblSequenceReturns the next number in this number stream.- Specified by:
nextDblin classDblSequence
-
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.
-
getMin
public double getMin()
-
setMin
public void setMin(double min)
Sets the minimum value returned by this number stream.- Parameters:
min- The minimum to use.
-
getMax
public double getMax()
-
setMax
public void setMax(double max)
Sets the maximum value returned by this number stream.- Parameters:
max- The maximum to use.
-
-