org.apache.hadoop.tools.rumen
Class RandomSeedGenerator

java.lang.Object
  extended by org.apache.hadoop.tools.rumen.RandomSeedGenerator

public class RandomSeedGenerator
extends Object

The purpose of this class is to generate new random seeds from a master seed. This is needed to make the Random().next*() calls in rumen and mumak deterministic so that mumak simulations become deterministically replayable. In these tools we need many independent streams of random numbers, some of which are created dynamically. We seed these streams with the sub-seeds returned by RandomSeedGenerator. For a slightly more complicated approach to generating multiple streams of random numbers with better theoretical guarantees, see P. L'Ecuyer, R. Simard, E. J. Chen, and W. D. Kelton, ``An Objected-Oriented Random-Number Package with Many Long Streams and Substreams'', Operations Research, 50, 6 (2002), 1073--1075 http://www.iro.umontreal.ca/~lecuyer/papers.html http://www.iro.umontreal.ca/~lecuyer/myftp/streams00/


Constructor Summary
RandomSeedGenerator()
           
 
Method Summary
static long getSeed(String streamId, long masterSeed)
          Generates a new random seed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomSeedGenerator

public RandomSeedGenerator()
Method Detail

getSeed

public static long getSeed(String streamId,
                           long masterSeed)
Generates a new random seed.

Parameters:
streamId - a string identifying the stream of random numbers
masterSeed - higher level master random seed
Returns:
the random seed. Different (streamId, masterSeed) pairs result in (vastly) different random seeds.


Copyright © 2009 The Apache Software Foundation