Documentation of 'org.spaceroots.mantissa.random.FourTapRandom' Java class
FourTapRandom
org.spaceroots.mantissa.random

Class FourTapRandom

  • All Implemented Interfaces:
    java.io.Serializable


    public class FourTapRandom
    extends java.util.Random
    This class implements a powerful pseudo-random number generator studied by Robert M Ziff.

    This generator belongs to the family of Generalized Feedback Shift-Register (GFSR) generators, but uses four feedback taps instead of two, thus greatly improving their quality for Monte-Carlo simulations.

    This generator is described in a paper by Robert M. Ziff in 1997: Four-tap shift-register-sequence random-number generators, it is generator 9f (defined as R(471, 1586, 6988, 9689)) of the paper. It has been kindly contributed to mantissa by Bill Maier.

    The class is implemented as a specialization of the standard java.util.Random class. This allows to use it in algorithms expecting a standard random generator, and hence benefit from a better generator without code change.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      FourTapRandom()
      Creates a new random number generator.
      FourTapRandom(long seed)
      Creates a new random number generator using a single long seed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void setSeed(long seed)
      Reinitialize the generator as if just built with the given seed.
      • Methods inherited from class java.util.Random

        doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FourTapRandom

        public FourTapRandom()
        Creates a new random number generator.

        The instance is initialized using the current time as the seed.

      • FourTapRandom

        public FourTapRandom(long seed)
        Creates a new random number generator using a single long seed.
        Parameters:
        seed - the initial seed
    • Method Detail

      • setSeed

        public void setSeed(long seed)
        Reinitialize the generator as if just built with the given seed.

        The state of the generator is exactly the same as a new generator built with the same seed.

        Overrides:
        setSeed in class java.util.Random
        Parameters:
        seed - the initial seed

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.