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 ifrandomizeOrder
was 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 DblConst
clone()
Clones the current number stream.double
getNumericalMean()
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()
boolean
isRandomizeOrder()
double
nextDbl()
Returns the next number in this number stream.void
setRandomizeOrder(boolean randomizeOrder)
If set totrue
, the elements ofvalues
will be returned in a randomly permuted order.void
setValues(double... vs)
Sets the values to return as members of this number stream.String
toString()
-
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:DblSequence
Returns the next number in this number stream.- Specified by:
nextDbl
in classDblSequence
-
clone
public DblConst clone()
Description copied from class:DblSequence
Clones the current number stream. This method fails with aCloneNotSupportedException
if there is a random number generator associated with this stream.- Overrides:
clone
in classDblSequence
-
getNumericalMean
public double getNumericalMean()
Description copied from class:DblSequence
Returns the arithmetic mean of the values returned byDblSequence.nextDbl()
.- Overrides:
getNumericalMean
in classDblSequence
-
getValueRange
public Pair<Double,Double> getValueRange()
Description copied from class:DblSequence
This method computes the minimum and maximum support values (range of possible values) of this stream.- Overrides:
getValueRange
in classDblSequence
- Returns:
- A
Pair
containing 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 ofvalues
will 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.
-
-