|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.omegahat.Simulation.RandomGenerators.NotifyingPRNG | +--org.omegahat.Simulation.RandomGenerators.CollingsPRNG
provide a stream of pseudo-random numbers using Collings Parallel Pseudo Random Number Generator.
Field Summary | |
(package private) int[] |
ComponentMult
Multiplicative constants for component generators |
(package private) int[] |
ComponentSeed
Seeds for component generators |
boolean |
debug
if true, show debugging messages |
(package private) int |
MixerMult
Multiplicative constant for mixing generator |
(package private) int |
MixerSeed
Seed for mixing generator |
(package private) static int |
Mod
Modulus constant for all generators |
(package private) int |
NumGen
Number of generators in the pool |
Fields inherited from class org.omegahat.Simulation.RandomGenerators.NotifyingPRNG |
listeners |
Constructor Summary | |
CollingsPRNG(int in_NumGen,
int in_MixerMult,
int in_MixerSeed,
int[] in_ComponentMult,
int[] in_ComponentSeed)
Instantiate from state details (needed for CORBA). |
|
CollingsPRNG(PRNGState state)
instantiate from a specified PRNGState |
Method Summary | |
double |
getDoubleEpsilon()
Return the minimum possible difference between two generated double's. |
int |
getIntRange()
Return the largest int value returned by nextInt<\b>. |
PRNGState |
getState()
Return an object describing the state of the PRNG. |
static void |
main(java.lang.String[] argv)
To test, generate 10 integers |
private int |
multCong(int seed,
int mult,
int mod)
Compute next value using multiplicative congruential formula. |
(package private) double |
nextComponentDouble(int which)
Generate a double on [0,1] using pool generator which. |
(package private) int |
nextComponentInt(int which)
Generate an int using pool generator which. |
double |
nextDouble()
Generate a single pseudo-random double on [0,1) |
double[] |
nextDoubleArray(int num)
Generate num pseudo-random doubles on (0,1] |
int |
nextInt()
Generate a single pseudo-random integer |
int[] |
nextIntArray(int num)
Generate num pseudo-random integers |
(package private) double |
nextMixerDouble()
Generate a double on [0,1) using the mixing generator. |
(package private) int |
nextMixerInt()
Generate an int using the mixing generator. |
Methods inherited from class org.omegahat.Simulation.RandomGenerators.NotifyingPRNG |
addListener, listeners, listeners, removeListener, run |
Methods inherited from class java.lang.Object |
|
Field Detail |
public boolean debug
int NumGen
int MixerMult
int MixerSeed
int[] ComponentMult
int[] ComponentSeed
static int Mod
Constructor Detail |
public CollingsPRNG(PRNGState state)
public CollingsPRNG(int in_NumGen, int in_MixerMult, int in_MixerSeed, int[] in_ComponentMult, int[] in_ComponentSeed)
Method Detail |
public PRNGState getState()
PRNG
getState
in interface PRNG
public double getDoubleEpsilon()
PRNG
getDoubleEpsilon
in interface PRNG
public int getIntRange()
PRNG
getIntRange
in interface PRNG
private int multCong(int seed, int mult, int mod)
seed
- Seed value in [1, 2^31-1]mult
- Multiplicative constantmod
- Modulusint nextMixerInt()
double nextMixerDouble()
int nextComponentInt(int which)
which
- which of the generators in the pool should be used to
compute the next pseudo-random deviatedouble nextComponentDouble(int which)
which
- which of the generators in the pool should be used to
compute the next pseudo-random deviatepublic int nextInt()
nextInt
in interface PRNG
public int[] nextIntArray(int num)
nextIntArray
in interface PRNG
num
- number of values to returnpublic double nextDouble()
nextDouble
in interface PRNG
public double[] nextDoubleArray(int num)
nextDoubleArray
in interface PRNG
num
- number of values to returnpublic static void main(java.lang.String[] argv) throws java.lang.Exception
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |