|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.util.distribution.AbstractDistribution
sim.util.distribution.AbstractDiscreteDistribution
sim.util.distribution.PoissonSlow
public class PoissonSlow
Poisson distribution; See the math definition and animated definition.
p(k) = (mean^k / k!) * exp(-mean) for k >= 0.
Valid parameter ranges: mean > 0. Note: if mean <= 0.0 then always returns zero.
Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
Implementation: This is a port of RandPoisson used in CLHEP 1.4.0 (C++). CLHEP's implementation, in turn, is based upon "W.H.Press et al., Numerical Recipes in C, Second Edition".
Field Summary | |
---|---|
protected double |
cached_alxm
|
protected double |
cached_g
|
protected double |
cached_sq
|
protected static double[] |
cof
|
protected double |
mean
|
protected static double |
MEAN_MAX
|
protected static double |
SWITCH_MEAN
|
Fields inherited from class sim.util.distribution.AbstractDistribution |
---|
randomGenerator |
Constructor Summary | |
---|---|
PoissonSlow(double mean,
MersenneTwisterFast randomGenerator)
Constructs a poisson distribution. |
Method Summary | |
---|---|
static double |
logGamma(double xx)
Returns the value ln(Gamma(xx) for xx > 0. |
int |
nextInt()
Returns a random number from the distribution. |
protected int |
nextIntSlow()
Returns a random number from the distribution. |
void |
setMean(double mean)
Sets the mean. |
java.lang.String |
toString()
Returns a String representation of the receiver. |
Methods inherited from class sim.util.distribution.AbstractDiscreteDistribution |
---|
nextDouble |
Methods inherited from class sim.util.distribution.AbstractDistribution |
---|
apply, apply, getRandomGenerator, setRandomGenerator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double mean
protected double cached_sq
protected double cached_alxm
protected double cached_g
protected static final double MEAN_MAX
protected static final double SWITCH_MEAN
protected static final double[] cof
Constructor Detail |
---|
public PoissonSlow(double mean, MersenneTwisterFast randomGenerator)
Method Detail |
---|
public static double logGamma(double xx)
public int nextInt()
nextInt
in class AbstractDiscreteDistribution
protected int nextIntSlow()
public void setMean(double mean)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |