SSJ
3.3.1
Stochastic Simulation in Java

This is the base class for all random variate generators over the real line. More...
Public Member Functions  
RandomVariateGen (RandomStream s, Distribution dist)  
Creates a new random variate generator from the distribution dist , using stream s . More...  
double  nextDouble () 
Generates a random number from the continuous distribution contained in this object. More...  
void  nextArrayOfDouble (double[] v, int start, int n) 
Generates n random numbers from the continuous distribution contained in this object. More...  
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 . More...  
RandomStream  getStream () 
Returns the umontreal.ssj.rng.RandomStream used by this generator. More...  
void  setStream (RandomStream stream) 
Sets the umontreal.ssj.rng.RandomStream used by this generator to stream .  
Distribution  getDistribution () 
Returns the umontreal.ssj.probdist.Distribution used by this generator. More...  
String  toString () 
Returns a String containing information about the current generator.  
Protected Attributes  
RandomStream  stream 
Distribution  dist 
This is the base class for all random variate generators over the real line.
It specifies the signature of the nextDouble method, which is normally called to generate a realvalued random variate whose distribution has been previously selected. A random variate generator object can be created simply by invoking the constructor of this class with previously created umontreal.ssj.rng.RandomStream and umontreal.ssj.probdist.Distribution objects, or by invoking the constructor of a subclass. By default, all random variates will be generated via inversion by calling the umontreal.ssj.probdist.Distribution.inverseF method for the distribution, even though this can be inefficient in some cases. For some of the distributions, there are subclasses with special and more efficient methods to generate the random variates.
For generating many random variates, creating an object and calling the nonstatic method is more efficient when the generating algorithm involves a significant setup. When no work is done at setup time, the static methods are usually slightly faster.
RandomVariateGen  (  RandomStream  s, 
Distribution  dist  
) 
Creates a new random variate generator from the distribution dist
, using stream s
.
s  random stream used for generating uniforms 
dist  continuous distribution object of the generated values 
Distribution getDistribution  (  ) 
Returns the umontreal.ssj.probdist.Distribution used by this generator.
RandomStream getStream  (  ) 
Returns the umontreal.ssj.rng.RandomStream used by this generator.
void nextArrayOfDouble  (  double []  v, 
int  start,  
int  n  
) 
Generates n
random numbers from the continuous distribution contained in this object.
These numbers are stored in the array v
, starting from index start
. By default, this method calls nextDouble() n
times, but one can override it in subclasses for better efficiency.
v  array in which the variates will be stored 
start  starting index, in v , of the new variates 
n  number of variates to generate 
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
.
By default, this method calls nextDouble() n
times, but one can override it in subclasses for better efficiency.
n  number of variates to generate 
double nextDouble  (  ) 
Generates a random number from the continuous distribution contained in this object.
By default, this method uses inversion by calling the umontreal.ssj.probdist.ContinuousDistribution.inverseF method of the distribution object. Alternative generating methods are provided in subclasses.