|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.zcu.fav.kiv.jsim.random.JSimUniformStream
public class JSimUniformStream
A stream generating random real values with a uniform distribution on a given interval. The bounds of the interval 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 uniform distribution can be found at Wolfram Research Math World pages.
Field Summary | |
---|---|
private double |
a
The lower bound of the interval from which random numbers are generated. |
private double |
b
The upper bound of the interval from which random numbers are generated. |
protected java.util.Random |
stream
An internal stream from which random numbers are taken and modified. |
Constructor Summary | |
---|---|
JSimUniformStream(double a,
double b)
Creates a new stream generating random real values from a given interval. |
|
JSimUniformStream(double a,
double b,
long seed)
Creates a new stream generating random real values from a given interval. |
Method Summary | |
---|---|
double |
getA()
Returns the lower bound of the interval. |
double |
getB()
Returns the upper bound of the interval. |
double |
getNext()
Returns a randomly generated real value from the interval specified on this stream's construction. |
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 a
private double b
Constructor Detail |
---|
public JSimUniformStream(double a, double b) throws JSimInvalidParametersException
a
- The lower bound of the interval.b
- The upper bound of the interval.
JSimInvalidParametersException
- This exception is thrown out if a is not less than b.public JSimUniformStream(double a, double b, long seed) throws JSimInvalidParametersException
a
- The lower bound of the interval.b
- The upper bound of the interval.seed
- A seed that will initialize the generator.
JSimInvalidParametersException
- This exception is thrown out if a is not less than b.Method Detail |
---|
public double getNext()
public double getA()
public double getB()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |