diff --git a/mazes.py b/mazes.py index adf72fb..6076fc6 100644 --- a/mazes.py +++ b/mazes.py @@ -5,6 +5,9 @@ def __init__(self, position): self.Neighbours = [None, None, None, None] #self.Weights = [0, 0, 0, 0] + def __lt__(self, other): + return True + def __init__(self, im): width = im.size[0] diff --git a/priority_queue.py b/priority_queue.py index 763edbb..01818c6 100644 --- a/priority_queue.py +++ b/priority_queue.py @@ -4,7 +4,7 @@ from FibonacciHeap import FibHeap import heapq -import Queue +import queue class PriorityQueue(): __metaclass__ = ABCMeta @@ -88,7 +88,7 @@ def decreasekey(self, node, new_priority): class QueuePQ(PriorityQueue): def __init__(self): - self.pq = Queue.PriorityQueue() + self.pq = queue.PriorityQueue() self.removed = set() self.count = 0 diff --git a/profile.py b/profile_all.py similarity index 98% rename from profile.py rename to profile_all.py index 62cf7a1..b91f2a6 100644 --- a/profile.py +++ b/profile_all.py @@ -32,7 +32,7 @@ def profile(): for m in methods: for i in inputs: with tempfile.NamedTemporaryFile(suffix='.png') as tmp: - solve(SolverFactory(), m, "examples/%s.png" % i, tmp.name) + solve(SolverFactory(), m, "examples/%s.png" % i, tmp) profiler = BProfile('profiler.png') with profiler: