Package repast.simphony.parameter
Class FloatSteppedSetter
java.lang.Object
repast.simphony.parameter.FloatSteppedSetter
- 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
-
Constructor Summary
ConstructorDescriptionFloatSteppedSetter
(String parameterName, float base, float max, float step) Constructs this with the given base value, step size, and maximum value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
atEnd()
Gets the name of the parameter that this setter is responsible for setting.int
getStep()
protected float
getValue()
void
next
(Parameters params) void
previous
(Parameters parameters) void
random
(Parameters parameters) void
reset
(Parameters params) void
revert
(Parameters parameters) toString()
-
Constructor Details
-
FloatSteppedSetter
Constructs this with the given base value, step size, and maximum value. This is guaranteed to produce Math.rint((max - base) / step) number of steps.- Parameters:
parameterName
- the name of the parameterbase
- the beginning valuemax
- the maximum value (inclusive)step
- the step size
-
-
Method Details
-
getParameterName
Gets the name of the parameter that this setter is responsible for setting.- Returns:
- the name of the parameter that this setter is responsible for setting.
-
next
- Specified by:
next
in interfaceParameterSetter
-
getValue
protected float getValue() -
getStep
public int getStep() -
previous
- Specified by:
previous
in interfaceOptimizableParameterSetter
-
random
- Specified by:
random
in interfaceOptimizableParameterSetter
-
atBeginning
public boolean atBeginning()- Specified by:
atBeginning
in interfaceOptimizableParameterSetter
-
atEnd
public boolean atEnd()- Specified by:
atEnd
in interfaceParameterSetter
-
toString
-
revert
- Specified by:
revert
in interfaceOptimizableParameterSetter
-
reset
- Specified by:
reset
in interfaceParameterSetter
-