Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, in Borg algorithm, the only stopping condition that relates to the algorithm convergence is checking for the number of steps without eps-progress (i.e. without Pareto front updates). This is quite strong condition, since for large fronts the chances of updating any point would be quite high. However, these points are not always in the most relevant region of the Pareto front.
This PR implements a weaker condition: stop when MaxRestarts is reached. The idea is that as Borg reaches near-optimal front, the efficiency of recombinations would drop, and it would tend to "restart" (i.e. repopulate with random mutants) more frequently.
By default, MaxRestarts is disabled (=nothing), but something like 200 should be a safe choice.
NB: So far the stopping checks were done by the algorithm-agnostic OptController or by the Evaluator classes. This PR allows the optimization algorithm to define its own specific stopping checks via
check_stop_condition(alg::Optimizer, ctrl)
method.