Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Dolan function has wrong default dimensionality #27

Closed
mpvanderschelling opened this issue Feb 8, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@mpvanderschelling
Copy link

Description of the bug

The default dimensionality of the Dolan function is 2, but the function is only defined for a dimensionality of 5
Also the dim_interchangeable=True, but this should be False

Steps To Reproduce

g = opfunu.name_based.d_func.Dolan(ndim=None)
x = np.random.rand(g.ndim)
g.evaluate(x)

Gives

[476](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/GitHub/opfunu/notebooks/~/Documents/GitHub/opfunu/opfunu/name_based/d_func.py:476) self.check_solution(x)
    [477](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/GitHub/opfunu/notebooks/~/Documents/GitHub/opfunu/opfunu/name_based/d_func.py:477) self.n_fe += 1
--> [478](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/GitHub/opfunu/notebooks/~/Documents/GitHub/opfunu/opfunu/name_based/d_func.py:478) return (abs((x[0] + 1.7 * x[1]) * np.sin(x[0]) - 1.5 * x[2]
    [479](https://file+.vscode-resource.vscode-cdn.net/home/martin/Documents/GitHub/opfunu/notebooks/~/Documents/GitHub/opfunu/opfunu/name_based/d_func.py:479)             - 0.1 * x[3] * np.cos(x[3] + x[4] - x[0]) + 0.2 * x[4] ** 2 - x[1] - 1))

IndexError: index 2 is out of bounds for axis 0 with size 2

Additional Information

No response

@mpvanderschelling mpvanderschelling added the bug Something isn't working label Feb 8, 2024
@thieu1995
Copy link
Owner

@mpvanderschelling,

Thank you, this problem has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants