Implementing the Incrementation of the Variables
- Reading input arguments for the increment value and the number of iteration
- Registering the variables to increment
- Registering the targets to have in the report
- Implementing the incrementation of the variables
- Implementing the reception of the new measures
- Implementing the check to finish the iteration loop
- Outputting a report file
At the beginning of the iteration (in the StartIteration()
method) you modify the value in the _variableValues
dictionary.
Then, you need to return this value for the parameter id when the asked with the GetNewValue()
method.
/// <summary>
/// Callback called upon starting a new iteration in the optimization loop
/// </summary>
/// <param name="iteration">the iteration that is starting</param>
/// <returns> whether we should continue on this iteration or not</returns>
public bool StartIteration(int iteration)
{
foreach(var key in _variableValues.Keys)
{
_variableValues[key] = _variableValues[key] + _incrementValue;
}
return true; // we want to continue looping on this iteration
}
// ....
/// <summary>
/// Called to return the new value to set for this parameter
/// </summary>
public double GetNewValue(string parameterId)
{
return _variableValues[parameterId];
}