public class DRand extends RandomEngine
The seed can be any integer satisfying 0 < 4*seed+1 < 232. In other words, there must hold seed >= 0 && seed < 1073741823.
Quality: This generator follows the multiplicative congruential method of the form
Performance: TO_DO
Implementation: TO_DO
Note that this implementation is not synchronized.
MersenneTwister
,
Random
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEED |
serialVersionUID
Constructor and Description |
---|
DRand()
Constructs and returns a random number generator with a default seed, which is a constant.
|
DRand(Date d)
Constructs and returns a random number generator seeded with the given date.
|
DRand(int seed)
Constructs and returns a random number generator with the given seed.
|
Modifier and Type | Method and Description |
---|---|
int |
nextInt()
Returns a 32 bit uniformly distributed random number in the closed interval [Integer.MIN_VALUE,Integer.MAX_VALUE] (including Integer.MIN_VALUE and Integer.MAX_VALUE).
|
protected void |
setSeed(int seed)
Sets the receiver's seed.
|
apply, apply, makeDefault, nextDouble, nextFloat, nextLong, raw
clone
public static final int DEFAULT_SEED
public DRand()
public DRand(int seed)
seed
- should not be 0, in such a case DRand.DEFAULT_SEED is substituted.public DRand(Date d)
d
- typically new java.util.Date()public int nextInt()
nextInt
in class RandomEngine
protected void setSeed(int seed)
seed
- if the above condition does not hold, a modified seed that meets the condition is silently substituted.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.