change weight to one when agent is rotating

This commit is contained in:
matixezor 2021-04-26 16:58:00 +02:00
parent 176f14b0a3
commit 37dc6d5595

View File

@ -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]):