|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.randvar.RandomVariateGen umontreal.iro.lecuyer.randvar.RandomVariateGenInt
public class RandomVariateGenInt
This is the base class for all generators of discrete random variates
over the set of integers.
Similar to RandomVariateGen
, except that the generators
produce integers, via the nextInt
method, instead of real numbers.
Constructor Summary | |
---|---|
RandomVariateGenInt(RandomStream s,
DiscreteDistributionInt dist)
Creates a new random variate generator for the discrete distribution dist, using stream s. |
Method Summary | |
---|---|
DiscreteDistributionInt |
getDistribution()
Returns the DiscreteDistributionInt used by this generator. |
void |
nextArrayOfInt(int[] v,
int start,
int n)
Generates n random numbers from the discrete distribution contained in this object. |
int |
nextInt()
Generates a random number (an integer) from the discrete distribution contained in this object. |
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 |
---|
public RandomVariateGenInt(RandomStream s, DiscreteDistributionInt dist)
s
- random stream used for generating uniformsdist
- discrete distribution object of the generated valuesMethod Detail |
---|
public int nextInt()
public void nextArrayOfInt(int[] v, int start, int n)
nextInt()
n
times, but one can reimplement it in subclasses for better efficiency.
v
- array into which the variates will be storedstart
- starting index, in v, of the new variatesn
- number of variates being generatedpublic DiscreteDistributionInt getDistribution()
DiscreteDistributionInt
used by this generator.
getDistribution
in class RandomVariateGen
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |