Package repast.simphony.parameter
Class DoubleSteppedSetter
java.lang.Object
repast.simphony.parameter.DoubleSteppedSetter
- 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
ConstructorDescriptionDoubleSteppedSetter
(String parameterName, double base, double max, double 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.protected double
getValue()
void
next
(Parameters params) void
previous
(Parameters parameters) void
random
(Parameters parameters) void
reset
(Parameters params) void
revert
(Parameters parameters) toString()
-
Constructor Details
-
DoubleSteppedSetter
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 double getValue() -
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
-