|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.randvar.RandomVariateGenInt
umontreal.iro.lecuyer.randvar.BinomialGen
umontreal.iro.lecuyer.randvar.BinomialConvolutionGen
public class BinomialConvolutionGen
Implements binomial random variate generators using the convolution method. This method generates n Bernouilli random variates with parameter p and adds them up. Its advantages are that it requires little computer memory and no setup time. Its disadvantage is that it is very slow for large n. It makes sense only when n is small.
A local copy of the parameters n and p is maintained in this class.
| Constructor Summary | |
|---|---|
BinomialConvolutionGen(RandomStream s,
BinomialDist dist)
Creates a new random variate generator for distribution dist and stream s. |
|
| Method Summary | |
|---|---|
int |
nextInt()
Generates a random number (an integer) from the discrete distribution contained in this object. |
static int |
nextInt(RandomStream s,
int n,
double p)
|
| Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGenInt |
|---|
getDistribution, getStream, nextArrayOfInt |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinomialConvolutionGen(RandomStream s,
BinomialDist dist)
| Method Detail |
|---|
public int nextInt()
RandomVariateGenInt
nextInt in class BinomialGen
public static int nextInt(RandomStream s,
int n,
double p)
|
SSJ V. 1.1.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||