path distance from end < distance from next point

This commit is contained in:
Maciej Sobkowiak 2019-06-10 02:23:22 +02:00
parent 3c4508b689
commit f8864d2ecd

View File

@ -72,8 +72,10 @@ class Window():
else: else:
s = to_collect_sorted[len(to_collect_sorted)-1] s = to_collect_sorted[len(to_collect_sorted)-1]
for upoint in to_collect: for upoint in to_collect:
if upoint in visited: if upoint in visited :
path_distances.append(55555) path_distances.append(100000)
elif dist(s,upoint) > dist(end,upoint):
path_distances.append(50000)
else: else:
path_distances.append(dist(s,upoint)) path_distances.append(dist(s,upoint))
min_index = np.argmin(path_distances) min_index = np.argmin(path_distances)