package umontreal.iro.lecuyer.probdist;
/**
* Extends the {@link ExponentialDist} class with a constructor accepting as
* argument the mean 1/λ instead of the rate λ.
*
*/
public class ExponentialDistFromMean extends ExponentialDist {
/**
* Constructs a new exponential distribution with mean mean.
*
* @param mean the required mean.
*
*/
public ExponentialDistFromMean (double mean) {
super (1.0 / mean);
}
/**
* Calls
* {@link umontreal.iro.lecuyer.probdist.ExponentialDist#setLambda(double) setLambda}
* with argument 1/mean to change the mean of this distribution.
*
* @param mean the new mean.
*
*/
public void setMean (double mean) {
setLambda (1.0 / mean);
}
}
Ads help maintain this website.