org.omegahat.Simulation.RandomGenerators
Class CollingsPRNGAdministrator

java.lang.Object
  |
  +--org.omegahat.Simulation.RandomGenerators.CollingsPRNGAdministrator
All Implemented Interfaces:
PRNGAdministrator

public class CollingsPRNGAdministrator
extends java.lang.Object
implements PRNGAdministrator

creates instances of CollingsPRNG that are garanteed to be mutually independent


Field Summary
(package private)  MultiplicativeCongruentialPRNG LC
          Multiplicative Congruential Generator used by the administrator to select constants and seeds for the created CollingsPRNG's.
protected  java.util.Vector listeners
           
private static int Mod
          Modulus constant for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator.
private  int Mult
          Multiplicative constant for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator.
private  int NumGen
          Number of generators that each CollingsPRNG will use
private  int Seed
          Seed for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator.
 
Constructor Summary
CollingsPRNGAdministrator()
          Default Class Constructor
CollingsPRNGAdministrator(int seed)
          Class constructer that allows specification of the seed used to intialize the state of the created PRNG's
CollingsPRNGAdministrator(int seed, int numGen)
          Class constructer that allows specification of the seed used to intialize the state of the created PRNG's, and the number of component generators used by each CollingsPRNG created.
CollingsPRNGAdministrator(int seed, int numGen, int mult)
          Class constructer that allows specification of the seed used to intialize the state of the created PRNG's, the number of component generators used by each CollingsPRNG created.
 
Method Summary
 int addListener(PRNGAdministratorListener l)
           
 int getMult()
           
 int getNumGen()
           
 int getSeed()
           
 java.util.Vector listeners()
           
 java.util.Vector listeners(java.util.Vector v)
           
private  PRNGState makeGeneratorState()
           
 void notifyListeners(PRNGState state)
           
 PRNGState registerPRNGState()
           
 PRNGState registerPRNGState(java.lang.Object ignored)
           
 boolean removeListener(PRNGAdministratorListener l)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

Seed

private int Seed
Seed for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator. This seed must be in [1,2^32-1]

Mult

private int Mult
Multiplicative constant for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator.

Mod

private static int Mod
Modulus constant for the congruential generator used to pick the multiplicative constants and to intialize the seeds for each component generator.

NumGen

private int NumGen
Number of generators that each CollingsPRNG will use

LC

MultiplicativeCongruentialPRNG LC
Multiplicative Congruential Generator used by the administrator to select constants and seeds for the created CollingsPRNG's. This is NOT the seed used for the created CollingsPRNG's, rather it is used to select those seeds.

listeners

protected java.util.Vector listeners
Constructor Detail

CollingsPRNGAdministrator

public CollingsPRNGAdministrator()
Default Class Constructor

CollingsPRNGAdministrator

public CollingsPRNGAdministrator(int seed)
Class constructer that allows specification of the seed used to intialize the state of the created PRNG's
Parameters:
seed - seed value used for initializing constructed generators

CollingsPRNGAdministrator

public CollingsPRNGAdministrator(int seed,
                                 int numGen)
Class constructer that allows specification of the seed used to intialize the state of the created PRNG's, and the number of component generators used by each CollingsPRNG created.
Parameters:
seed - seed value used for initializing constructed generators
numGen - the number of component generators used by each constructed generator

CollingsPRNGAdministrator

public CollingsPRNGAdministrator(int seed,
                                 int numGen,
                                 int mult)
Class constructer that allows specification of the seed used to intialize the state of the created PRNG's, the number of component generators used by each CollingsPRNG created.
Parameters:
seed - seed value used for initializing constructed generators
numGen - the number of component generators used by each constructed generator
mult - multiplicative constant for PRNG used for initialization
Method Detail

getSeed

public int getSeed()

getNumGen

public int getNumGen()

getMult

public int getMult()

makeGeneratorState

private PRNGState makeGeneratorState()

registerPRNGState

public PRNGState registerPRNGState()
Specified by:
registerPRNGState in interface PRNGAdministrator

registerPRNGState

public PRNGState registerPRNGState(java.lang.Object ignored)
Specified by:
registerPRNGState in interface PRNGAdministrator

notifyListeners

public void notifyListeners(PRNGState state)

addListener

public int addListener(PRNGAdministratorListener l)

removeListener

public boolean removeListener(PRNGAdministratorListener l)

listeners

public java.util.Vector listeners()

listeners

public java.util.Vector listeners(java.util.Vector v)