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

unorderable type #3

Open
SadeghRahmaniB opened this issue Aug 3, 2017 · 2 comments
Open

unorderable type #3

SadeghRahmaniB opened this issue Aug 3, 2017 · 2 comments

Comments

@SadeghRahmaniB
Copy link

hello dear friend
i am using your code, and i thanks to you for this.
but i have an error that is related to heapify or heappush function in cvrp_advancedga.py file that error is:
"unorderable types: Solution() < Solution()"
and should i say that this error happend some time, not all the time
what should i do for solving that??

@cmanny
Copy link
Owner

cmanny commented Aug 3, 2017

Hi Dante,
Can you tell me any more information such as:

  • python version
  • how long after running the error occurs

The error suggests that the heap sorting mechanism is sorting on the Solution object rather than the cost, i.e it should always be (solution.cost, solution)

You could try to catch the error with

try:
    heapify(self.chromosomes)
except TypeError:
    print(self.chromosomes)

so that you can inspect the cause of the exception

@SadeghRahmaniB
Copy link
Author

SadeghRahmaniB commented Aug 3, 2017

first of all, thank you for your suggestion,
error solved (except one time that the same error occur for heappush)
my python version is 3.4.0
and the error occurred in different times, sometimes before any iter, sometimes after some iter and sometimes no error occurred
i appreciate for your fast reply.

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