bcds.tools.random
Class RndUnif

java.lang.Object
  extended by bcds.tools.random.RndGenBase
      extended by bcds.tools.random.RndUnif
All Implemented Interfaces:
RndGen

public class RndUnif
extends RndGenBase
implements RndGen

Generates uniformly distributed random values in the range [0, max).

Author:
Juan Segovia S.

Constructor Summary
RndUnif(double max)
          Creates an instance that will produce randomm values in the range [0..max), that is excluding max.
RndUnif(java.util.Random rnd, double max)
          Creates an instance that will produce randomm values in the range [0..max), that is excluding max, using rnd as the randomness source.
 
Method Summary
 double next()
          Returns a uniformly distributed random value in the range [0, max).
 
Methods inherited from class bcds.tools.random.RndGenBase
getRandomGen, setRandomGen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.tools.random.RndGen
getRandomGen, setRandomGen
 

Constructor Detail

RndUnif

public RndUnif(double max)
Creates an instance that will produce randomm values in the range [0..max), that is excluding max. It uses the default randomness source.


RndUnif

public RndUnif(java.util.Random rnd,
               double max)
Creates an instance that will produce randomm values in the range [0..max), that is excluding max, using rnd as the randomness source.

Method Detail

next

public double next()
Returns a uniformly distributed random value in the range [0, max).

Specified by:
next in interface RndGen