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
ConstructorsConstructorDescriptionListParameterSetter(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 TypeMethodDescriptionbooleanprotected booleanatBeginning(T prevValue) booleanatEnd()Compares the index to the number of elements in the list/protected booleanprotected TFetches the next element in the list and increments the index.protected TpreviousValue(T prevValue) protected Tvoidreset(Parameters params) Resets the index of the parameters to the next value.protected Tvoidrevert(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:
resetin interfaceParameterSetter- Overrides:
resetin classAbstractSweepParameterSetter<T>
-
atEnd
public boolean atEnd()Compares the index to the number of elements in the list/- Specified by:
atEndin interfaceParameterSetter- Overrides:
atEndin 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:
nextValuein classAbstractSweepParameterSetter<T>- Returns:
- the next element in the list
-
revert
- Specified by:
revertin interfaceOptimizableParameterSetter- Overrides:
revertin classAbstractSweepParameterSetter<T>
-
atBeginning
public boolean atBeginning()- Specified by:
atBeginningin interfaceOptimizableParameterSetter- Overrides:
atBeginningin classAbstractSweepParameterSetter<T>
-
previousValue
- Specified by:
previousValuein classAbstractSweepParameterSetter<T>
-
randomValue
- Specified by:
randomValuein classAbstractSweepParameterSetter<T>
-
resetValue
- Specified by:
resetValuein classAbstractSweepParameterSetter<T>
-
atEnd
- Specified by:
atEndin classAbstractSweepParameterSetter<T>
-
atBeginning
- Specified by:
atBeginningin classAbstractSweepParameterSetter<T>
-
toString
-