Implementing the Reception of the New Measures

  1. Reading input arguments for the increment value and the number of iteration
  2. Registering the variables to increment
  3. Registering the targets to have in the report
  4. Implementing the incrementation of the variables
  5. Implementing the reception of the new measures
  6. Implementing the check to finish the iteration loop
  7. Outputting a report file

Here, you need to set the new value of the target and save them to create the report.

// list of the values for each iteration
private IList<IDictionary<string,double>> _iterationResults = new List<IDictionary<string,double>>();

/// ....

/// <summary>
///     Callback called upon ending an iteration   (optional)
/// </summary>
/// <param name="iteration">the iteration that is ending</param>
public void EndIteration(int iteration)
{
    // copying the list of values for this iteration
    _iterationResults.Add(_targetValues.ToDictionary(entry => entry.Key, entry => entry.Value));
}

/// ....

/// <summary>
///     Callback called after the simulation's update to update the values of the targets
/// </summary>
/// <param name="parameterId"></param>
/// <param name="value"></param>
public void SetMeasures(string parameterId, double value)
{
    _targetValues[parameterId] = value;
}