Documentation of 'org.jgap.util.randomLEcuyer' Java class
randomLEcuyer
org.jgap.util

Class randomLEcuyer



  • public class randomLEcuyer
    extends randomX
    Implementation of a randomX-compliant class using L'Ecuyer's two-sequence generator with a Bays-Durham shuffle, as described on page 282 of Press et al., Numerical Recipes in C, 2nd edition. Their implementation was constrained by the absence of a 64-bit integer data type. Since Java guarantees a long to be 64 bit, we can use L'Ecuyer's multiplier and modulus directly, rather than flailing around with Schrage's algorithm. Further, 64-bit long arithmetic allows us to directly combine the results from the two generators by adding and taking the modulus of one of them, bypassing the subtract and test for negative gimmick used in Numerical Recipes.

    For additional details, see L'Ecuyer's original 1968 paper at page 742 of Communications of the ACM, Vol. 31.

    Designed and implemented in July 1996 by John Walker, kelvin@fourmilab.ch.

    • Constructor Detail

      • randomLEcuyer

        public randomLEcuyer()
        Creates a new pseudorandom number generator, seeded from the current time.
      • randomLEcuyer

        public randomLEcuyer(long seed)
                      throws java.lang.IllegalArgumentException
        Creates a new pseudorandom number generator with a specified nonzero seed.
        Parameters:
        seed - initial seed for the generator
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • setSeed

        public void setSeed(long seed)
                     throws java.lang.IllegalArgumentException
        Set seed for generator. Subsequent values will be based on the given nonzero seed.
        Parameters:
        seed - seed for the generator
        Throws:
        java.lang.IllegalArgumentException
      • nextByte

        public byte nextByte()
        Get next byte from generator.
        Specified by:
        nextByte in class randomX
        Returns:
        the next byte from the generator.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.