Package repast.simphony.parameter
Class ShortSteppedSetter
- java.lang.Object
-
- repast.simphony.parameter.AbstractSweepParameterSetter<Short>
-
- repast.simphony.parameter.ShortSteppedSetter
-
- All Implemented Interfaces:
OptimizableParameterSetter
,ParameterSetter
public class ShortSteppedSetter extends AbstractSweepParameterSetter<Short>
ThisParameterSetter
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
Constructors Constructor Description ShortSteppedSetter(String parameterName, short base, short max, short step)
Constructs this with the given base value, step size, and maximum value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
atBeginning(Short prevValue)
boolean
atEnd(Short prevValue)
protected Short
nextValue(Short prevValue)
Retrieves the next value in the space (previous value + step size).protected Short
previousValue(Short prevValue)
protected Short
randomValue()
Short
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
-
-
-
-
Constructor Detail
-
ShortSteppedSetter
public ShortSteppedSetter(String parameterName, short base, short max, short step)
Constructs this with the given base value, step size, and maximum value.- Parameters:
parameterName
- the name of the parameterbase
- the beginning valuemax
- the maximum value (inclusive)step
- the step size
-
-
Method Detail
-
resetValue
public Short resetValue()
Resets the next value to the base value.- Specified by:
resetValue
in classAbstractSweepParameterSetter<Short>
-
atEnd
public boolean atEnd(Short prevValue)
- Specified by:
atEnd
in classAbstractSweepParameterSetter<Short>
- Returns:
- true if the next value is greater than the max value
-
atBeginning
public boolean atBeginning(Short prevValue)
- Specified by:
atBeginning
in classAbstractSweepParameterSetter<Short>
-
nextValue
protected Short nextValue(Short prevValue)
Retrieves the next value in the space (previous value + step size).- Specified by:
nextValue
in classAbstractSweepParameterSetter<Short>
- Returns:
- the next value
-
randomValue
protected Short randomValue()
- Specified by:
randomValue
in classAbstractSweepParameterSetter<Short>
-
previousValue
protected Short previousValue(Short prevValue)
- Specified by:
previousValue
in classAbstractSweepParameterSetter<Short>
-
-