be.ac.ulg.montefiore.run.distributions
Class ExponentialDistribution

java.lang.Object
  extended by be.ac.ulg.montefiore.run.distributions.ExponentialDistribution
All Implemented Interfaces:
RandomDistribution, java.io.Serializable

public class ExponentialDistribution
extends java.lang.Object
implements RandomDistribution

This class implements an generator of exponentially distributed reals.

See Also:
Serialized Form

Constructor Summary
ExponentialDistribution(double rate)
          Creates a new pseudo-random, exponential distribution which is the distribution of waiting times between two events of a Poisson distribution with rate rate.
 
Method Summary
 double generate()
          Generates a pseudo-random number.
 double probability(double n)
          Returns the probability (density) of a given number.
 double rate()
          Returns this distribution's rate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExponentialDistribution

public ExponentialDistribution(double rate)
Creates a new pseudo-random, exponential distribution which is the distribution of waiting times between two events of a Poisson distribution with rate rate. The mean value of this distribution is rate-1.

Parameters:
rate - The parameter of the distribution.
Method Detail

rate

public double rate()
Returns this distribution's rate.

Returns:
This distribution's rate.

generate

public double generate()
Description copied from interface: RandomDistribution
Generates a pseudo-random number. The numbers generated by this function are drawn according to the pseudo-random distribution described by the object that implements it.

Specified by:
generate in interface RandomDistribution
Returns:
A pseudo-random number.

probability

public double probability(double n)
Description copied from interface: RandomDistribution
Returns the probability (density) of a given number.

Specified by:
probability in interface RandomDistribution
Parameters:
n - A number.


Copyright © 2004,2005 Jean-Marc François.