javax.realtime.DSS
Class Erand

java.lang.Object
  extended byjavax.realtime.DSS.Erand

public class Erand
extends java.lang.Object

Erand objects represent exponentially distributed pseudo random number streams.

Author:
gary

Field Summary
protected  double lambda
          The distribution defining value, set by constructor.
protected  java.util.Random myRandom
           
 
Constructor Summary
Erand(double lambda)
           
Erand(double lambda, java.util.Random myRandom)
          Create an exponential random stream with mean lambda
 
Method Summary
 double draw()
          Draw the next number in this stream.
 double nonDeterministicDraw(int howMany)
          Draw several numbers from this stream.
 double twoChoice()
          Draw two random numbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lambda

protected double lambda
The distribution defining value, set by constructor.


myRandom

protected java.util.Random myRandom
Constructor Detail

Erand

public Erand(double lambda)

Erand

public Erand(double lambda,
             java.util.Random myRandom)
Create an exponential random stream with mean lambda

Parameters:
lambda -
Method Detail

draw

public double draw()
Draw the next number in this stream.

Returns:
The number drawn

nonDeterministicDraw

public double nonDeterministicDraw(int howMany)
Draw several numbers from this stream.

Parameters:
howMany - The number of numbers to be drawn.
Returns:
the number nondeterministically selected

twoChoice

public double twoChoice()
Draw two random numbers. Equivalent to nonDeterministicDraw( 2 )

Returns:
the number nondeterministically selected