From 9d9c1aaa4c2a09ffc4135d13143f87e9fbeb35d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksymilian=20Miko=C5=82ajczak?= Date: Fri, 5 May 2023 12:13:47 +0200 Subject: [PATCH] optimalized astar --- astar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astar.py b/astar.py index 834c2ee..2b30eaf 100644 --- a/astar.py +++ b/astar.py @@ -17,9 +17,9 @@ def astar(istate, goalx, goaly, passedFields): return steps element = successors(state, passedFields, goalx, goaly) - explored.add((state.xpos, state.ypos, state.orientation, state.priority)) + explored.add((state.xpos, state.ypos, state.orientation)) for value in element: - val = (value.xpos, value.ypos, value.orientation, value.priority) + val = (value.xpos, value.ypos, value.orientation) if val in explored: continue cost = state.priority + value.priority