Package repast.simphony.parameter
Class AbstractSweepParameterSetter<T>
java.lang.Object
repast.simphony.parameter.AbstractSweepParameterSetter<T>
- All Implemented Interfaces:
OptimizableParameterSetter,ParameterSetter
- Direct Known Subclasses:
ByteSteppedSetter,IntSteppedSetter,ListParameterSetter,LongSteppedSetter,ShortSteppedSetter
public abstract class AbstractSweepParameterSetter<T>
extends Object
implements OptimizableParameterSetter
An abstract
ParameterSetter that is meant to dealt with only one
parameter (hence the parameterName value it contains). This handles setting the parameter and the
case where it is next'd when it is already finished (it returns the last value it had.
TODO: rename this class- Author:
- Jerry Vos
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSweepParameterSetter(String parameterName) Constructs this with the given name to store its parameters to. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected abstract booleanatBeginning(T prevValue) booleanatEnd()protected abstract booleanGets the name of the parameter that this setter is responsible for setting.voidnext(Parameters params) If the object has finished its space this will set the parameter to the last value it generaetd, otherwise it will set it to the value returned by#nextValue().protected abstract TRetrieves the next value for the parameter.voidprevious(Parameters parameters) protected abstract TpreviousValue(T prevValue) protected doublerandDouble(double from, double to) protected intrandInt(int from, int to) voidrandom(Parameters parameters) protected abstract Tvoidreset(Parameters params) protected abstract Tvoidrevert(Parameters params)
-
Field Details
-
RESET_INDEX
public static final int RESET_INDEX- See Also:
-
LAST_VALUE_INDEX
public static final int LAST_VALUE_INDEX- See Also:
-
parameterName
-
lastValue
-
revertValue
-
-
Constructor Details
-
AbstractSweepParameterSetter
Constructs this with the given name to store its parameters to.- Parameters:
parameterName- the name of the parameter
-
-
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
If the object has finished its space this will set the parameter to the last value it generaetd, otherwise it will set it to the value returned by#nextValue().- Specified by:
nextin interfaceParameterSetter- Parameters:
params- the parameter object values will be stored in
-
previous
- Specified by:
previousin interfaceOptimizableParameterSetter
-
random
- Specified by:
randomin interfaceOptimizableParameterSetter
-
nextValue
Retrieves the next value for the parameter. This will not be called when the space is finished.- Returns:
- the next parameter value
-
randomValue
-
previousValue
-
resetValue
-
atEnd
-
atBeginning
-
atBeginning
public boolean atBeginning()- Specified by:
atBeginningin interfaceOptimizableParameterSetter
-
atEnd
public boolean atEnd()- Specified by:
atEndin interfaceParameterSetter
-
reset
- Specified by:
resetin interfaceParameterSetter
-
randDouble
protected double randDouble(double from, double to) -
randInt
protected int randInt(int from, int to) -
revert
- Specified by:
revertin interfaceOptimizableParameterSetter
-