com.softsynth.jmsl.util
Class RandomWalkSequence

java.lang.Object
  extended by com.softsynth.jmsl.util.RandomSequence
      extended by 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
RandomWalkSequence()
           
 
Method Summary
 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 Detail

RandomWalkSequence

public RandomWalkSequence()
Method Detail

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.