All Packages Class Hierarchy This Package Previous Next Index
Class simula.random.Discrete
java.lang.Object
|
+----simula.random.Generator
|
+----simula.random.Discrete
- public class Discrete
- extends Generator
The class Discrete allows to draw integer values distributed according
to an arbitrary discrete distribution. The values extracted are always
in the range 0..n.
-
Discrete(double[])
- Creates a new generator using the java standard engine and the current
time as initial seed.
-
Discrete(long, double[])
- Creates a new generator using the java standard engine.
-
Discrete(RandomEngine, double[])
- Creates a new generator using the given engine.
-
draw()
- Draws a value from the generator.
-
setParam(double[])
- Change the discrete distribution..
-
type()
- Returns the type of the extracted value.
Discrete
public Discrete(double c[])
- Creates a new generator using the java standard engine and the current
time as initial seed.
- Parameters:
- c - Array that contains a discrete distribution.
Discrete
public Discrete(long seed,
double c[])
- Creates a new generator using the java standard engine.
- Parameters:
- seed - Initial seed to the pseudo-random engine.
- c - Array that contains a discrete distribution.
Discrete
public Discrete(RandomEngine e,
double c[])
- Creates a new generator using the given engine.
- Parameters:
- e - Pseudo-random engine to use.
- c - Array that contains a discrete distribution.
draw
public Value draw()
- Draws a value from the generator.
- Returns:
- An instance of Value that encapsulates an integer value.
- Overrides:
- draw in class Generator
- See Also:
- IntegerValue, Value
setParam
public void setParam(double c[])
- Change the discrete distribution..
- Parameters:
- c - Array that contains a discrete distribution.
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