Class RandomWalkSequence

java.lang.Object
com.softsynth.jmsl.util.RandomSequence
com.softsynth.jmsl.util.RandomWalkSequence
All Implemented Interfaces:
SequenceGenerator

public class RandomWalkSequence
extends RandomSequence
Generate pseudo-random sequence of integers within a given inclusive range. Next value is a random offset from the previous value. By setting the seed, one can regenerate a prior sequence.
Author:
Phil Burk and Nick Didkovsky
  • Constructor Details

    • RandomWalkSequence

      public RandomWalkSequence()
  • Method Details

    • next

      public int next()
      Generate next value.
      Specified by:
      next in interface SequenceGenerator
      Overrides:
      next in class RandomSequence
      Returns:
      next value in sequence.
    • getMaximumStep

      public int getMaximumStep()
      Returns:
      maximum step from one value to the next.
    • setMaximumStep

      public void setMaximumStep​(int maximumStep)
      Set maximum maximum step from one value to the next.