All Packages Class Hierarchy This Package Previous Next Index
Class simula.random.RandomEngineMCG
java.lang.Object
|
+----simula.random.RandomEngine
|
+----simula.random.RandomEngineMCG
- public class RandomEngineMCG
- extends RandomEngine
Implements a multipling congruential generator "Minimal Standard"
by Park e Miller.
The generation algorythm is the following:
Ij+1 = (Ij ╫ 16807) & 0x7FFFFFFF
-
RandomEngineMCG()
- Creates a new engine using current time as the seed
-
RandomEngineMCG(long)
- Creates a new engine using given seed
-
nextByte()
-
Return the next byte from engine
-
setSeed(long)
- Resets the seed for the engine
RandomEngineMCG
public RandomEngineMCG()
- Creates a new engine using current time as the seed
RandomEngineMCG
public RandomEngineMCG(long seed) throws IllegalArgumentException
- Creates a new engine using given seed
- Parameters:
- seed - generator seed (shouldn't be NULL)
nextByte
public byte nextByte()
- Return the next byte from engine
- Returns:
- next byte from this engine
- Overrides:
- nextByte in class RandomEngine
setSeed
public void setSeed(long seed) throws IllegalArgumentException
- Resets the seed for the engine
- Parameters:
- seed - new seed for the engine
All Packages Class Hierarchy This Package Previous Next Index