public class NormalVariate_64 extends RandomVariateBase
Uses a constant number of RandomNumbers per draw.
Removed saved value "feature" for better synchronization.
Uses simkit.util.Math64.log() function for replicability on 64-bit platforms.
Modifier and Type | Field and Description |
---|---|
private double |
mean
The mean of this normal variate.
|
private double |
sigma
The standard deviation of this normal variate.
|
rng
Constructor and Description |
---|
NormalVariate_64()
Creates a new NormalVariate.
|
Modifier and Type | Method and Description |
---|---|
double |
generate()
Generates the next normally distributed value.
|
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 sigma) |
java.lang.String |
toString()
Returns the name of this distribution with its mean and standard deviation.
|
getRandomNumber, setRandomNumber
private double mean
private double sigma
public NormalVariate_64()
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 sigma)
sigma
- the standard deviation for this NormalVariate.java.lang.IllegalArgumentException
- If sigma < 0.0.public double getMean()
public double getStandardDeviation()
public double getVariance()
public java.lang.String toString()
toString
in class java.lang.Object