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 24, 2025
1 parent d72e29e commit b80277f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pypop7/optimizers/core/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ def __init__(self, problem, options):
self.fitness_function = problem.get('fitness_function') # to be *minimized*
self.ndim_problem = problem.get('ndim_problem') # number of problem dimensionality
assert self.ndim_problem > 0
self.upper_boundary = problem.get('upper_boundary')
self.lower_boundary = problem.get('lower_boundary')
# mainly for the initialization process
self.upper_boundary = problem.get('upper_boundary') # upper boundary of search range
self.lower_boundary = problem.get('lower_boundary') # lower boundary of search range
# only for the initialization process
self.initial_upper_boundary = problem.get('initial_upper_boundary', self.upper_boundary)
self.initial_lower_boundary = problem.get('initial_lower_boundary', self.lower_boundary)
self.problem_name = problem.get('problem_name')
# mainly for the printing purpose
self.problem_name = problem.get('problem_name') # should be of data type `str`
if (self.problem_name is None) and hasattr(self.fitness_function, '__name__'):
self.problem_name = self.fitness_function.__name__

Expand Down

0 comments on commit b80277f

Please sign in to comment.