be.ac.ulg.montefiore.run.totem.util.distribution
Class BimodalDistribution
java.lang.Object
be.ac.ulg.montefiore.run.totem.util.distribution.BimodalDistribution
- All Implemented Interfaces:
- Distribution
public class BimodalDistribution
- extends java.lang.Object
- implements Distribution
This class implements a Bimodal distribution by means of a mixture of two
Normal distributions.
Creation date: 1-Jan-2004
- Author:
- Jean Lepropre (lepropre@run.montefiore.ulg.ac.be)
Constructor Summary |
BimodalDistribution(double mean1,
double stdDeviation1,
double mean2,
double stdDeviation2,
double coinFlip)
Initialises a newly created BimodalDistribution object. |
Method Summary |
double |
generate()
Returns a double value according to the Bimodal
distribution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BimodalDistribution
public BimodalDistribution(double mean1,
double stdDeviation1,
double mean2,
double stdDeviation2,
double coinFlip)
- Initialises a newly created
BimodalDistribution
object.
- Parameters:
mean1
- The mean of the first Normal distribution.stdDeviation1
- The standard deviation of the first Normal
distribution.mean2
- The mean of the second Normal distribution.stdDeviation2
- The standard deviation of the second Normal
distribution.coinFlip
- The probability of using the first Normal distribution.
(1 - coinFlip
) is the probability of using
the second distribution.
- Throws:
java.lang.IllegalArgumentException
- If stdDeviation1 is <= 0, stdDeviation2
is <= 0 or coinFlip is not between 0
and 1 (inclusive).
generate
public double generate()
- Returns a
double
value according to the Bimodal
distribution.
- Specified by:
generate
in interface Distribution
Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.