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.


Constructor Index

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

Method Index

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

Constructors

 o 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.
 o 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.
 o 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.

Methods

 o 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
 o setParam
 public void setParam(double c[])
Change the discrete distribution..

Parameters:
c - Array that contains a discrete distribution.
 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