public class GeometricGen extends RandomVariateGenInt
| Constructor and Description |
|---|
GeometricGen(RandomStream s,
double p)
Creates a geometric random variate generator with
parameter p, using stream s.
|
GeometricGen(RandomStream s,
GeometricDist dist)
Creates a new generator for the distribution dist, using
stream s.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getP()
Returns the parameter p of this object.
|
int |
nextInt()
Generates a random number (an integer) from the discrete
distribution contained in this object.
|
static int |
nextInt(RandomStream s,
double p)
Generates a geometric random variate with parameter
p = p, using stream s, by inversion.
|
getDistribution, nextArrayOfIntgetStream, nextArrayOfDouble, nextDouble, setStreampublic GeometricGen(RandomStream s, double p)
public GeometricGen(RandomStream s, GeometricDist dist)
public int nextInt()
RandomVariateGenIntnextInt in class RandomVariateGenIntpublic static int nextInt(RandomStream s, double p)
public double getP()
To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.