SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class ExponentialGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.ExponentialGen
Direct Known Subclasses:
ExponentialInverseFromDensityGen

public class ExponentialGen
extends RandomVariateGen

This class implements random variate generators for the exponential distribution. The density is

f (x) = λe-λx         for x >= 0,

where λ > 0.

The (non-static) nextDouble method simply calls inverseF on the distribution.


Constructor Summary
ExponentialGen(RandomStream s, double lambda)
          Creates an exponential random variate generator with parameter λ = lambda, using stream s.
ExponentialGen(RandomStream s, ExponentialDist dist)
          Creates a new generator for the exponential distribution dist and stream s.
 
Method Summary
 double getLambda()
          Returns the λ associated with this object.
static double nextDouble(RandomStream s, double lambda)
          Uses inversion to generate a new exponential variate with parameter λ = lambda, using stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExponentialGen

public ExponentialGen(RandomStream s,
                      double lambda)
Creates an exponential random variate generator with parameter λ = lambda, using stream s.


ExponentialGen

public ExponentialGen(RandomStream s,
                      ExponentialDist dist)
Creates a new generator for the exponential distribution dist and stream s.

Method Detail

nextDouble

public static double nextDouble(RandomStream s,
                                double lambda)
Uses inversion to generate a new exponential variate with parameter λ = lambda, using stream s.


getLambda

public double getLambda()
Returns the λ associated with this object.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.