zmiany na potrzebe prezentacji. Wykrywanie trasy przez półki

This commit is contained in:
tonywesoly 2022-04-29 08:59:52 +02:00
parent e8dfdfda68
commit 676b9c49c5

View File

@ -51,7 +51,8 @@ class Node:
if self.walkable:
return self.g_cost + self.h_cost
else:
return math.inf
return 0
# return math.inf
class Pathfinding:
@ -107,7 +108,8 @@ class Pathfinding:
self.path = path
for neighbour in self.succ(current_node):
if not neighbour.walkable or neighbour in explored:
# if not neighbour.walkable or neighbour in explored:
if neighbour in explored:
continue
new_movement_cost_to_neighbour = current_node.g_cost + self.get_distance(current_node,neighbour)
if new_movement_cost_to_neighbour < neighbour.g_cost or not neighbour in fringe: