|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrobocode.control.RandomFactory
public class RandomFactory
The RandomFactory is used for controlling the generation of random numbers, and supports generating random numbers that are deterministic, which is useful for testing purposes.
| Constructor Summary | |
|---|---|
RandomFactory()
|
|
| Method Summary | |
|---|---|
static Random |
getRandom()
Returns the random number generator used for generating a stream of random numbers. |
boolean |
isDeterministic()
|
static void |
resetDeterministic(long seed)
Resets the random number generator instance to be deterministic when generating random numbers. |
static void |
setRandom(Random random)
Sets the random number generator instance used for generating a stream of random numbers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomFactory()
| Method Detail |
|---|
public boolean isDeterministic()
public static Random getRandom()
Random instance.Randompublic static void setRandom(Random random)
random - a Random instance.Randompublic static void resetDeterministic(long seed)
seed - the seed to use for the new deterministic random generator.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||