Opus5
Class UniformRV

java.lang.Object
  |
  +--Opus5.UniformRV
All Implemented Interfaces:
RandomVariable

public class UniformRV
extends java.lang.Object
implements RandomVariable

A random variable uniformly distributed on a specified interval, (u,v).

Version:
$Id: UniformRV.java,v 3.3 1998/07/28 12:31:09 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Field Summary
protected  double u
          The lower bound of the distribution.
protected  double v
          The upper bound of the distribution.
 
Fields inherited from interface Opus5.RandomVariable
copyright
 
Constructor Summary
UniformRV(double u, double v)
          Constructs a UniformRV with the specified bounds.
 
Method Summary
 double nextDouble()
          Returns a random number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

u

protected double u
The lower bound of the distribution.

v

protected double v
The upper bound of the distribution.
Constructor Detail

UniformRV

public UniformRV(double u,
                 double v)
Constructs a UniformRV with the specified bounds.
Parameters:
u - The lower bound.
Method Detail

nextDouble

public double nextDouble()
Returns a random number. The numbers returned are uniformly distributed on the interval (u,v).
Specified by:
nextDouble in interface RandomVariable
Returns:
A random number.