Package 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
-
Constructor Summary
Constructors Constructor Description RandomWalkSequence()
-
Method Summary
Modifier and Type Method Description int
getMaximumStep()
int
next()
Generate next value.void
setMaximumStep(int maximumStep)
Set maximum maximum step from one value to the next.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
-
Constructor Details
-
RandomWalkSequence
public RandomWalkSequence()
-
-
Method Details
-
next
public int next()Generate next value.- Specified by:
next
in interfaceSequenceGenerator
- Overrides:
next
in classRandomSequence
- 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.
-