From d2f973307f427dd81eccd4374f0ee188b9fc0d97 Mon Sep 17 00:00:00 2001 From: Jakub Chmielecki Date: Sun, 16 Apr 2023 15:42:10 +0200 Subject: [PATCH] Zaktualizuj 'graph_search.py' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ograniczenie wartoĊ›ci graphSearch do nieujemnych --- graph_search.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/graph_search.py b/graph_search.py index 2612d594..0c149529 100644 --- a/graph_search.py +++ b/graph_search.py @@ -54,6 +54,8 @@ class Search: explored.append(elem) for (action, state_x, state_y, state_angle) in self.succ(elem.state): + if state_x < 0 or state_y < 0: # check if any of the values is negative + continue if [state_x, state_y, state_angle] not in fringe and [state_x, state_y, state_angle] not in explored: x = Node([state_x, state_y, state_angle]) x.parent = elem