Package repast.simphony.parameter
Class FloatSteppedSetter
- java.lang.Object
-
- repast.simphony.parameter.FloatSteppedSetter
-
- All Implemented Interfaces:
OptimizableParameterSetter
,ParameterSetter
public class FloatSteppedSetter extends Object implements OptimizableParameterSetter
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
-
-
Constructor Summary
Constructors Constructor Description FloatSteppedSetter(String parameterName, float base, float max, float 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()
boolean
atEnd()
String
getParameterName()
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)
String
toString()
-
-
-
Constructor Detail
-
FloatSteppedSetter
public FloatSteppedSetter(String parameterName, float base, float max, float step)
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 Detail
-
getParameterName
public String 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
public void next(Parameters params)
- Specified by:
next
in interfaceParameterSetter
-
getValue
protected float getValue()
-
getStep
public int getStep()
-
previous
public void previous(Parameters parameters)
- Specified by:
previous
in interfaceOptimizableParameterSetter
-
random
public void random(Parameters parameters)
- Specified by:
random
in interfaceOptimizableParameterSetter
-
atBeginning
public boolean atBeginning()
- Specified by:
atBeginning
in interfaceOptimizableParameterSetter
-
atEnd
public boolean atEnd()
- Specified by:
atEnd
in interfaceParameterSetter
-
revert
public void revert(Parameters parameters)
- Specified by:
revert
in interfaceOptimizableParameterSetter
-
reset
public void reset(Parameters params)
- Specified by:
reset
in interfaceParameterSetter
-
-