repast.simphony.parameter
Class LongSteppedSetter

java.lang.Object
  extended by repast.simphony.parameter.AbstractSweepParameterSetter<Long>
      extended by repast.simphony.parameter.LongSteppedSetter
All Implemented Interfaces:
OptimizableParameterSetter, ParameterSetter

public class LongSteppedSetter
extends AbstractSweepParameterSetter<Long>

This ParameterSetter will run through a space of numbers. The space is from the given base value through the given maximum value (including both: [base, max]). This space is traversed using the given step value.

Author:
Jerry Vos

Field Summary
 
Fields inherited from class repast.simphony.parameter.AbstractSweepParameterSetter
LAST_VALUE_INDEX, lastValue, parameterName, RESET_INDEX, revertValue
 
Constructor Summary
LongSteppedSetter(String parameterName, long base, long max, long step)
          Constructs this with the given base value, step size, and maximum value.
 
Method Summary
 boolean atBeginning(Long prevValue)
           
 boolean atEnd(Long prevValue)
           
protected  Long nextValue(Long prevValue)
          Retrieves the next value in the space (previous value + step size).
protected  Long previousValue(Long prevValue)
           
protected  Long randomValue()
           
 Long resetValue()
          Resets the next value to the base value.
 String toString()
           
 
Methods inherited from class repast.simphony.parameter.AbstractSweepParameterSetter
atBeginning, atEnd, getParameterName, next, previous, randDouble, randInt, random, reset, revert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongSteppedSetter

public LongSteppedSetter(String parameterName,
                         long base,
                         long max,
                         long step)
Constructs this with the given base value, step size, and maximum value.

Parameters:
parameterName - the name of the parameter
base - the beginning value
max - the maximum value (inclusive)
step - the step size
Method Detail

resetValue

public Long resetValue()
Resets the next value to the base value.

Specified by:
resetValue in class AbstractSweepParameterSetter<Long>

atEnd

public boolean atEnd(Long prevValue)
Specified by:
atEnd in class AbstractSweepParameterSetter<Long>
Returns:
true if the next value is greater than the max value

atBeginning

public boolean atBeginning(Long prevValue)
Specified by:
atBeginning in class AbstractSweepParameterSetter<Long>

nextValue

protected Long nextValue(Long prevValue)
Retrieves the next value in the space (previous value + step size).

Specified by:
nextValue in class AbstractSweepParameterSetter<Long>
Returns:
the next value

randomValue

protected Long randomValue()
Specified by:
randomValue in class AbstractSweepParameterSetter<Long>

previousValue

protected Long previousValue(Long prevValue)
Specified by:
previousValue in class AbstractSweepParameterSetter<Long>

toString

public String toString()
Overrides:
toString in class Object