Package repast.simphony.parameter
Class LongSteppedSetter
java.lang.Object
repast.simphony.parameter.AbstractSweepParameterSetter<Long>
repast.simphony.parameter.LongSteppedSetter
- All Implemented Interfaces:
OptimizableParameterSetter
,ParameterSetter
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
ConstructorDescriptionLongSteppedSetter
(String parameterName, long base, long max, long step) Constructs this with the given base value, step size, and maximum value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
atBeginning
(Long prevValue) boolean
protected Long
Retrieves the next value in the space (previous value + step size).protected Long
previousValue
(Long prevValue) protected Long
Resets the next value to the base value.toString()
Methods inherited from class repast.simphony.parameter.AbstractSweepParameterSetter
atBeginning, atEnd, getParameterName, next, previous, randDouble, randInt, random, reset, revert
-
Constructor Details
-
LongSteppedSetter
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 Details
-
resetValue
Resets the next value to the base value.- Specified by:
resetValue
in classAbstractSweepParameterSetter<Long>
-
atEnd
- Specified by:
atEnd
in classAbstractSweepParameterSetter<Long>
- Returns:
- true if the next value is greater than the max value
-
atBeginning
- Specified by:
atBeginning
in classAbstractSweepParameterSetter<Long>
-
nextValue
Retrieves the next value in the space (previous value + step size).- Specified by:
nextValue
in classAbstractSweepParameterSetter<Long>
- Returns:
- the next value
-
randomValue
- Specified by:
randomValue
in classAbstractSweepParameterSetter<Long>
-
previousValue
- Specified by:
previousValue
in classAbstractSweepParameterSetter<Long>
-
toString
-