Class 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.
Version:
1.0, 2 October 2002
Author:
F.Mallet from Costas Simatos's original
  • Field Details

    • mean

      protected double mean
    • std_dev

      protected double std_dev
  • Constructor Details

    • 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
    • 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
      seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
  • Method Details

    • sample

      public double sample()
      Generate a new random number.
      Specified by:
      sample in interface ContinuousGenerator
      Returns:
      The next random number in the sequence