|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.zcu.fav.kiv.jsim.random.JSimGaussianStream
public class JSimGaussianStream
A stream generating random real values with a Gaussian (aka normal) distribution with given mu and sigma. The two parameters are set by the user when the stream is constructed. An initial seed can be specified, which allows you to generate the same sequence of random values several times. A complex description of Gaussian (normal) distribution can be found at Wolfram Research Math World pages.
Field Summary | |
---|---|
private double |
mu
The mu parameter of the distribution, equal to the mean value. |
private double |
sigma
The sigma parameter of the distribution, equal to the square root of the variance. |
protected JSimUniformStream |
stream
An internal stream from which random numbers are taken and modified. |
Constructor Summary | |
---|---|
JSimGaussianStream(double mu,
double sigma)
Creates a new stream generating random real values with Gaussian distribution. |
|
JSimGaussianStream(double mu,
double sigma,
long seed)
Creates a new stream generating random real values with Gaussian distribution. |
Method Summary | |
---|---|
double |
getMu()
Returns the mu parameter of the distribution. |
double |
getNext()
Returns a randomly generated real value having Gaussian distribution with the given mu and sigma parameters. |
double |
getSigma()
Returns the sigma parameter of the distribution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JSimUniformStream stream
private double mu
private double sigma
Constructor Detail |
---|
public JSimGaussianStream(double mu, double sigma) throws JSimInvalidParametersException
mu
- The mu parameter of the distribution, equal to the mean value.sigma
- The sigma parameter of the distribution, equal to the square root of the variance.
JSimInvalidParametersException
- This exception is thrown out if sigma is less than 0.public JSimGaussianStream(double mu, double sigma, long seed) throws JSimInvalidParametersException
mu
- The mu parameter of the distribution, equal to the mean value.sigma
- The sigma parameter of the distribution, equal to the square root of the variance.seed
- A seed that will initialize the generator.
JSimInvalidParametersException
- This exception is thrown out if sigma is less than 0.Method Detail |
---|
public double getNext()
public double getMu()
public double getSigma()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |