SSF.Util.Random
Class RandomStream

java.lang.Object
  |
  +--cern.colt.PersistentObject
        |
        +--edu.cornell.lassp.houle.RngPack.RandomElement
              |
              +--SSF.Util.Random.RandomStream
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class RandomStream
extends RandomElement

See Also:
Serialized Form

Nested Class Summary
 class RandomStream.AlignmentException
          Exception thrown if entities from two different SSF timelines both request the same stream.
 class RandomStream.CollisionException
          Exception thrown if two stream names accidentally hash to the same 32-bit extract of their MD5 digests.
 class RandomStream.DistributionException
          Exception thrown when the user names an unknown random distribution.
 class RandomStream.NamingException
          Exception thrown when the user names an unknown random number generator.
 class RandomStream.StreamException
           
 
Constructor Summary
protected RandomStream()
           
 
Method Summary
 java.lang.Object getAlignment()
          Return the SSF alignment of all entities sharing this stream.
static RandomDistribution getDistribution(com.renesys.raceway.DML.Configuration cfg, RandomStream rng)
           
static RandomDistribution getDistribution(java.lang.String distname, RandomStream rng)
           
 java.lang.String getName()
          Return the so-called "universal name" of this stream, consisting of the generator name concatenated with "::" plus the user-supplied stream name.
static RandomStream getStream(com.renesys.raceway.SSF.Entity requestor, java.lang.String generatorName, java.lang.String streamName)
          Obtain a reference to the globally unique random stream corresponding to the given generator name and stream name.
 double nextDouble()
           
 double raw()
          Returns a uniformly distributed pseudo-random number.
 
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomElement
choose, choose, gaussian, gaussian, powlaw, raw, raw, uniform
 
Methods inherited from class cern.colt.PersistentObject
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomStream

protected RandomStream()
Method Detail

raw

public double raw()
Description copied from class: RandomElement
Returns a uniformly distributed pseudo-random number. The abstract method that must be defined to make a working RandomElement. See the class RandomJava for an example of how to do this.

Specified by:
raw in class RandomElement
Returns:
a random double in the range (0,1).
See Also:
RandomJava

nextDouble

public double nextDouble()

getAlignment

public final java.lang.Object getAlignment()
Return the SSF alignment of all entities sharing this stream.


getName

public final java.lang.String getName()
Return the so-called "universal name" of this stream, consisting of the generator name concatenated with "::" plus the user-supplied stream name. The mapping between universal names and streams is guaranteed to be one-to-one.


getStream

public static RandomStream getStream(com.renesys.raceway.SSF.Entity requestor,
                                     java.lang.String generatorName,
                                     java.lang.String streamName)
                              throws RandomStream.CollisionException,
                                     RandomStream.AlignmentException,
                                     RandomStream.NamingException
Obtain a reference to the globally unique random stream corresponding to the given generator name and stream name.

RandomStream.CollisionException
RandomStream.AlignmentException
RandomStream.NamingException

getDistribution

public static RandomDistribution getDistribution(java.lang.String distname,
                                                 RandomStream rng)
                                          throws RandomStream.DistributionException
RandomStream.DistributionException

getDistribution

public static RandomDistribution getDistribution(com.renesys.raceway.DML.Configuration cfg,
                                                 RandomStream rng)
                                          throws RandomStream.DistributionException
RandomStream.DistributionException