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.
-
Linear(double[], double[])
- Creates a new Linear generator using the standard engine and the current time as seed.
-
Linear(long, double[], double[])
- Creates a new Linear generator using the standard engine with the given seed.
-
Linear(RandomEngine, double[], double[])
- Creates a new Linear generator using the given engine.
-
draw()
- Draws a value from the generator.
-
setParam(double[], double[])
- Change the data of the cumulative function.
-
type()
- Returns the type of the extracted value.
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.
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.
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.
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
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.
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