The final dependency that must be satisfied in order to create an evolution engine
is the random number generator (RNG). An evolution engine has a single RNG that it
passes to its candidate factory, evolutionary operator and selection strategy.
An ideal RNG is both fast and statistically random. We could
use the standard Java RNG, java.util.Random
, but its output
is not as random as it should be. The other RNG in the standard library,
java.security.SecureRandom
is much better in this respect
but can be slow.
Fortunately, the Watchmaker Framework provides alternatives. The
org.uncommons.maths.random.MersenneTwisterRNG
random number
generator is both fast and statistically sound. It is usually the best choice
when creating an evolution engine.