Package repast.simphony.parameter
Class IntSteppedSetter
- java.lang.Object
-
- repast.simphony.parameter.AbstractSweepParameterSetter<Integer>
-
- repast.simphony.parameter.IntSteppedSetter
-
- All Implemented Interfaces:
OptimizableParameterSetter
,ParameterSetter
public class IntSteppedSetter extends AbstractSweepParameterSetter<Integer>
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 IntSteppedSetter(String parameterName, int base, int max, int 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(Integer prevValue)
boolean
atEnd(Integer prevValue)
protected Integer
nextValue(Integer prevValue)
Retrieves the next value in the space (previous value + step size).protected Integer
previousValue(Integer prevValue)
protected Integer
randomValue()
Integer
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
-
IntSteppedSetter
public IntSteppedSetter(String parameterName, int base, int max, int 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 Integer resetValue()
Resets the next value to the base value.- Specified by:
resetValue
in classAbstractSweepParameterSetter<Integer>
-
atEnd
public boolean atEnd(Integer prevValue)
- Specified by:
atEnd
in classAbstractSweepParameterSetter<Integer>
- Returns:
- true if the next value is greater than the max value
-
atBeginning
public boolean atBeginning(Integer prevValue)
- Specified by:
atBeginning
in classAbstractSweepParameterSetter<Integer>
-
nextValue
protected Integer nextValue(Integer prevValue)
Retrieves the next value in the space (previous value + step size).- Specified by:
nextValue
in classAbstractSweepParameterSetter<Integer>
- Returns:
- the next value
-
randomValue
protected Integer randomValue()
- Specified by:
randomValue
in classAbstractSweepParameterSetter<Integer>
-
previousValue
protected Integer previousValue(Integer prevValue)
- Specified by:
previousValue
in classAbstractSweepParameterSetter<Integer>
-
-