public class Normal02_64Variate extends java.lang.Object implements RandomVariate
Note: Uses a random number of RandomNumbers per draw.
Uses simkit.util.Math64.log() function for replicability on 64-bit platforms.
Modifier and Type | Field and Description |
---|---|
protected double |
mean
The mean of this normal random variate.
|
protected RandomNumber |
rng
The instance of the supporting RandomNumber.
|
protected double |
stdDev
The standard deviation of this normal random variate.
|
Constructor and Description |
---|
Normal02_64Variate()
Creates new Normal02Variate with 0 mean and standard deviation.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generate a random variate having this class's distribution.
|
double |
getMean() |
java.lang.Object[] |
getParameters()
Returns a 2 element array with the mean and the standard deviation.
|
RandomNumber |
getRandomNumber()
Returns the instance of the supporting RandomNumber.
|
double |
getStandardDeviation() |
void |
setMean(double mean) |
void |
setParameters(java.lang.Object... params)
Sets the random variate's parameters.
|
void |
setRandomNumber(RandomNumber rng)
Sets the supporting RandomNumber object
|
void |
setStandardDeviation(double stdDev) |
java.lang.String |
toString() |
protected RandomNumber rng
protected double mean
protected double stdDev
public Normal02_64Variate()
public RandomNumber getRandomNumber()
getRandomNumber
in interface RandomVariate
public void setRandomNumber(RandomNumber rng)
setRandomNumber
in interface RandomVariate
rng
- The RandomNumber instance supporting the generating algorithmpublic java.lang.Object[] getParameters()
getParameters
in interface RandomVariate
public void setParameters(java.lang.Object... params)
setParameters
in interface RandomVariate
params
- A 2 element array with the mean in the first element and
the standard deviation as the second, both as Numbers.java.lang.IllegalArgumentException
- If the array does not contain exactly 2
elements, if either of the elements is not a Number, or if the standard
deviation is not positive.public double generate()
generate
in interface RandomVariate
public void setMean(double mean)
mean
- the mean of this normal variate.public double getMean()
public void setStandardDeviation(double stdDev)
stdDev
- the standard deviation of this normal.java.lang.IllegalArgumentException
- if the standard deviation is < 0.public double getStandardDeviation()
public java.lang.String toString()
toString
in class java.lang.Object