umontreal.iro.lecuyer.randvar
Class BernoulliGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- umontreal.iro.lecuyer.randvar.RandomVariateGenInt
-
- umontreal.iro.lecuyer.randvar.BernoulliGen
-
public class BernoulliGen extends RandomVariateGenInt
This class implements random variate generators for the Bernoulli distribution (see classBernoulliDist).
-
-
Constructor Summary
Constructors Constructor and Description 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetP()Returns the parameter p of this object.static intnextInt(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
-
-
-
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG