-
Notifications
You must be signed in to change notification settings - Fork 410
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
Python typeerror #14
Comments
I'm getting the same error as well. Anyone have any idea why we're experiencing this error? |
I'm facing the same problem when i use Python3. Since error is not solved yet, you can temporary use Python2. |
Hi. There may be some python 2 / 3 issues! I wrote this in py2, I'm also pretty much only using Python 3 now. I'm happy for suggested fixes, but ideally they'd need to work with both versions otherwise we'd simply be breaking it for others. |
The issue is cause by how python 2 and 3 sort tuples of the type
Solution: Implement a comparison for Maze.Node and as we dont really care about the order it ca be as simple as:
This should be added under Node class inside the Maze class. I do not believe that this will effect the Python 2 implementation significantly. |
I don't program in Python but it seems "Node" doesn't have a method for '>' operator?
C:\Users\micha\Desktop\mazesolving-master>python solve.py -m astar perfect4k.png 4k_solve.png
Loading Image
Creating Maze
Node Count: 2865504
Time elapsed: 32.22657132148743
Starting Solve: A-star Search
Traceback (most recent call last):
File "solve.py", line 89, in
main()
File "solve.py", line 86, in main
solve(sf, args.method, args.input_file, args.output_file)
File "solve.py", line 29, in solve
[result, stats] = solver(maze)
File "C:\Users\micha\Desktop\mazesolving-master\astar.py", line 80, in solve
unvisited.insert(vnode)
File "C:\Users\micha\Desktop\mazesolving-master\priority_queue.py", line 59, in insert
heapq.heappush(self.pq, entry)
TypeError: '<' not supported between instances of 'Node' and 'Node'
The text was updated successfully, but these errors were encountered: