|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsim.variate.LCGRandom
public class LCGRandom
Basic random number generator. It is a multiplicative Linear Congruential Generator (LCG). The generator can be adjusted simply by changing the constants MULTIPIER and MODULUS (be careful). The complete generated stream of MODULUS numbers is split into MAX_STREAMS (stream from 0 to MAX_STREAMS - 1) by appropriate setting of the SEED array (again be careful).
Field Summary | |
---|---|
static int |
MAX_STREAMS
|
Constructor Summary | |
---|---|
LCGRandom(int stream)
Constructs an LCG-based Random Number Generator. |
Method Summary | |
---|---|
double |
gen()
Generates a real-valued random number in the range 0 to 1. |
java.lang.Double[] |
getParameters()
Get the parameters of the constuctor |
long |
igen()
Generates an integer-valued random number in the range 0 to MODULUS - 1. |
void |
incrStream()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_STREAMS
Constructor Detail |
---|
public LCGRandom(int stream)
stream
- stream number (integer from 0 to MAX_STREAMS - 1)Method Detail |
---|
public void incrStream()
public java.lang.Double[] getParameters()
public double gen()
public long igen()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |