Skip to content

Commit

Permalink
Fix bug get* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
thieu1995 committed Apr 25, 2024
1 parent 67af338 commit 7ae62ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion opfunu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_functions_based_ndim(ndim=None):
"""
functions = [cls for classname, cls in ALL_DATABASE if classname not in EXCLUDES]
if type(ndim) is int and ndim > 1:
return list(filter(lambda f: ndim in f().dim_supported, functions))
return list(filter(lambda f: (f().dim_default == ndim or f().dim_changeable == True), functions))
return functions


Expand Down
2 changes: 1 addition & 1 deletion opfunu/cec_based/cec.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self):
self.dim_changeable = True
self.dim_default = 30
self.dim_max = 100
self.dim_supported = []
self.dim_supported = None
self.f_global = None
self.x_global = None
self.n_fe = 0
Expand Down

0 comments on commit 7ae62ff

Please sign in to comment.