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 in user-defined parent selection #179

Closed
pvstorageoptimization opened this issue Apr 20, 2023 · 1 comment
Closed

bug in user-defined parent selection #179

pvstorageoptimization opened this issue Apr 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pvstorageoptimization
Copy link

Hi,

There seems to be a bug when using user-defined parent selection function. The function should have 3 parameters (or 4 for a method), and that how it is checked when creating the GA instance. But when it runs the algorithm it sends 4 parameters instead of 3 (getting error "_parent_selection_func() takes 3 positional arguments but 4 were given").
As I understand this is due to an extra "self" passed to the parent selection function as a first parameter in line 1750, and removing it should fix it.

Thanks

@ahmedfgad ahmedfgad added the bug Something isn't working label Apr 20, 2023
ahmedfgad added a commit that referenced this issue Apr 20, 2023
Fix an issue with passing user-defined function/method for parent selection. #179
@ahmedfgad
Copy link
Owner

Thanks @pvstorageoptimization. The issue is solved and release 3.0.1 is created.
Please consider upgrading: pip install --upgrade pygad

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