bcds.tools.random
Class RndExp

java.lang.Object
  extended by bcds.tools.random.RndGenBase
      extended by bcds.tools.random.RndExp
All Implemented Interfaces:
RndGen

public class RndExp
extends RndGenBase
implements RndGen

Generates random values according to an exponential distribution.

Author:
Juan Segovia S.

Constructor Summary
RndExp(double mean)
          Creates a new instance with specific desired mean and standard deviation (sigma).
RndExp(java.util.Random rnd, double mean)
          Creates a new instance with specific desired mean and standard deviation (sigma), with the randomness source set to rnd.
 
Method Summary
 double next()
          Returns a random value X obtained as follows: X = mean * -log(U), where U is a uniformly distributed random sample.
 
Methods inherited from class bcds.tools.random.RndGenBase
getRandomGen, setRandomGen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.tools.random.RndGen
getRandomGen, setRandomGen
 

Constructor Detail

RndExp

public RndExp(double mean)
Creates a new instance with specific desired mean and standard deviation (sigma). The randomness source is the default.


RndExp

public RndExp(java.util.Random rnd,
              double mean)
Creates a new instance with specific desired mean and standard deviation (sigma), with the randomness source set to rnd.

Method Detail

next

public double next()
Returns a random value X obtained as follows: X = mean * -log(U), where U is a uniformly distributed random sample.

Specified by:
next in interface RndGen