Package jasima.core.random.continuous
Class DblConst
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.continuous.DblConst
-
- All Implemented Interfaces:
Serializable,Cloneable
public class DblConst extends DblSequence
A DblConst stream infinitely returns the numbers ofgetValues()in exactly this order. After the last value being returned the sequence starts again with the first number. Optionally the order of items is permuted ifrandomizeOrderwas set to true.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jasima.core.random.continuous.DblSequence
rndGen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DblConstclone()Clones the current number stream.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.double[]getValues()booleanisRandomizeOrder()doublenextDbl()Returns the next number in this number stream.voidsetRandomizeOrder(boolean randomizeOrder)If set totrue, the elements ofvalueswill be returned in a randomly permuted order.voidsetValues(double... vs)Sets the values to return as members of this number stream.StringtoString()-
Methods inherited from class jasima.core.random.continuous.DblSequence
createStreamDefFromStream, getName, getRndGen, init, max, min, setName, setRndGen
-
-
-
-
Method Detail
-
nextDbl
public double nextDbl()
Description copied from class:DblSequenceReturns the next number in this number stream.- Specified by:
nextDblin classDblSequence
-
clone
public DblConst 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 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.
-
getValues
public double[] getValues()
-
setValues
public void setValues(double... vs)
Sets the values to return as members of this number stream.- Parameters:
vs- The values to use.
-
isRandomizeOrder
public boolean isRandomizeOrder()
-
setRandomizeOrder
public void setRandomizeOrder(boolean randomizeOrder)
If set totrue, the elements ofvalueswill be returned in a randomly permuted order. Otherwise the values will be returned in exactly the same order as given invalues.- Parameters:
randomizeOrder- Whether or not to randomize the order.
-
-