All Packages Class Hierarchy This Package Previous Next Index
Class evolution.util.RandomGenerator
java.lang.Object
|
+----evolution.util.RandomGenerator
- public class RandomGenerator
- extends Object
Default RandomGenerator, based on the standard java.util.Random.
-
myRG
-
-
RandomGenerator()
- Create myself to be based on a new java.util.Random, seeded with the current time.
-
RandomGenerator(byte[])
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
-
RandomGenerator(long)
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
-
aByte()
-
-
aFloat()
-
-
anInt()
-
-
anInt(int, int)
-
-
maxInt()
-
-
seed(byte[])
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
-
yes(float)
-
myRG
protected Random myRG
RandomGenerator
public RandomGenerator()
- Create myself to be based on a new java.util.Random, seeded with the current time.
RandomGenerator
public RandomGenerator(byte seed[])
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
RandomGenerator
public RandomGenerator(long seed)
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
seed
public void seed(byte seed[])
- Create myself to be based on a new java.util.Random,
seeded with the given seed.
- Parameters:
- seed - != nil
aByte
public byte aByte()
- Returns:
- a random byte
anInt
public int anInt()
- Returns:
- a random non-negative integer
anInt
public int anInt(int lower,
int upper)
- Returns:
- a random integer in [lower, upper)
yes
public boolean yes(float probability)
- Parameters:
- probability - the probability to return true
- Returns:
- true with the probability
probability
maxInt
public static int maxInt()
- Returns:
- the upper bound of my possible integer values
aFloat
public float aFloat()
- Returns:
- a positive float number
All Packages Class Hierarchy This Package Previous Next Index