Represents a container random stream generating numbers in an interval. More...
Public Member Functions | |
| void | resetStartStream () |
| Reinitializes the stream to its initial state \(I_g\): \(C_g\) and \(B_g\) are set to \(I_g\). | |
| void | resetStartSubstream () |
| Reinitializes the stream to the beginning of its current substream: | |
| void | resetNextSubstream () |
| Reinitializes the stream to the beginning of its next substream: | |
| 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. | |
| 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. | |
| 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 | 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. | |
| Public Member Functions inherited from umontreal.ssj.rng.RandomStream | |
| String | toString () |
| Returns a string containing the current state of this stream. | |
Represents a container random stream generating numbers in an interval.
\((a,b)\) instead of in \((0,1)\), where \(0\le a < b \le1\), by using the contained stream. If nextDouble returns \(u\) for the contained stream, it will return \(v = a + (b-a)u\), which is uniform over \((a,b)\), for the truncated stream. The method nextInt returns the integer that corresponds to \(v\) (by inversion); this integer is no longer uniformly distributed in general.
Definition at line 43 of file TruncatedRandomStream.java.
| void umontreal.ssj.rng.TruncatedRandomStream.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.
| u | array that will contain the generated uniforms |
| start | starting index, in the array u, to write uniforms from |
| n | number of uniforms to generate |
Implements umontreal.ssj.rng.RandomStream.
Definition at line 77 of file TruncatedRandomStream.java.
| void umontreal.ssj.rng.TruncatedRandomStream.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.
(Calls nextInt n times.)
| i | smallest integer that can be generated |
| j | greatest integer that can be generated |
| u | array that will contain the generated values |
| start | starting index, in the array u, to write integers from |
| n | number of values being generated |
Implements umontreal.ssj.rng.RandomStream.
Definition at line 87 of file TruncatedRandomStream.java.
| double umontreal.ssj.rng.TruncatedRandomStream.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.
The generators programmed in SSJ never return the values 0 or 1.
Implements umontreal.ssj.rng.RandomStream.
Definition at line 72 of file TruncatedRandomStream.java.
| int umontreal.ssj.rng.TruncatedRandomStream.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.
(Calls nextDouble once.)
| i | smallest integer that can be generated |
| j | greatest integer that can be generated |
Implements umontreal.ssj.rng.RandomStream.
Definition at line 83 of file TruncatedRandomStream.java.
| void umontreal.ssj.rng.TruncatedRandomStream.resetNextSubstream | ( | ) |
Reinitializes the stream to the beginning of its next substream:
\(N_g\) is computed, and \(C_g\) and \(B_g\) are set to \(N_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 68 of file TruncatedRandomStream.java.
| void umontreal.ssj.rng.TruncatedRandomStream.resetStartStream | ( | ) |
Reinitializes the stream to its initial state \(I_g\): \(C_g\) and \(B_g\) are set to \(I_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 60 of file TruncatedRandomStream.java.
| void umontreal.ssj.rng.TruncatedRandomStream.resetStartSubstream | ( | ) |
Reinitializes the stream to the beginning of its current substream:
\(C_g\) is set to \(B_g\).
Implements umontreal.ssj.rng.RandomStream.
Definition at line 64 of file TruncatedRandomStream.java.