All Packages Class Hierarchy This Package Previous Next Index
Class simula.random.Histd
java.lang.Object
|
+----simula.random.Generator
|
+----simula.random.Histd
- public class Histd
- extends Generator
The class Histd allows to draw integer values distributed in the range 0..n
according to a known histogram of the absolute frequencies. Useful to
extract numbers which we know the empiric distribution of.
-
Histd(double[])
-
Creates a new Histd generator using the java standard engine.
-
Histd(long, double[])
- Creates a new Histd generator using the java standard engine and the given seed.
-
Histd(RandomEngine, double[])
-
Creates a new Histd generator using the given engine.
-
draw()
- Draws a value from the generator.
-
setParam(double[])
- Change the histogram of the absolute frequencies.
-
type()
- Returns the type of the extracted value.
Histd
public Histd(double f[])
- Creates a new Histd generator using the java standard engine.
- Parameters:
- f - Array that contains the absolute frequencies.
Histd
public Histd(long seed,
double f[])
- Creates a new Histd generator using the java standard engine and the given seed.
- Parameters:
- seed - Initial seed to the pseudo-random engine.
- f - Array that contains the absolute frequencies.
Histd
public Histd(RandomEngine e,
double f[])
- Creates a new Histd generator using the given engine.
- Parameters:
- e - Pseudo-random engine to use.
- f - Array that contains the absolute frequencies.
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:
- IntegerValue, Value
setParam
public void setParam(double a[])
- Change the histogram of the absolute frequencies.
- Parameters:
- f - Array that contains the absolute frequencies.
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