Package ru.ispras.fortress.randomizer
Class ModifiedLaggedFibonacci
- java.lang.Object
-
- ru.ispras.fortress.randomizer.ModifiedLaggedFibonacci
-
- All Implemented Interfaces:
RandomGenerator
public final class ModifiedLaggedFibonacci extends java.lang.Object implements RandomGenerator
The modified additive lagged Fibonacci random number generator.
-
-
Constructor Summary
Constructors Constructor Description ModifiedLaggedFibonacci()
Constructs a modified additive lagged Fibonacci random number generator with the default (zero) seed.ModifiedLaggedFibonacci(int seed)
Constructs a modified additive lagged Fibonacci random number generator with the given seed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
next()
Returns the next random integer number.void
seed(int seed)
Sets the seed of the random number generator.
-
-
-
Constructor Detail
-
ModifiedLaggedFibonacci
public ModifiedLaggedFibonacci()
Constructs a modified additive lagged Fibonacci random number generator with the default (zero) seed.
-
ModifiedLaggedFibonacci
public ModifiedLaggedFibonacci(int seed)
Constructs a modified additive lagged Fibonacci random number generator with the given seed.- Parameters:
seed
- the seed to be set.
-
-
Method Detail
-
seed
public void seed(int seed)
Description copied from interface:RandomGenerator
Sets the seed of the random number generator.- Specified by:
seed
in interfaceRandomGenerator
- Parameters:
seed
- the seed to be set.
-
next
public int next()
Description copied from interface:RandomGenerator
Returns the next random integer number.- Specified by:
next
in interfaceRandomGenerator
- Returns:
- the random int.
-
-