All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.Normal

java.lang.Object
   |
   +----simula.random.Generator
           |
           +----simula.random.Normal

public class Normal
extends Generator
The class Normal allows to generate real values with a normal distribution.


Constructor Index

 o Normal(double, double)
Creates a new Normal generator using the standard engine and the current time as seed.
 o Normal(long, double, double)
Creates a new Normal generator using the standard engine with the given seed.
 o Normal(RandomEngine, double, double)
Creates a new Normal generator using the given engine.

Method Index

 o density(double)
Returns the value of the density in the given point.
 o draw()
Draws a value from the generator.
 o setParam(double, double)
Change the parameters of the gaussian distribution.
 o type()
Returns the type of the extracted value.

Constructors

 o Normal
 public Normal(double m,
               double s)
Creates a new Normal generator using the standard engine and the current time as seed.

Parameters:
m - Average.
s - Square root of the standard deviation.
 o Normal
 public Normal(long seed,
               double m,
               double s)
Creates a new Normal generator using the standard engine with the given seed.

Parameters:
seed - Initial seed for the pseudo-random engine.
m - Average.
s - Square root of the standard deviation.
 o Normal
 public Normal(RandomEngine e,
               double m,
               double s)
Creates a new Normal generator using the given engine.

Parameters:
e - Pseudo-random bit generator.
m - Average.
s - Square root of the standard deviation.
See Also:
RandomEngine

Methods

 o density
 public double density(double x)
Returns the value of the density in the given point.

Parameters:
x - Point to value the density of.
Returns:
the value of the density in the given point.
 o draw
 public Value draw()
Draws a value from the generator.

Returns:
An instance of Value that encapsulates a real value.
Overrides:
draw in class Generator
See Also:
RealValue, Value
 o setParam
 public void setParam(double m,
                      double s)
Change the parameters of the gaussian distribution.

Parameters:
m - Average.
s - Square root of the standard deviation.
 o type
 public int type()
Returns the type of the extracted value.

Overrides:
type in class Generator

All Packages  Class Hierarchy  This Package  Previous  Next  Index