SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class BernoulliGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenInt
          extended by umontreal.iro.lecuyer.randvar.BernoulliGen

public class BernoulliGen
extends RandomVariateGenInt

This class implements random variate generators for the Bernoulli distribution (see class BernoulliDist).


Constructor Summary
BernoulliGen(RandomStream s, BernoulliDist dist)
          Creates a random variate generator for the Bernoulli distribution dist and the random stream s.
BernoulliGen(RandomStream s, double p)
          Creates a Bernoulli random variate generator with parameter p, using stream s.
 
Method Summary
 double getP()
          Returns the parameter p of this object.
static int nextInt(RandomStream s, double p)
          Generates a new integer from the Bernoulli distribution with parameter p = p, using the given stream s.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGenInt
getDistribution, nextArrayOfInt, nextInt
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BernoulliGen

public BernoulliGen(RandomStream s,
                    double p)
Creates a Bernoulli random variate generator with parameter p, using stream s.


BernoulliGen

public BernoulliGen(RandomStream s,
                    BernoulliDist dist)
Creates a random variate generator for the Bernoulli distribution dist and the random stream s.

Method Detail

nextInt

public static int nextInt(RandomStream s,
                          double p)
Generates a new integer from the Bernoulli distribution with parameter p = p, using the given stream s.


getP

public double getP()
Returns the parameter p of this object.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.