public class Normal02Variate extends java.lang.Object implements RandomVariate
Note: Uses a random number of RandomNumbers per draw.
| Modifier and Type | Field and Description |
|---|---|
private double |
mean
The mean of this normal random variate.
|
protected RandomNumber |
rng
The instance of the supporting RandomNumber.
|
private double |
stdDev
The standard deviation of this normal random variate.
|
| Constructor and Description |
|---|
Normal02Variate()
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()
Returns a String containing the name, mean, and standard deviation of
this variate.
|
protected RandomNumber rng
private double mean
private double stdDev
public Normal02Variate()
public RandomNumber getRandomNumber()
getRandomNumber in interface RandomVariatepublic void setRandomNumber(RandomNumber rng)
setRandomNumber in interface RandomVariaterng - The RandomNumber instance supporting the generating algorithmpublic java.lang.Object[] getParameters()
getParameters in interface RandomVariatepublic void setParameters(java.lang.Object... params)
setParameters in interface RandomVariateparams - 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 RandomVariatepublic 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 variate.java.lang.IllegalArgumentException - if the standard deviation < 0.0public double getStandardDeviation()
public java.lang.String toString()
toString in class java.lang.Object