Package jsl.utilities.random.rvariable
Class TriangularRV
- java.lang.Object
-
- jsl.utilities.random.rvariable.AbstractRVariable
-
- jsl.utilities.random.rvariable.TriangularRV
-
- All Implemented Interfaces:
java.util.function.DoubleSupplier
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
,RandomIfc
,GetRandomNumberStreamIfc
,RNStreamControlIfc
,SetRandomNumberStreamIfc
,NewAntitheticInstanceIfc
,RVariableIfc
,SampleIfc
public final class TriangularRV extends AbstractRVariable
Triangular(min, mode, 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 TriangularRV(double min, double mode, double max)
TriangularRV(double min, double mode, double max, int streamNum)
TriangularRV(double min, double mode, double max, RNStreamIfc rng)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
generate()
double
getMaximum()
double
getMinimum()
double
getMode()
static RVControls
makeControls()
The keys are "min" with default value 0.0 and "mode" with default value 0.5, and "max" with default value 1.0TriangularRV
newInstance(RNStreamIfc rng)
-
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, toString, 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
-
TriangularRV
public TriangularRV(double min, double mode, double max)
-
TriangularRV
public TriangularRV(double min, double mode, double max, int streamNum)
-
TriangularRV
public TriangularRV(double min, double mode, double max, RNStreamIfc rng)
-
-
Method Detail
-
newInstance
public TriangularRV newInstance(RNStreamIfc rng)
- Parameters:
rng
- the RngIfc to use- Returns:
- a new instance with same parameter value
-
getMinimum
public double getMinimum()
- Returns:
- the minimum
-
getMode
public double getMode()
- Returns:
- the mode or most likely value
-
getMaximum
public double getMaximum()
- Returns:
- the maximum
-
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.0 and "mode" with default value 0.5, and "max" with default value 1.0- Returns:
- a control for Triangular random variables
-
-