diff --git a/src/search_algoritms/helpers.py b/src/search_algoritms/helpers.py index 783cfe7..d65ac59 100644 --- a/src/search_algoritms/helpers.py +++ b/src/search_algoritms/helpers.py @@ -39,7 +39,7 @@ def get_path_actions(node: Node): def cost(field: List[List[Tile]], node): - return field[node.y][node.x].weight + return 1 if (node.parent.x, node.parent.y) == (node.x, node.y) else field[node.y][node.x].weight def calculate_priority(field: List[List[Tile]], node, goal_test: Tuple[int, int]):