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

error on crowding_distance_assignment #1

Open
fps7806 opened this issue Mar 9, 2018 · 2 comments
Open

error on crowding_distance_assignment #1

fps7806 opened this issue Mar 9, 2018 · 2 comments

Comments

@fps7806
Copy link

fps7806 commented Mar 9, 2018

The very last line of the nsga2.py file has:
front[i].distance += (front[i + 1].distance - front[i - 1].distance)

which should probably be:
front[i].distance += (front[i + 1].objectives[obj_index] - front[i - 1].objectives[obj_index])

The error disables the density estimation portion of the algorithm (by setting all distances to inf/-inf/nan).

I know it's an old repo but would be good to let people know in case they stumble upon this like I did :)

@jamiebull1
Copy link
Owner

@fps7806 happy to accept a pull request. I just rescued this code from Google Code when it was shutting down so have little to no idea about it. However I'm sure there are other, actually maintained python implementations out there that might be better option.

For example:
https://pypi.python.org/pypi/ecspy (package including NSGA-ii)
https://github.com/haris989/NSGA-II (implementation with MIT licence)
https://github.com/wreszelewski/nsga2 (no explicit licence so probably best avoided)

@fps7806
Copy link
Author

fps7806 commented Mar 9, 2018

Funny enough, https://github.com/wreszelewski/nsga2 was the first one I found on GitHub. And also has this bug: wreszelewski/nsga2#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants