Package jsl.utilities.random.rvariable
Class DUniformRV
- java.lang.Object
-
- jsl.utilities.random.rvariable.AbstractRVariable
-
- jsl.utilities.random.rvariable.DUniformRV
-
- All Implemented Interfaces:
java.util.function.DoubleSupplier
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
,RandomIfc
,GetRandomNumberStreamIfc
,RNStreamControlIfc
,SetRandomNumberStreamIfc
,NewAntitheticInstanceIfc
,RVariableIfc
,SampleIfc
public final class DUniformRV extends AbstractRVariable
discrete uniform(min, max) random variable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jsl.utilities.random.rvariable.RVariableIfc
RVariableIfc.RVType
-
-
Field Summary
-
Fields inherited from class jsl.utilities.random.rvariable.AbstractRVariable
myRNStream
-
-
Constructor Summary
Constructors Constructor Description DUniformRV(int min, int max)
DUniformRV(int min, int max, int streamNum)
DUniformRV(int min, int max, RNStreamIfc rng)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
generate()
double
getMaximum()
Gets the upper limitdouble
getMinimum()
Gets the lower limitstatic RVControls
makeControls()
The keys are "min" with default value 0 and "max" with default value 1DUniformRV
newInstance(RNStreamIfc rng)
java.lang.String
toString()
-
Methods inherited from class jsl.utilities.random.rvariable.AbstractRVariable
advanceToNextSubstream, getAntitheticOption, getId, getName, getPreviousValue, getRandomNumberStream, getValue, newAntitheticInstance, newInstance, resetStartStream, resetStartSubstream, sample, setAntitheticOption, setName, setPreviousValue, setRandomNumberStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsl.utilities.random.rng.GetRandomNumberStreamIfc
getStreamNumber
-
Methods inherited from interface jsl.utilities.random.rvariable.RVariableIfc
asDoubleStream, getAsDouble, getSumOfValues, newInstance
-
Methods inherited from interface jsl.utilities.random.rng.SetRandomNumberStreamIfc
setRandomNumberStream
-
-
-
-
Constructor Detail
-
DUniformRV
public DUniformRV(int min, int max)
-
DUniformRV
public DUniformRV(int min, int max, int streamNum)
-
DUniformRV
public DUniformRV(int min, int max, RNStreamIfc rng)
-
-
Method Detail
-
newInstance
public DUniformRV newInstance(RNStreamIfc rng)
- Parameters:
rng
- the RNStreamIfc to use- Returns:
- a new instance with same parameter value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getMinimum
public double getMinimum()
Gets the lower limit- Returns:
- The lower limit
-
getMaximum
public double getMaximum()
Gets the upper limit- Returns:
- The upper limit
-
generate
protected double generate()
- Specified by:
generate
in classAbstractRVariable
- Returns:
- the randomly generated variate
-
makeControls
public static RVControls makeControls()
The keys are "min" with default value 0 and "max" with default value 1- Returns:
- a control for DUniform random variables
-
-