eduni.distributions
Class Pascal

java.lang.Object
  |
  +--eduni.distributions.Generator
        |
        +--eduni.distributions.Pascal
All Implemented Interfaces:
DiscreteGenerator, Seedable

public class Pascal
extends Generator
implements DiscreteGenerator

A random number generator based on the pascal distribution. automatically generated by MetaGenerator


Field Summary
 
Fields inherited from class eduni.distributions.Generator
distrib
 
Constructor Summary
Pascal(double prob, int successes)
          the seed is aumatically provided by the SeedGenerator
Pascal(double prob, int successes, long seed)
          The constructor with which a specific seed is set for the random number generator
 
Method Summary
 long sample()
          Generate a new random number.
 
Methods inherited from class eduni.distributions.Generator
getSeed, reseed, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eduni.distributions.Seedable
getSeed, reseed, setSeed
 

Constructor Detail

Pascal

public Pascal(double prob,
              int successes)
the seed is aumatically provided by the SeedGenerator

Parameters:
prob - : 0 < prob < 1
successes - : successes > 0

Pascal

public Pascal(double prob,
              int successes,
              long seed)
The constructor with which a specific seed is set for the random number generator

Parameters:
prob - : 0 < prob < 1
successes - : successes > 0
seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
Method Detail

sample

public long sample()
Generate a new random number.

Specified by:
sample in interface DiscreteGenerator
Returns:
The next random number in the sequence