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.
. To change the number of evaluations performed to, for example,
, 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:

- [
`EvaluationTerminator`:] Construct with a maximal number of evaluations. Parameters:- [
`maxEval`:] integer number of evaluations to be performed at maximum.

- [
- [
`GenerationTerminator`:] Terminate after a given number of generations. As not all algorithms use constant population sizes, we suggest to use EvaluationTerminator preferably. Parameters:- [
`gens`:] integer number of generations to be performed at maximum.

- [
- [
`FitnessValueTerminator`:] A minimum fitness value (vector) must be reached to terminate. Construct with a double array representing the target fitness value. Parameters:- [
`v`:] double array fitness vector to be reached.

- [
- [
`CombinedTerminator`:] For effective optimization, one might want to combine several criteria in a boolean way, i.e. terminate if evaluations have been performed OR the best fitness doesn't change for evaluations. To allow for this, we provide the`CombinedTerminator`class which just takes to terminator instances and combines them logically. Thus, terminators can be nested as required. Parameters:- [
`t1`:] First terminator to combine. - [
`t2`:] Second terminator to combine. - [
`bAnd`:] Boolean flag indicating whether to use conjunctive (AND, for bAnd == true) or disjunctive (OR, for bAnd == false) combination.

- [

The convergence threshold may either be an absolute value, a change
of the absolute value compared to
or a change of
the relative ratio of the value
. Additionally, stagnation
may be determined if no decrease by more than `
` has
occurred, or if no change occured (bidirectional: neither decrease
nor increase by more than `
`). In the case of bidirectional
check, termination occurs if the population measure changes less than
*
* for the stagnation period *
*:
,
where
stands for the population measure of individual
at generation
. The allowed boundary
is given with
the fixed threshold in the absolute change case (
)
or calculated from
in the relative change case:
. In the absolute value case,
is directly compared to
:
must hold for
iterations.

The following Terminators are based on this convergence criterion:

- [
`FitnessConvergenceTerminator`:] Terminate as soon as there is hardly any improvement (or change) in the fitness of the best individual for a certain period of time. In a multi-objective case, the 2-norm of the fitness vector is calculated (however a pareto metric should be prefered in these cases). Parameters:- [
`checkType`:] check for decrease only of the measure or bidirectional change, where the measure may not leave in both directions to determine stagnation. - [
`convergenceCondition`:] check for relative change, absolute change or absolute value reached along the stagnation time. - [
`convergenceThreshold`:] double valued fitness threshold*.* - [
`stagnationMeasure`:] interprete the stagnation time as number of function calls or generations. - [
`stagnationTime`:] integer length of the stagnation time.

- [
- [
`PhenotypeConvergenceTerminator`:] In analogy to the`FitnessConvergenceTerminator`, terminate as soon as there is hardly any change in the best phenotype, meaning that for the best indiviual . Parameters: see`FitnessConvergenceTerminator`. - [
`DiversityTerminator`:] Terminate as soon as the average/minimal/maximal distance of individuals in the population stagnates. Thus, calculates distances on all individuals in at every iteration, which may be time-consuming. Parameters: see`FitnessConvergenceTerminator`, with additions:- [
`criterion`:] Check the minimal, maximal or average distance as diversity measure on . - [
`metric`:] The metric to use for distance calculation.

- [
- [
`ParetoMetricTerminator:`] Terminate if the Pareto front of a multi-objective optimization problem stagnates. To measure progress on pareto fronts, several metrics can be used. Note that this only works with multi-objective problem instances. Parameters: see`FitnessConvergenceTerminator`, with additions:- [
`paretoMetric`:] The metric to use to measure change of the Pareto front. - [
`useCurrentPop`:] Apply the measure to the current population or the current Pareto front stored by the optimizer.

- [

- Note that the termination criterion is always checked after one iteration, i.e. one generation. This means that, if the number of evaluations is not a multiple of the population size or the population size is variable, the maximum number of evaluations may be slightly exceeded. The same holds for the stagnation time in convergence terminators.
- Concerning convergence terminators: Note that for flat plateaus in fitness space, the fitness may hardly change while there is still progress in the solution space. On the other hand, note that highly nonlinear problems may hardly change in phenotype but still change considerably in fitness. When using convergence terminators, we suggest to set the stagnation period sufficiently high. Also, take care when checking for relative convergence with measures tending towards zero, since relative fluctuations with very small values may be high without showing real progress.