Path: use the actual values instead of absolute values when calculating distance

This commit is contained in:
Sabin Iacob
2017-05-26 08:54:40 +03:00
committed by Yorik van Havre
parent 2c862f0f72
commit 6fbeead3fb

View File

@@ -526,7 +526,7 @@ def sort_jobs(locations, keys, attractors=[]):
""" square Euclidean distance """
d = 0
for k in keys:
d += (abs(a[k]) - abs(b[k])) ** 2
d += (a[k] - b[k]) ** 2
return d