|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objecteduni.simjava.distributions.Sim_random_obj
A random number generator producing pseudorandom numbers based on the value of a specific seed. The generator is a multiplicative linear congruential generator. It generates numbers through the following structure:
Y[1] = (742938285*Y[0]) mod (231-1)
The seed (Y[0]) provided is used to generate a sequence of pseudorandom
numbers uniformly distributed between 0 and 1. The cycle of the generator
is 231-2.
| Constructor Summary | |
Sim_random_obj(String name)
Constructor with which Sim_system is allowed to set the random number
generator's seed |
|
Sim_random_obj(String name,
long seed)
The constructor with which a specific seed is set for the random number generator |
|
| Method Summary | |
String |
get_name()
Get the random number generator's name. |
long |
get_seed()
Get the random number generator's seed. |
double |
sample()
Generate a new random number. |
void |
set_seed(long seed)
Set the random number generator's seed. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Sim_random_obj(String name)
Sim_system is allowed to set the random number
generator's seed
name - The name to be associated with this instance
public Sim_random_obj(String name,
long seed)
name - The name to be associated with this instanceseed - The initial seed for the generator, two instances with
the same seed will generate the same sequence of numbers| Method Detail |
public double sample()
sample in interface ContinuousGeneratorpublic void set_seed(long seed)
set_seed in interface Generatorseed - The new seed for the generatorpublic long get_seed()
get_seed in interface Generatorpublic String get_name()
get_name in interface Generator
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||