Class DX120Generator
java.lang.Object
nl.tudelft.simulation.jstats.streams.RandomNumberGenerator
nl.tudelft.simulation.jstats.streams.DX120Generator
- All Implemented Interfaces:
Serializable
,StreamInterface
The DX-120-4 pseudo random number generator. This generator is described in
A System of High-dimensional, Efficient, Long-cycle and
Portable Uniform Random Number Generators .
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Alexander Verbraeck, Peter Jacobs
- See Also:
-
Field Summary
Fields inherited from class nl.tudelft.simulation.jstats.streams.RandomNumberGenerator
seed
-
Constructor Summary
ConstructorDescriptionconstructs a new LC48Generator.DX120Generator
(long seed) constructs a new LC48Generator. -
Method Summary
Methods inherited from class nl.tudelft.simulation.jstats.streams.RandomNumberGenerator
getOriginalSeed, getSeed, nextBoolean, nextDouble, nextFloat, nextInt, nextInt, nextLong, reset, restoreState, saveState, toString
-
Constructor Details
-
DX120Generator
public DX120Generator()constructs a new LC48Generator. the seed value used equals System.currentTimeMillis() -
DX120Generator
public DX120Generator(long seed) constructs a new LC48Generator.- Parameters:
seed
- long; the seed
-
-
Method Details
-
next
public long next(int bits) returns the next value in the stream.- Specified by:
next
in classRandomNumberGenerator
- Parameters:
bits
- int; the number of bits used- Returns:
- the next value.
-
setSeed
public void setSeed(long seed) Set the seed of the generator.- Specified by:
setSeed
in interfaceStreamInterface
- Specified by:
setSeed
in classRandomNumberGenerator
- Parameters:
seed
- long; the new seed
-