public class ConstantVariate extends RandomVariateBase
Modifier and Type | Field and Description |
---|---|
private double |
value
The constant value to always be generated.
|
rng
Constructor and Description |
---|
ConstantVariate()
Creates a new ConstantVariate with a value of 0.0.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Always generates the constant value.
|
java.lang.Object[] |
getParameters()
Returns a 1 element array containing the constant value.
|
double |
getValue() |
void |
setParameters(java.lang.Object... params)
Sets the value to generate.
|
void |
setValue(double value) |
java.lang.String |
toString()
Returns the name of this ConstantVariate and its value.
|
getRandomNumber, setRandomNumber
public ConstantVariate()
public void setParameters(java.lang.Object... params)
params
- A 1 element array containing the desired constant value as a Number.java.lang.IllegalArgumentException
- If the first element of array is not a Number.java.lang.ArrayIndexOutOfBoundsException
- if params.length == 0public java.lang.Object[] getParameters()
public void setValue(double value)
value
- the constant value to be generated.public double getValue()
public double generate()
public java.lang.String toString()
toString
in class java.lang.Object