cilib/cilib — pull request #31 by filinep (2012-04-02 09:57:52+00:00)
Title: Fixed stopping conditions and removed updateParameter form control parameters.

The control parameters had an updateParameter method which only updated the parameters when the method was called. This resulted in a number of control parameters not being updated because that method was never called. The updateParameters method is now removed and the parameters update themselves whenever the getParameter method is called. An implication of this is that controlParameters do not get updated only once per iteration so an UpdateOnIterationControlParameter is introduced for this purpose.

Another aspect related to the control parameters is the stopping conditions. A few of the control parameters rely on the percent complete of an algorithm which is calculated using the stopping conditions. Depending on certain combinations of stopping conditions it was possible that the percent completion of an algorithm could decrease. The changes made ensure that this cannot happen. The changes also generalize the stopping conditions to use an numeric Measurement as a stopping condition. The classes are:
- MeasuredStoppingCondition which takes in a Measurement, a CompletionCalculator and a value.
CompletionCalculator is either Maximum or Minimum (in the stoppingconditions package) which are used to calculate the percentComplete depending on whether the Measurement is increasing or decreasing.

-MaintainedStoppingCondition which takes in another StoppingCondition and the number of iterations the condition must hold for the algorithm to be considered complete.

The stopping conditions aspect of the algorithms is still not 100% but these changes should suffice until a better method can be implemented.