From f8864d2ecd05b1e42144afff075a4f7a7a270bd4 Mon Sep 17 00:00:00 2001 From: Maciej Sobkowiak Date: Mon, 10 Jun 2019 02:23:22 +0200 Subject: [PATCH] path distance from end < distance from next point --- UI/window.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/window.py b/UI/window.py index f3b925e..29c531b 100644 --- a/UI/window.py +++ b/UI/window.py @@ -72,8 +72,10 @@ class Window(): else: s = to_collect_sorted[len(to_collect_sorted)-1] for upoint in to_collect: - if upoint in visited: - path_distances.append(55555) + if upoint in visited : + path_distances.append(100000) + elif dist(s,upoint) > dist(end,upoint): + path_distances.append(50000) else: path_distances.append(dist(s,upoint)) min_index = np.argmin(path_distances)