Package robocode.control

## Class RandomFactory

- java.lang.Object
- - robocode.control.RandomFactory

    public class RandomFactory
    extends java.lang.Object

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.

Since:
  1.6.1
Author:
  Pavel Savara (original), Xor (fixed for Java 8), Flemming N. Larsen (fixed for Java 8)

### Constructor Summary

Constructors
`RandomFactory()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static java.util.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​(java.util.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

#### RandomFactory

    public RandomFactory()

### Method Detail

#### isDeterministic

    public boolean isDeterministic()

#### getRandom

    public static java.util.Random getRandom()

Returns the random number generator used for generating a stream of random numbers.

Returns:
  a `Random` instance.
See Also:
  `Random`

#### setRandom

    public static void setRandom​(java.util.Random random)

Sets the random number generator instance used for generating a stream of random numbers.

Parameters:
  `random` - a `Random` instance.
See Also:
  `Random`

#### resetDeterministic

    public static void resetDeterministic​(long seed)

Resets the random number generator instance to be deterministic when generating random numbers.

Parameters:
  `seed` - the seed to use for the new deterministic random generator.