All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simula.random.Randint

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

public class Randint
extends Generator
The class Randint allows to extract uniformely from a known set of natural consecutive numbers (e.g. {4, 5, 6, 7});


Constructor Index

 o Randint(int, int)
Creates a new Randint generator using the standard engine and the current time as seed.
 o Randint(long, int, int)
Creates a new Randint generator using the standard engine and the given seed.
 o Randint(RandomEngine, int, int)
Creates a new Randint generator using the given engine.

Method Index

 o density(int)
Returns the type of the extracted value.
 o draw()
Draws a value from the generator.
 o setParam(int, int)
Change the bounds.
 o type()
Abstract method that allows to identify the type of the value.

Constructors

 o Randint
 public Randint(int a,
                int b)
Creates a new Randint generator using the standard engine and the current time as seed.

Parameters:
a - Lower bound.
b - Upper bound.
 o Randint
 public Randint(long seed,
                int a,
                int b)
Creates a new Randint generator using the standard engine and the given seed.

Parameters:
seed - Initial seed for the pseudo-random engine.
a - Lower bound.
b - Upper bound.
 o Randint
 public Randint(RandomEngine e,
                int a,
                int b)
Creates a new Randint generator using the given engine.

Parameters:
e - Pseudo-random bit generator.
a - Lower bound.
b - Upper bound.

Methods

 o density
 public double density(int x)
Returns the type of the extracted value.

 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(int a,
                      int b)
Change the bounds.

Parameters:
a - Lower bound.
b - Upper bound.
 o type
 public int type()
Abstract method that allows to identify the type of the value.

Overrides:
type in class Generator

All Packages  Class Hierarchy  This Package  Previous  Next  Index