textbender.g.util
Class RandomX

java.lang.Object
  extended by java.util.Random
      extended by RandomX
All Implemented Interfaces:
Serializable

public final class RandomX
extends Random

Random generator extensions.

See Also:
Serialized Form

Nested Class Summary
static class RandomX.Gaussian
          A Gaussian (normal) distribution.
static class RandomX.LimitedGaussian
          A Gaussian distribution, limited by a minimum and maximum.
 
Constructor Summary
RandomX()
           
 
Method Summary
 double nextGaussian(RandomX.Gaussian distribution)
          Returns the next pseudorandom Gaussian (normal) value.
 
Methods inherited from class java.util.Random
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomX

public RandomX()
Method Detail

nextGaussian

public double nextGaussian(RandomX.Gaussian distribution)
Returns the next pseudorandom Gaussian (normal) value.

When the distribution is a LimitedGaussian, and its limits are not balanced around the mean, the actual mean may be slightly larger or smaller; because values outside of the limits are blindly clipped to fit.

Parameters:
distribution - Gaussian distribution to use