Package ru.ispras.fortress.randomizer
Class LaggedFibonacci
- java.lang.Object
-
- ru.ispras.fortress.randomizer.LaggedFibonacci
-
- All Implemented Interfaces:
RandomGenerator
public final class LaggedFibonacci extends java.lang.Object implements RandomGenerator
The additive lagged Fibonacci random number generator.
-
-
Constructor Summary
Constructors Constructor Description LaggedFibonacci()
Constructs an additive lagged Fibonacci random number generator with the default (zero) seed.LaggedFibonacci(int seed)
Constructs an 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
-
LaggedFibonacci
public LaggedFibonacci()
Constructs an additive lagged Fibonacci random number generator with the default (zero) seed.
-
LaggedFibonacci
public LaggedFibonacci(int seed)
Constructs an 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.
-
-