This is the base class for all generators of discrete random variates over the set of integers. More...
Public Member Functions | |
| RandomVariateGenInt (RandomStream s, DiscreteDistributionInt dist) | |
| Creates a new random variate generator for the discrete distribution dist, using stream s. | |
| int | nextInt () |
| Generates a random number (an integer) from the discrete distribution contained in this object. | |
| void | nextArrayOfInt (int[] v, int start, int n) |
| Generates n random numbers from the discrete distribution contained in this object. | |
| int[] | nextArrayOfInt (int n) |
| Generates n random numbers from the discrete distribution contained in this object, and returns them in a new array of size n. | |
| DiscreteDistributionInt | getDistribution () |
| Returns the umontreal.ssj.probdist.DiscreteDistributionInt used by this generator. | |
| Public Member Functions inherited from umontreal.ssj.randvar.RandomVariateGen | |
| RandomVariateGen (RandomStream s, Distribution dist) | |
| Creates a new random variate generator from the distribution dist, using stream s. | |
| double | nextDouble () |
| Generates a random number from the continuous distribution contained in this object. | |
| void | nextArrayOfDouble (double[] v, int start, int n) |
| Generates n random numbers from the continuous distribution contained in this object. | |
| double[] | nextArrayOfDouble (int n) |
| Generates n random numbers from the continuous distribution contained in this object, and returns them in a new array of size n. | |
| RandomStream | getStream () |
| Returns the umontreal.ssj.rng.RandomStream used by this generator. | |
| void | setStream (RandomStream stream) |
| Sets the umontreal.ssj.rng.RandomStream used by this generator to stream. | |
| String | toString () |
| Returns a String containing information about the current generator. | |
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.
Definition at line 41 of file RandomVariateGenInt.java.
| umontreal.ssj.randvar.RandomVariateGenInt.RandomVariateGenInt | ( | RandomStream | s, |
| DiscreteDistributionInt | dist ) |
Creates a new random variate generator for the discrete distribution dist, using stream s.
| s | random stream used for generating uniforms |
| dist | discrete distribution object of the generated values |
Definition at line 53 of file RandomVariateGenInt.java.
| DiscreteDistributionInt umontreal.ssj.randvar.RandomVariateGenInt.getDistribution | ( | ) |
Returns the umontreal.ssj.probdist.DiscreteDistributionInt used by this generator.
Reimplemented from umontreal.ssj.randvar.RandomVariateGen.
Definition at line 111 of file RandomVariateGenInt.java.
| int[] umontreal.ssj.randvar.RandomVariateGenInt.nextArrayOfInt | ( | int | n | ) |
Generates n random numbers from the discrete distribution contained in this object, and returns them in a new array of size n.
By default, this method calls nextInt() n times, but one can override it in subclasses for better efficiency.
| n | number of variates to generate |
Definition at line 96 of file RandomVariateGenInt.java.
| void umontreal.ssj.randvar.RandomVariateGenInt.nextArrayOfInt | ( | int[] | v, |
| int | start, | ||
| int | n ) |
Generates n random numbers from the discrete distribution contained in this object.
The results are stored into the array v, starting from index start. By default, this method calls nextInt() n times, but one can reimplement it in subclasses for better efficiency.
| v | array into which the variates will be stored |
| start | starting index, in v, of the new variates |
| n | number of variates being generated |
Definition at line 80 of file RandomVariateGenInt.java.
| int umontreal.ssj.randvar.RandomVariateGenInt.nextInt | ( | ) |
Generates a random number (an integer) from the discrete distribution contained in this object.
By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.
Reimplemented in umontreal.ssj.randvar.BinomialConvolutionGen, umontreal.ssj.randvar.GeometricGen, umontreal.ssj.randvar.LogarithmicGen, umontreal.ssj.randvar.PascalConvolutionGen, and umontreal.ssj.randvar.PoissonTIACGen.
Definition at line 66 of file RandomVariateGenInt.java.