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


Constructor Index

 o RandomEngineMCG()
Creates a new engine using current time as the seed
 o RandomEngineMCG(long)
Creates a new engine using given seed

Method Index

 o nextByte()
Return the next byte from engine
 o setSeed(long)
Resets the seed for the engine

Constructors

 o RandomEngineMCG
 public RandomEngineMCG()
Creates a new engine using current time as the seed

 o RandomEngineMCG
 public RandomEngineMCG(long seed) throws IllegalArgumentException
Creates a new engine using given seed

Parameters:
seed - generator seed (shouldn't be NULL)

Methods

 o nextByte
 public byte nextByte()
Return the next byte from engine

Returns:
next byte from this engine
Overrides:
nextByte in class RandomEngine
 o 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