public class BinomialGen extends RandomVariateGenInt
The (non-static) nextInt method simply calls inverseF on the distribution.
| Constructor and Description |
|---|
BinomialGen(RandomStream s,
BinomialDist dist)
Creates a random variate generator for the binomial
distribution dist and the random stream s.
|
BinomialGen(RandomStream s,
int n,
double p)
Creates a binomial random variate generator with parameters n and p,
using stream s.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getN()
Returns the parameter n of this object.
|
double |
getP()
Returns the parameter p of this object.
|
static int |
nextInt(RandomStream s,
int n,
double p)
Generates a new integer from the binomial distribution with
parameters
n = n and p = p, using the given stream s.
|
getDistribution, nextArrayOfInt, nextIntgetStream, nextArrayOfDouble, nextDouble, setStreampublic BinomialGen(RandomStream s, int n, double p)
public BinomialGen(RandomStream s, BinomialDist dist)
public static int nextInt(RandomStream s, int n, double p)
public int getN()
public double getP()
To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.