|
GridSim v4.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectgridsim.util.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).
NOTE: This class is taken from
JSim.
| 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. |
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 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 Double[] getParameters()
public double gen()
public long igen()
|
GridSim v4.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||