|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.omegahat.Simulation.RandomGenerators.MultiplicativeCongruentialPRNG
Compute pseudo-random number using multiplicative congruential formula.
The next value is computed using the formula: X[t+1] = X[t] * mult % mod
Field Summary | |
long |
mod
Modulus constant |
long |
mult
Multiplicative constant |
long |
seed
Seed value in [1, 2^31-1] |
Constructor Summary | |
(package private) |
MultiplicativeCongruentialPRNG()
Create a Multiplicative Congruential Generator using the default seed, multiplier and modulus constants. |
(package private) |
MultiplicativeCongruentialPRNG(int newSeed)
Create A Multiplicative Congruential Generator using a specified seed. |
(package private) |
MultiplicativeCongruentialPRNG(int newSeed,
int newMult)
Create A Multiplicative Congruential Generator using a specified seed and multiplicative constant. |
(package private) |
MultiplicativeCongruentialPRNG(int newSeed,
int newMult,
int newMod)
Create A Multiplicative Congruential Generator using a specified seed and multiplicative constant. |
Method Summary | |
double |
nextDouble()
Generate a random double in [0,1) |
int |
nextInt()
Generate a random integer in [1,Mod] |
Methods inherited from class java.lang.Object |
|
Field Detail |
public long seed
public long mult
public long mod
Constructor Detail |
MultiplicativeCongruentialPRNG()
MultiplicativeCongruentialPRNG(int newSeed)
newSeed
- Value in [1,2^31-1] for the seedMultiplicativeCongruentialPRNG(int newSeed, int newMult)
newSeed
- Value in [1,2^31-1] for the seednewMult
- Value in [1,2^32-1] for the multiplierMultiplicativeCongruentialPRNG(int newSeed, int newMult, int newMod)
newSeed
- Value in [1,2^31-1] for the seednewMult
- Value in [1,2^32-1] for the multiplier constantnewMod
- Value in [1,2^32-1] for the modulus constantMethod Detail |
public int nextInt()
public double nextDouble()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |