All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.Linear

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

public class Linear
extends Generator
The class Linear generates pseudo-random real values based on two arrays of n numbers each: a[i] contains the values of a known cumulative function F in b[i]. The values generated are either in a[] or are generated with linear interpolation.


Constructor Index

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

Method Index

 o draw()
Draws a value from the generator.
 o setParam(double[], double[])
Change the data of the cumulative function.
 o type()
Returns the type of the extracted value.

Constructors

 o Linear
 public Linear(double a[],
               double b[])
Creates a new Linear generator using the standard engine and the current time as seed.

Parameters:
a - Array of the known values of the cumulative function.
b - Array of the points of the cumulative function which we know the values of.
 o Linear
 public Linear(long seed,
               double a[],
               double b[])
Creates a new Linear generator using the standard engine with the given seed.

Parameters:
seed - Initial seed for the pseudo-random engine.
a - Array of the known values of the cumulative function.
b - Array of the points of the cumulative function which we know the values of.
 o Linear
 public Linear(RandomEngine e,
               double a[],
               double b[])
Creates a new Linear generator using the given engine.

Parameters:
e - Pseudo-random bit generator.
a - Array of the known values of the cumulative function.
b - Array of the points of the cumulative function which we know the values of.

Methods

 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 a[],
                      double b[])
Change the data of the cumulative function.

Parameters:
a - Array of the known values of the cumulative function.
b - Array of the points of the cumulative function which we know the values of.
 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