All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.Generator

java.lang.Object
   |
   +----simula.random.Generator

public abstract class Generator
extends Object
The abstract class Generator is the common parent of the hierarchy of the classes implementing generators with different distribution. Every implementation of this class offers the possibility to draw integer, real or boolean values according to the chosen distribution. The class RandomEngine is the source of the pseudo-random bits. Every implementation should define its own constructors in a proper way such that its paramaters would be properly initialized.

See Also:
RandomEngine

Variable Index

 o BOOLEAN_TYPE
Identifies a boolean valued generator.
 o INTEGER_TYPE
Identifies an integer valued generator.
 o random
Source of the pseudo-random bits.
 o REAL_TYPE
Identifies a real valued generator.

Constructor Index

 o Generator()

Method Index

 o draw()
Draws a value from the generator: its type can be read with the type method.
 o type()
Abstract method that allows to identify the type of the value.

Variables

 o BOOLEAN_TYPE
 public static final int BOOLEAN_TYPE
Identifies a boolean valued generator.

 o INTEGER_TYPE
 public static final int INTEGER_TYPE
Identifies an integer valued generator.

 o REAL_TYPE
 public static final int REAL_TYPE
Identifies a real valued generator.

 o random
 protected RandomEngine random
Source of the pseudo-random bits.

Constructors

 o Generator
 public Generator()

Methods

 o draw
 public abstract Value draw()
Draws a value from the generator: its type can be read with the type method.

Returns:
Value object encapsulating the drawed value.
See Also:
Value
 o type
 public abstract int type()
Abstract method that allows to identify the type of the value. Every implementation must provide this method.

Returns:
Type of the values extracted.
See Also:
REAL_TYPE, INTEGER_TYPE, BOOLEAN_TYPE

All Packages  Class Hierarchy  This Package  Previous  Next  Index