1

In pymoo, the following termination criteria exist for single objective optimization (docs):

termination = SingleObjectiveDefaultTermination(
    x_tol=1e-8,
    cv_tol=1e-6,
    f_tol=1e-6,
    nth_gen=5,
    n_last=20,
    n_max_gen=1000,
    n_max_evals=100000
)

However, I want to stop the algorithm not when some f_tol has been reached, but rather when some f_treshold has been reached. So once my best fitness value reaches this value, I want the iteration to stop. However, there does not seem to be an option for this. Are there any work-arounds?

Thomas Wagenaar
  • 6,489
  • 5
  • 30
  • 73
  • I managed to create a custom termination class which inherits from `pymoo.core.termination.Termination`. Defining the 2 required methods worked! See [docu](https://pymoo.org/api/model.html?highlight=termination#pymoo.core.termination.Termination) – JJ. Jul 11 '22 at 07:28

1 Answers1

0

Did you try to specify your f_threshold value into the objective expression? I am not sure if it's the right way to handle this, but you may try to minimize the following:

objective = f_threshold - your_expression
furious_bilbo
  • 176
  • 11