public class DoubleReuseRandom
An extension of java.util.Random that builds a list of random doubles
and then serves up the random values from the array, returning to the beginning
when the end is reached. This class
Only nextDouble() will return these repeated sequences of random numbers. All
other types should work according to the java.util.Random implementation.
This class can be helpful when a program is experiencing slowdown from
frequently calling Random.nextDouble(). This class decreases the mathematical
purity of the random number sequence (as the sequence is reused).
1) make sure the length of the array is different from the number of iterations
of other loops in the program. This will help avoid situations where the same
numbers are used in the same context of the loop.
2) make the length of the array large enough to guarantee sufficient coverage
of the random number sequence (an array of length 10 would likely have gaps
in the range of numbers)