We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2939c6a commit 0fbcb38Copy full SHA for 0fbcb38
algorithms/a_star_path_finding.py
@@ -115,7 +115,7 @@ def process(self):
115
heapq.heappush(self.op, (self.start.f, self.start))
116
while len(self.op):
117
# pop cell from heap queue
118
- h, cell = heapq.heappop(self.op)
+ f, cell = heapq.heappop(self.op)
119
# add cell to closed list so we don't process it twice
120
self.cl.add(cell)
121
# if ending cell, display found path
@@ -126,7 +126,7 @@ def process(self):
126
adj_cells = self.get_adjacent_cells(cell)
127
for c in adj_cells:
128
if c.reachable and c not in self.cl:
129
- if c in self.op:
+ if (c.f, c) in self.op:
130
# if adj cell in open list, check if current path is
131
# better than the one previously found
132
# for this adj cell.
0 commit comments