|
SSJ
3.3.1
Stochastic Simulation in Java
|
NonRandomStream:
Given a double array, this class will return those values as if it where a random stream.
More...
Public Member Functions | |
| NonRandomStream (double[] array) | |
| NonRandomStream (double value) | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| void | 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\). | |
| 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: \(C_g\) is set to \(B_g\). | |
| String | toString () |
| Returns a string containing the current state of this stream. More... | |
Package Attributes | |
| double [] | array |
| int | position |
NonRandomStream:
Given a double array, this class will return those values as if it where a random stream.
Careful: Will not hard copy the array given as input. And not checking for end of array for the time being. And not checking j>i.
| 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.
| 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 RandomStream.
| 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.
(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 RandomStream.
| 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.
The generators programmed in SSJ never return the values 0 or 1.
Implements RandomStream.
| 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.
(Calls nextDouble once.)
| i | smallest integer that can be generated |
| j | greatest integer that can be generated |
Implements RandomStream.
| String toString | ( | ) |
Returns a string containing the current state of this stream.
Implements RandomStream.
1.8.14