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});
-
Randint(int, int)
- Creates a new Randint generator using the standard engine and the current time as seed.
-
Randint(long, int, int)
- Creates a new Randint generator using the standard engine and the given seed.
-
Randint(RandomEngine, int, int)
- Creates a new Randint generator using the given engine.
-
density(int)
- Returns the type of the extracted value.
-
draw()
- Draws a value from the generator.
-
setParam(int, int)
- Change the bounds.
-
type()
- Abstract method that allows to identify the type of the value.
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.
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.
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.
density
public double density(int x)
- Returns the type of the extracted value.
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
setParam
public void setParam(int a,
int b)
- Change the bounds.
- Parameters:
- a - Lower bound.
- b - Upper bound.
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