Package repast.simphony.parameter
Class ListParameterSetter<T>
java.lang.Object
repast.simphony.parameter.AbstractSweepParameterSetter<T>
repast.simphony.parameter.ListParameterSetter<T>
- All Implemented Interfaces:
OptimizableParameterSetter
,ParameterSetter
An initializer that will go through a list of parameters.
- Author:
- Jerry Vos
-
Field Summary
Fields inherited from class repast.simphony.parameter.AbstractSweepParameterSetter
LAST_VALUE_INDEX, lastValue, parameterName, RESET_INDEX, revertValue
-
Constructor Summary
ConstructorDescriptionListParameterSetter
(String parameterName, T[] list) Constructs this with the specified parameter name (where the parameter will be stored) and iterating through the given parameter list. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected boolean
atBeginning
(T prevValue) boolean
atEnd()
Compares the index to the number of elements in the list/protected boolean
protected T
Fetches the next element in the list and increments the index.protected T
previousValue
(T prevValue) protected T
void
reset
(Parameters params) Resets the index of the parameters to the next value.protected T
void
revert
(Parameters params) toString()
Methods inherited from class repast.simphony.parameter.AbstractSweepParameterSetter
getParameterName, next, previous, randDouble, randInt, random
-
Constructor Details
-
ListParameterSetter
Constructs this with the specified parameter name (where the parameter will be stored) and iterating through the given parameter list.- Parameters:
parameterName
- the name of the parameter values will be stored inlist
- the list of values to go through
-
-
Method Details
-
reset
Resets the index of the parameters to the next value.- Specified by:
reset
in interfaceParameterSetter
- Overrides:
reset
in classAbstractSweepParameterSetter<T>
-
atEnd
public boolean atEnd()Compares the index to the number of elements in the list/- Specified by:
atEnd
in interfaceParameterSetter
- Overrides:
atEnd
in classAbstractSweepParameterSetter<T>
- Returns:
- true if the list's index is greater than the list's length
-
nextValue
Fetches the next element in the list and increments the index.- Specified by:
nextValue
in classAbstractSweepParameterSetter<T>
- Returns:
- the next element in the list
-
revert
- Specified by:
revert
in interfaceOptimizableParameterSetter
- Overrides:
revert
in classAbstractSweepParameterSetter<T>
-
atBeginning
public boolean atBeginning()- Specified by:
atBeginning
in interfaceOptimizableParameterSetter
- Overrides:
atBeginning
in classAbstractSweepParameterSetter<T>
-
previousValue
- Specified by:
previousValue
in classAbstractSweepParameterSetter<T>
-
randomValue
- Specified by:
randomValue
in classAbstractSweepParameterSetter<T>
-
resetValue
- Specified by:
resetValue
in classAbstractSweepParameterSetter<T>
-
atEnd
- Specified by:
atEnd
in classAbstractSweepParameterSetter<T>
-
atBeginning
- Specified by:
atBeginning
in classAbstractSweepParameterSetter<T>
-
toString
-