Module m3DCS

Class SeedGenerator

java.lang.Object
de.grogra.blocks.arrangeBlock.SeedGenerator
All Implemented Interfaces:
DiscreteGenerator, Seedable

public class SeedGenerator extends Object implements DiscreteGenerator
A SeedGenerator is a DiscreteGenerator which produces well-spaced seeds according to its spacing attribute. It relies on a RandomGenerator
  • Constructor Details

    • SeedGenerator

      public SeedGenerator()
    • SeedGenerator

      public SeedGenerator(long seed, int spacing)
  • Method Details

    • setSeed

      public void setSeed(long seed)
      Description copied from interface: Seedable
      Set the random number generator's seed.
      Specified by:
      setSeed in interface Seedable
      Parameters:
      seed - The new seed for the generator
    • getSeed

      public long getSeed()
      Description copied from interface: Seedable
      Get the random number generator's seed.
      Specified by:
      getSeed in interface Seedable
      Returns:
      The generator's seed
    • reseed

      public void reseed()
      Description copied from interface: Seedable
      Get another seed well-spaced (from the default SeedGenerator)
      Specified by:
      reseed in interface Seedable
    • sample

      public long sample()
      Specified by:
      sample in interface DiscreteGenerator