|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.zcu.fav.kiv.jsim.random.JSimExponentialStream
public class JSimExponentialStream
A stream generating random real values with an exponential distribution with a given lambda. The lambda parameter is 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 exponential distribution can be found at Wolfram Research Math World pages.
Field Summary | |
---|---|
private double |
lambda
The lambda parameter of the distribution, also called the rate of change. |
protected java.util.Random |
stream
An internal stream from which random numbers are taken and modified. |
Constructor Summary | |
---|---|
JSimExponentialStream(double lambda)
Creates a new stream generating random real values with exponential distribution. |
|
JSimExponentialStream(double lambda,
long seed)
Creates a new stream generating random real values with exponential distribution. |
Method Summary | |
---|---|
double |
getLambda()
Returns the lambda parameter of the distribution. |
double |
getNext()
Returns a randomly generated real value having exponential distribution with the given lambda parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Random stream
private double lambda
Constructor Detail |
---|
public JSimExponentialStream(double lambda) throws JSimInvalidParametersException
lambda
- The lambda parameter of the distribution.
JSimInvalidParametersException
- This exception is thrown out if lambda is less than 0.public JSimExponentialStream(double lambda, long seed) throws JSimInvalidParametersException
lambda
- The lambda parameter of the distribution.seed
- A seed that will initialize the generator.
JSimInvalidParametersException
- This exception is thrown out if lambda is less than 0.Method Detail |
---|
public double getNext()
public double getLambda()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |