SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.randvar.UniformGen Class Reference

This class implements random variate generators for the (continuous) uniform distribution over the interval \((a,b)\), where \(a\) and. More...

Inheritance diagram for umontreal.ssj.randvar.UniformGen:
umontreal.ssj.randvar.RandomVariateGen

Public Member Functions

 UniformGen (RandomStream s, double a, double b)
 Creates a uniform random variate generator over the interval.
 UniformGen (RandomStream s)
 Creates a uniform random variate generator over the interval \((0, 1)\), using stream s.
 UniformGen (RandomStream s, UniformDist dist)
 Creates a new generator for the uniform distribution dist and stream s.
double getA ()
 Returns the value of \(a\) for this object.
double getB ()
 Returns the value of \(b\) for this object.
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.
Distribution getDistribution ()
 Returns the umontreal.ssj.probdist.Distribution used by this generator.
String toString ()
 Returns a String containing information about the current generator.

Static Public Member Functions

static double nextDouble (RandomStream s, double a, double b)
 Generates a uniform random variate over the interval.

Detailed Description

This class implements random variate generators for the (continuous) uniform distribution over the interval \((a,b)\), where \(a\) and.

\(b\) are real numbers with \(a < b\). The density is

\[ f(x) = 1/(b - a) \qquad\mbox{ for }a\le x\le b. \tag{funiform} \]

The (non-static) nextDouble method simply calls inverseF on the distribution.

Definition at line 43 of file UniformGen.java.

Constructor & Destructor Documentation

◆ UniformGen() [1/3]

umontreal.ssj.randvar.UniformGen.UniformGen ( RandomStream s,
double a,
double b )

Creates a uniform random variate generator over the interval.

\((\)a, b \()\), using stream s.

Definition at line 52 of file UniformGen.java.

◆ UniformGen() [2/3]

umontreal.ssj.randvar.UniformGen.UniformGen ( RandomStream s)

Creates a uniform random variate generator over the interval \((0, 1)\), using stream s.

Definition at line 61 of file UniformGen.java.

◆ UniformGen() [3/3]

umontreal.ssj.randvar.UniformGen.UniformGen ( RandomStream s,
UniformDist dist )

Creates a new generator for the uniform distribution dist and stream s.

Definition at line 68 of file UniformGen.java.

Member Function Documentation

◆ getA()

double umontreal.ssj.randvar.UniformGen.getA ( )

Returns the value of \(a\) for this object.

Definition at line 86 of file UniformGen.java.

◆ getB()

double umontreal.ssj.randvar.UniformGen.getB ( )

Returns the value of \(b\) for this object.

Definition at line 93 of file UniformGen.java.

◆ nextDouble()

double umontreal.ssj.randvar.UniformGen.nextDouble ( RandomStream s,
double a,
double b )
static

Generates a uniform random variate over the interval.

\((\)a, b \()\) by inversion, using stream s.

Definition at line 79 of file UniformGen.java.


The documentation for this class was generated from the following file: