be.ac.ulg.montefiore.run.totem.util.distribution
Class PoissonDistribution

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.util.distribution.PoissonDistribution
All Implemented Interfaces:
Distribution

public class PoissonDistribution
extends java.lang.Object
implements Distribution

This class implements a Poisson distribution using an acceptance-rejection technique if the mean is lower than THRESHOLD. If the mean is >= than THRESHOLD, we use an approximation by a Normal distribution (because the acceptance-rejection technique becomes costly).

See "Discrete-Event System Simulation", Second Edition, Jerry BANKS, John S. Carson, II, Barry L.Nelson, pp 345-348, 1999, Prentice Hall.

Creation date: 1-Jan-2004

Author:
Jean Lepropre (lepropre@run.montefiore.ulg.ac.be)

Field Summary
static int THRESHOLD
           
 
Constructor Summary
PoissonDistribution(double mean)
          Initialises a newly created PoissonDistribution object.
 
Method Summary
 double generate()
          Returns a double value according to the Poisson distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THRESHOLD

public static final int THRESHOLD
See Also:
Constant Field Values
Constructor Detail

PoissonDistribution

public PoissonDistribution(double mean)
Initialises a newly created PoissonDistribution object.

Parameters:
mean - The mean of the Poisson distribution.
Throws:
java.lang.IllegalArgumentException - If the mean is <= 0.
Method Detail

generate

public double generate()
Returns a double value according to the Poisson distribution.

Specified by:
generate in interface Distribution


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.