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 Zeta

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

All Implemented Interfaces:
  java.io.Serializable

    public class Zeta

extends AbstractDiscreteDistribution

Zeta distribution.

Valid parameter ranges: `ro > 0` and `pk >= 0`.

If either `ro > 100` or `k > 10000` numerical problems in computing the theoretical moments arise, therefore `ro <= 100` and `k <= 10000` are recommended.

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:

Method: Acceptance/Rejection. High performance implementation.
This is a port and adaption of `Zeta.c` from the C-RAND / WIN-RAND library. C-RAND's implementation, in turn, is based upon

J. Dagpunar (1988): Principles of Random Variate Generation, Clarendon Press, Oxford.

See Also:
  Serialized Form

Field Summary
`protected double` | `c`
`protected double` | `d`
`protected double` | `maxlongint`
`protected double` | `pk`
`protected double` | `pk_prev`
`protected double` | `ro`
`protected double` | `ro_prev`

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

Constructor Summary
`Zeta(double ro, double pk, MersenneTwisterFast randomGenerator)` Constructs a Zeta distribution.

Method Summary
`protected long` | `generateZeta(double ro, double pk, MersenneTwisterFast randomGenerator)` Returns a zeta distributed random number.
`int` | `nextInt()` Returns a random number from the distribution.
`void` | `setState(double ro, double pk)` Sets the parameters.
`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

### ro

    protected double ro

### pk

    protected double pk

### c

    protected double c

### d

    protected double d

### ro_prev

    protected double ro_prev

### pk_prev

    protected double pk_prev

### maxlongint

    protected double maxlongint

Constructor Detail

### Zeta

    public Zeta(double ro,
                double pk,
                MersenneTwisterFast randomGenerator)

  Constructs a Zeta distribution.

Method Detail

### generateZeta

    protected long generateZeta(double ro,
                                double pk,
                                MersenneTwisterFast randomGenerator)

  Returns a zeta distributed random number.

### nextInt

    public int nextInt()

  Returns a random number from the distribution.

  Specified by:
    `nextInt` in class `AbstractDiscreteDistribution`

### setState

    public void setState(double ro,
                         double pk)

  Sets the parameters.

### 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