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.


Constructor Index

 o Histd(double[])
Creates a new Histd generator using the java standard engine.
 o Histd(long, double[])
Creates a new Histd generator using the java standard engine and the given seed.
 o Histd(RandomEngine, double[])
Creates a new Histd generator using the given engine.

Method Index

 o draw()
Draws a value from the generator.
 o setParam(double[])
Change the histogram of the absolute frequencies.
 o type()
Returns the type of the extracted value.

Constructors

 o Histd
 public Histd(double f[])
Creates a new Histd generator using the java standard engine.

Parameters:
f - Array that contains the absolute frequencies.
 o 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.
 o 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.

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:
IntegerValue, Value
 o setParam
 public void setParam(double a[])
Change the histogram of the absolute frequencies.

Parameters:
f - Array that contains the absolute frequencies.
 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