Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## sim.util.distribution
Class Poisson

    java.lang.Object
      sim.util.distribution.AbstractDistribution
          sim.util.distribution.AbstractDiscreteDistribution
              sim.util.distribution.Poisson

All Implemented Interfaces:
  java.io.Serializable

    public class Poisson

extends AbstractDiscreteDistribution

Poisson distribution (quick); 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.

Static methods operate on a default uniform random number generator; they are synchronized.

Implementation: High performance implementation. Patchwork Rejection/Inversion method.

This is a port of `pprsc.c` from the C-RAND / WIN-RAND library. C-RAND's implementation, in turn, is based upon

H. Zechner (1994): Efficient sampling from continuous and discrete unimodal distributions, Doctoral Dissertation, 156 pp., Technical University Graz, Austria.

Also see

Stadlober E., H. Zechner (1999), The patchwork rejection method for sampling from unimodal distributions, to appear in ACM Transactions on Modelling and Simulation.

See Also:
  Serialized Form

Field Summary
`protected double` | `c_pm`
`protected double` | `dl`
`protected double` | `dr`
`protected double` | `f1`
`protected double` | `f2`
`protected double` | `f4`
`protected double` | `f5`
`protected int` | `k1`
`protected int` | `k2`
`protected int` | `k4`
`protected int` | `k5`
`protected double` | `l_my`
`protected double` | `ll`
`protected int` | `llll`
`protected double` | `lr`
`protected int` | `m`
`protected double` | `mean`
`protected static double` | `MEAN_MAX`
`protected double` | `my_last`
`protected double` | `my_old`
`protected double` | `p`
`protected double` | `p0`
`protected double` | `p1`
`protected double` | `p2`
`protected double` | `p3`
`protected double` | `p4`
`protected double` | `p5`
`protected double` | `p6`
`protected double[]` | `pp`
`protected double` | `q`
`protected double` | `r1`
`protected double` | `r2`
`protected double` | `r4`
`protected double` | `r5`
`protected static double` | `SWITCH_MEAN`

Fields inherited from class sim.util.distribution.AbstractDistribution
`randomGenerator`

Constructor Summary
`Poisson(double mean, MersenneTwisterFast randomGenerator)` Constructs a poisson distribution.

Method Summary
`double` | `cdf(int k)` Returns the cumulative distribution function.
`int` | `nextInt()` Returns a random number from the distribution.
`int` | `nextInt(double theMean)` Returns a random number from the distribution; bypasses the internal state.
`double` | `pdf(int k)` Returns the probability distribution function.
`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

### mean

    protected double mean

### my_old

    protected double my_old

### p

    protected double p

### q

    protected double q

### p0

    protected double p0

### pp

    protected double[] pp

### llll

    protected int llll

### my_last

    protected double my_last

### ll

    protected double ll

### k2

    protected int k2

### k4

    protected int k4

### k1

    protected int k1

### k5

    protected int k5

### dl

    protected double dl

### dr

    protected double dr

### r1

    protected double r1

### r2

    protected double r2

### r4

    protected double r4

### r5

    protected double r5

### lr

    protected double lr

### l_my

    protected double l_my

### c_pm

    protected double c_pm

### f1

    protected double f1

### f2

    protected double f2

### f4

    protected double f4

### f5

    protected double f5

### p1

    protected double p1

### p2

    protected double p2

### p3

    protected double p3

### p4

    protected double p4

### p5

    protected double p5

### p6

    protected double p6

### m

    protected int m

### MEAN_MAX

    protected static final double MEAN_MAX

See Also:
  Constant Field Values

### SWITCH_MEAN

    protected static final double SWITCH_MEAN

See Also:
  Constant Field Values

Constructor Detail

### Poisson

    public Poisson(double mean,
                   MersenneTwisterFast randomGenerator)

  Constructs a poisson distribution. Example: mean=1.0.

Method Detail

### cdf

    public double cdf(int k)

  Returns the cumulative distribution function.

### nextInt

    public int nextInt()

  Returns a random number from the distribution.

  Specified by:
    `nextInt` in class `AbstractDiscreteDistribution`

### nextInt

    public int nextInt(double theMean)

  Returns a random number from the distribution; bypasses the internal state.

### pdf

    public double pdf(int k)

  Returns the probability distribution function.

### setMean

    public void setMean(double mean)

  Sets the mean.

### toString

    public java.lang.String toString()

  Returns a String representation of the receiver.

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD