org.omegahat.Simulation.RandomGenerators
Interface PRNGIntegerState

All Superinterfaces:
PRNGState
All Known Implementing Classes:
CollingsPRNGState

public interface PRNGIntegerState
extends PRNGState

Extends PRNGState to provide methods for obtaining and setting state details for PRNG's that can represent thier state as a sequence of ints.

The main purpose for this is to allow the state to be "passed between" objects using CORBA without defining a new IDL interface to get access to the actual state details.

This interface should not be used to change the state of a PRNG! To enforce this restriction, the setPRNGIntState requires a hash parameter that should be used to verify that the state has not been modified.


Method Summary
 int[] getIntegerState()
          Return an array of ints that fully captures the state of the PRNG represented by this PRNGState.
 int[] getIntegerStateHash()
          Return the hash value for the state of the PRNG represented by this PRNGState.
 void setIntegerState(int[] intState, int[] hash)
          Set the internal state using an array of ints provided by another PRNGIntegerState.
 
Methods inherited from interface org.omegahat.Simulation.RandomGenerators.PRNGState
getPRNGName
 

Method Detail

getIntegerState

public int[] getIntegerState()
Return an array of ints that fully captures the state of the PRNG represented by this PRNGState.

getIntegerStateHash

public int[] getIntegerStateHash()
Return the hash value for the state of the PRNG represented by this PRNGState.

This hash value must be included as a parameter when the setPRNGIntegerState function is called, allowing it to verify that the state has been correctly transmitted and is has not been modified.


setIntegerState

public void setIntegerState(int[] intState,
                            int[] hash)
Set the internal state using an array of ints provided by another PRNGIntegerState. The hash parameter allows the method to check that the state provided has been correctly transmitted and has not been modified.