public class NormalVariate extends RandomVariateBase
Uses a constant number of RandomNumbers per draw.
Removed saved value "feature" for better synchronization.
| Modifier and Type | Field and Description |
|---|---|
private double |
mean
The mean of this normal variate.
|
private double |
standardDeviation
The standard deviation of this normal variate.
|
rng| Constructor and Description |
|---|
NormalVariate()
Creates a new NormalVariate.
|
| Modifier and Type | Method and Description |
|---|---|
double |
generate()
Generates the next normal
|
double |
getMean() |
java.lang.Object[] |
getParameters()
Returns an array containing the mean and standard deviation.
|
double |
getStandardDeviation() |
double |
getVariance() |
void |
setMean(double mean) |
void |
setParameters(java.lang.Object... params)
Sets the mean and standard deviation for this NormalVariate.
|
void |
setStandardDeviation(double std) |
java.lang.String |
toString() |
getRandomNumber, setRandomNumberprivate double mean
private double standardDeviation
public NormalVariate()
public void setParameters(java.lang.Object... params)
params - A two element array containing the mean and standard
deviation as Numbers.java.lang.IllegalArgumentException - If the array doesn't have exactly 2
elements, either element is not a number, or if the standard deviation is
negative.public java.lang.Object[] getParameters()
public double generate()
public void setMean(double mean)
mean - the mean for this NormalVariate.public void setStandardDeviation(double std)
std - the standard deviation for this NormalVariate.java.lang.IllegalArgumentException - If the standard deviation is negative.public double getMean()
public double getStandardDeviation()
public double getVariance()
public java.lang.String toString()
toString in class java.lang.Object