eduni.distributions
Class Normal

java.lang.Object
  |
  +--eduni.distributions.Generator
        |
        +--eduni.distributions.Normal
All Implemented Interfaces:
ContinuousGenerator, Seedable
Direct Known Subclasses:
LogNormal

public class Normal
extends Generator
implements ContinuousGenerator

A random number generator based on the normal distribution.


Field Summary
protected  double mean
           
protected  double std_dev
           
 
Fields inherited from class eduni.distributions.Generator
distrib
 
Constructor Summary
Normal(double mean, double variance)
          the seed is automatically provided by the SeedGenerator
Normal(double mean, double variance, long seed)
          The constructor with which a specific seed is set for the random number generator
 
Method Summary
 double sample()
          Generate a new random number.
 
Methods inherited from class eduni.distributions.Generator
getSeed, reseed, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eduni.distributions.Seedable
getSeed, reseed, setSeed
 

Field Detail

mean

protected double mean

std_dev

protected double std_dev
Constructor Detail

Normal

public Normal(double mean,
              double variance)
the seed is automatically provided by the SeedGenerator

Parameters:
mean - The mean of the distribution
variance - The variance of the distribution : variance > 0

Normal

public Normal(double mean,
              double variance,
              long seed)
The constructor with which a specific seed is set for the random number generator

Parameters:
mean - The mean of the distribution
variance - The variance of the distribution : variance > 0
seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
Method Detail

sample

public double sample()
Generate a new random number.

Specified by:
sample in interface ContinuousGenerator
Returns:
The next random number in the sequence