edu.rit.numeric
Class DoublePrng

java.lang.Object
  extended by edu.rit.numeric.DoublePrng
Direct Known Subclasses:
ExponentialPrng, NormalPrng, UniformPrng

public abstract class DoublePrng
extends Object

Class DoublePrng is the abstract base class for a pseudorandom number generator (PRNG) that generates random numbers of type double. The generated random numbers' probability distribution is determined by the subclass.


Field Summary
protected  Random myUniformPrng
          The underlying uniform PRNG.
 
Constructor Summary
DoublePrng(Random theUniformPrng)
          Construct a new double PRNG.
 
Method Summary
abstract  double next()
          Returns the next random number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myUniformPrng

protected final Random myUniformPrng
The underlying uniform PRNG.

Constructor Detail

DoublePrng

public DoublePrng(Random theUniformPrng)
Construct a new double PRNG.

Parameters:
theUniformPrng - The underlying uniform PRNG.
Throws:
NullPointerException - (unchecked exception) Thrown if theUniformPrng is null.
Method Detail

next

public abstract double next()
Returns the next random number.

Returns:
Random number.


Copyright © 2005-2012 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.