next up previous contents
Next: Customizing the Optimization Up: Using the EvA2 API Previous: The OptimizerFactory   Contents

Termination Criteria

To configure the termination criteria of an optimization process started through the OptimizerFactory, use the setTerminator family. The default terminator stops at a maximal number of fitness evaluations, e.g. $ 10,000$ . To change the number of evaluations performed to, for example, $ 50,000$ , call OptimizerFactory.setEvaluationTerminator(50000) before starting the optimization, as in Alg. 5.

For more flexible termination criteria, there are several Terminator parameter classes you can use and set them directly using OptimizerFactory.setTerminator(term). Available are the following variants:

A specific class of terminators checks for convergence of a population measure, such as the average distance of individuals within the population. Common to these terminators is the required definition of convergence. Generally, convergence is assumed if the measure $ m(P(t))$ has not changed more than a certain threshold $ \theta$ during a fixed time period $ t_{S}$ . The stagnation time $ t_{S}$ may either be taken as fitness calls (calls to the target function) or generations (iterations of the optimizer), however the population measure is calculated only after full generations.

The convergence threshold may either be an absolute value, a change of the absolute value compared to $ m(P(t-t_{S}))$ or a change of the relative ratio of the value $ m(P(t-t_{S}))$ . Additionally, stagnation may be determined if no decrease by more than $ \theta$ has occurred, or if no change occured (bidirectional: neither decrease nor increase by more than $ \theta$ ). In the case of bidirectional check, termination occurs if the population measure changes less than $ \theta$ for the stagnation period $ t_{S}$ : $ \forall  i\in\{0,1,...p-1\}:m(x_{t-t_{S}})-\delta\le m(x_{t-i})\le m(x_{t-t_{S}})+\delta$ , where $ m(x_{t})$ stands for the population measure of individual $ x$ at generation $ t$ . The allowed boundary $ \delta$ is given with the fixed threshold in the absolute change case ( $ \delta=\theta$ ) or calculated from $ m(x_{t-t_{S}})$ in the relative change case: $ \delta=\theta\cdot m(x_{t-t_{S}})$ . In the absolute value case, $ m(x_{t-i})$ is directly compared to $ \theta$ : $ m(x_{t-i})\leq\theta$ must hold for $ t_{S}$ iterations.

The following Terminators are based on this convergence criterion:

Some notes on terminators:

For a usage example that creates and sets a terminator which stops if either $ 20,000$ evaluations have been performed or both best fitness and phenotype stagnate for $ 1,000$ evaluations, see Listing 6. Note that ``convergence'' in this context refers to stagnation After a combined termination, one might want to know why the run actually stopped. The method terminatedBecause() implemented in OptimizerFactory as well as any terminator object will return a String object describing the exact reason, while the method lastEvalsPerformed() informs on how many evaluations were required. The PSO in the given example should require about $ 5,000-7,000$ evaluations to meet the two convergence criteria.


next up previous contents
Next: Customizing the Optimization Up: Using the EvA2 API Previous: The OptimizerFactory   Contents
Marcel Kronfeld 2011-05-05