Skip to content

Commit

Permalink
Update optimizer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Evolutionary-Intelligence authored Jan 20, 2025
1 parent d71e2b1 commit 42d586c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pypop7/optimizers/core/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@


class Terminations(IntEnum):
"""Helper class used by all optimizer classes."""
"""Helper class used by all black-box optimizers.
Four different termination conditions are considered for all optimizers, as below:
* MAX_FUNCTION_EVALUATIONS
* MAX_RUNTIME
* FITNESS_THRESHOLD
* EARLY_STOPPING
"""
NO_TERMINATION = 0
MAX_FUNCTION_EVALUATIONS = 1 # maximum of function evaluations
MAX_RUNTIME = 2 # maximal runtime to be allowed
FITNESS_THRESHOLD = 3 # when the best-so-far fitness is below fitness threshold, the optimizer will stop
EARLY_STOPPING = 4 # when the best-so-far fitness does not improve for a long time, the optimizer will stop
FITNESS_THRESHOLD = 3 # when best-so-far fitness is below threshold
EARLY_STOPPING = 4 # when best-so-far fitness does not improve for a long time


class Optimizer(object):
Expand Down

0 comments on commit 42d586c

Please sign in to comment.