change weight to one when agent is rotating
This commit is contained in:
parent
176f14b0a3
commit
37dc6d5595
@ -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]):
|
||||
|
Loading…
Reference in New Issue
Block a user