|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.rng.TruncatedRandomStream
public class TruncatedRandomStream
Represents a container random stream generating numbers in an interval [a, b], where a < b and a, b∈[0, 1), by using another stream.
| Constructor Summary | |
|---|---|
TruncatedRandomStream(RandomStream stream,
double a,
double b)
|
|
| Method Summary | |
|---|---|
void |
nextArrayOfDouble(double[] u,
int start,
int n)
Generates n (pseudo)random numbers from the uniform distribution and stores them into the array u starting at index start. |
void |
nextArrayOfInt(int i,
int j,
int[] u,
int start,
int n)
Generates n (pseudo)random numbers from the discrete uniform distribution over the integers {i, i + 1,..., j}, using this stream and stores the result in the array u starting at index start. |
double |
nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval [0, 1), using this stream, after advancing its state by one step. |
int |
nextInt(int i,
int j)
Returns a (pseudo)random number from the discrete uniform distribution over the integers {i, i + 1,..., j}, using this stream. |
void |
resetNextSubstream()
Reinitializes the stream to the beginning of its next substream: Ng is computed, and Cg and Bg are set to Ng. |
void |
resetStartStream()
Reinitializes the stream to its initial state Ig: Cg and Bg are set to Ig. |
void |
resetStartSubstream()
Reinitializes the stream to the beginning of its current substream: Cg is set to Bg. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface umontreal.iro.lecuyer.rng.RandomStream |
|---|
toString |
| Constructor Detail |
|---|
public TruncatedRandomStream(RandomStream stream,
double a,
double b)
| Method Detail |
|---|
public void resetStartStream()
RandomStream
resetStartStream in interface RandomStreampublic void resetStartSubstream()
RandomStream
resetStartSubstream in interface RandomStreampublic void resetNextSubstream()
RandomStream
resetNextSubstream in interface RandomStreampublic double nextDouble()
RandomStream
nextDouble in interface RandomStream
public void nextArrayOfDouble(double[] u,
int start,
int n)
RandomStream
nextArrayOfDouble in interface RandomStreamu - array that will contain the generated uniformsstart - starting index, in the array u, to write uniforms fromn - number of uniforms to generate
public int nextInt(int i,
int j)
RandomStream
nextInt in interface RandomStreami - smallest integer that can be generatedj - greatest integer that can be generated
public void nextArrayOfInt(int i,
int j,
int[] u,
int start,
int n)
RandomStream
nextArrayOfInt in interface RandomStreami - smallest integer that can be generatedj - greatest integer that can be generatedu - array that will contain the generated valuesstart - starting index, in the array u, to write integers fromn - number of values being generated
|
SSJ V. 1.2.5. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||