jsim.variate
Class HyperGeometric

java.lang.Object
  extended by jsim.variate.Variate
      extended by jsim.variate.HyperGeometric

public class HyperGeometric
extends Variate

Generate a random number from the hypergeometric distribution with population m, number of drawn items n and probability of success p.


Constructor Summary
HyperGeometric(double m, double n, double p, int i)
          Constructs a Hyper-Geometric random variate.
HyperGeometric(int m, int n, double p, int i)
          Constructs a Hyper-Geometric random variate.
 
Method Summary
 double gen()
          Generate a random number from the hypergeometric distribution.
 java.lang.Double[] getParameters()
          Get the parameters of the constuctor
 
Methods inherited from class jsim.variate.Variate
incStream, printName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyperGeometric

public HyperGeometric(int m,
                      int n,
                      double p,
                      int i)
Constructs a Hyper-Geometric random variate.

Parameters:
m - size of population
n - number of items drawn from population
p - probability of success
i - stream

HyperGeometric

public HyperGeometric(double m,
                      double n,
                      double p,
                      int i)
Constructs a Hyper-Geometric random variate.

Parameters:
m - size of population
n - number of items drawn from population
p - probability of success
i - stream
Method Detail

getParameters

public java.lang.Double[] getParameters()
Get the parameters of the constuctor

Overrides:
getParameters in class Variate

gen

public double gen()
Generate a random number from the hypergeometric distribution.

Overrides:
gen in class Variate
Returns:
double random number from HyperGeometric distribution