Utility
Class Exponential

java.lang.Object
  |
  +--Utility.RandomNumber
        |
        +--Utility.Exponential

public class Exponential
extends RandomNumber

The Exponential class is used to generate random variables from an exponential distribution.
The Exponential distribution is often used to model inter-arrival times in a simulation.

This is a continuous distribution.

Tests Performed
1000 samples were generated and the means and variances were examined. Subjectively, they seemed correct. A goodness of fit test was performed with 100 samples and 10 intervals. It succeeded about 19/20 times.


Constructor Summary
Exponential(double mean)
          The Exponential constructor initializes the exponential distribution by setting the distribution's mean.
 
Method Summary
 double sampleDouble()
          Generate a random variable, a double, from the exponential distribution.
 int sampleInt()
          The sampleInt function should not be called for this continuous distribution.
 
Methods inherited from class Utility.RandomNumber
goodnessOfFitTest, goodnessOfFitTest, randomMixer, resetRandomMixer, sample01
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exponential

public Exponential(double mean)
The Exponential constructor initializes the exponential distribution by setting the distribution's mean.

Parameters:
mean - The mean of the exponential distribution. The mean alone characterizes the exponential distribution.
Method Detail

sampleDouble

public double sampleDouble()
Generate a random variable, a double, from the exponential distribution.

Overrides:
sampleDouble in class RandomNumber
Returns:
The double representing a random draw from the exponential distribution.

sampleInt

public int sampleInt()
The sampleInt function should not be called for this continuous distribution.

Overrides:
sampleInt in class RandomNumber