Package jasima.core.random.continuous
Class DblSequence
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
ArrivalProcess,DblConst,DblDistribution,DblErlang,DblNormal,DblSumStream,DblTriangular,DblTruncatedSimple,DblUniformRange,DblUniformZeroOne,IntSequence
public abstract class DblSequence extends Object implements Serializable, Cloneable
A stream of double numbers, usually the sequence is produced by a pseudo random number generator.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DblSequence()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DblSequenceclone()Clones the current number stream.DblStreamDefcreateStreamDefFromStream()Creates aDblStreamDefobject from this stream.StringgetName()Returns the stream's name.doublegetNumericalMean()Returns the arithmetic mean of the values returned bynextDbl().RandomgetRndGen()Returns the random number generator currently associated with this stream.Pair<Double,Double>getValueRange()This method computes the minimum and maximum support values (range of possible values) of this stream.voidinit()Initializes this stream.doublemax()Returns the maximum value to be produced by this object.doublemin()Returns the minimum value to be produced by this object.abstract doublenextDbl()Returns the next number in this number stream.voidsetName(String name)Sets an optional name for this stream.voidsetRndGen(Random rndGen)Sets the random number generator to be used if this stream has a random component.
-
-
-
Field Detail
-
rndGen
protected Random rndGen
-
-
Method Detail
-
init
public void init()
Initializes this stream. This method is supposed to be called once before repeated calls tonextDbl()can be made.
-
nextDbl
public abstract double nextDbl()
Returns the next number in this number stream.
-
getNumericalMean
public double getNumericalMean()
Returns the arithmetic mean of the values returned bynextDbl().
-
getValueRange
public Pair<Double,Double> getValueRange()
This method computes the minimum and maximum support values (range of possible values) of this stream.- Returns:
- A
Paircontaining the minimum and maximum support values.
-
min
public double min()
Returns the minimum value to be produced by this object.- Returns:
- Returns the minimum value to be produced by this object.
- See Also:
getValueRange()
-
max
public double max()
Returns the maximum value to be produced by this object.- Returns:
- Returns the maximum value to be produced by this object.
- See Also:
getValueRange()
-
createStreamDefFromStream
public final DblStreamDef createStreamDefFromStream()
Creates aDblStreamDefobject from this stream. This method only delegates toDblStreamDef.createStreamDefFromStream(DblSequence)and therefore is final.
-
clone
public DblSequence clone()
Clones the current number stream. This method fails with aCloneNotSupportedExceptionif there is a random number generator associated with this stream.
-
getRndGen
public Random getRndGen()
Returns the random number generator currently associated with this stream.
-
setRndGen
public void setRndGen(Random rndGen)
Sets the random number generator to be used if this stream has a random component.
-
getName
public String getName()
Returns the stream's name.
-
setName
public void setName(String name)
Sets an optional name for this stream. The name can be used to, e.g., initialize the random number generator as inRandomFactory.initRndGen(DblSequence, String).- Parameters:
name- The stream's name.
-
-