com.softsynth.jmsl.util
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
Methods inherited from class com.softsynth.jmsl.util.RandomSequence |
choose, getMaximum, getMinimum, getNext, getSeed, randomize, reset, setMaximum, setMinimum, setNext, setSeed |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomWalkSequence
public RandomWalkSequence()
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.