From 16e42d9839089fd2632fa2b846363ecdc9b9eaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Tue, 26 Dec 2017 13:20:00 +0100 Subject: [PATCH] fix scores calculation --- src/c3nav/routing/locator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 38b226e4..37b468c8 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -128,7 +128,7 @@ class LocatorSpace: def get_best_point(self, scan_values, station_ids): stations = tuple(self.stations_lookup[station_id] for station_id in station_ids) values = np.array(tuple(scan_values[station_id]**2 for station_id in station_ids), dtype=np.int32) - scores = np.sum((self.levels[:, stations]-values)**2, axis=1) + scores = np.sum((self.levels[:, stations]-values)**2, axis=1)/len(stations) best_point = np.argmin(scores).ravel()[0] return self.points[best_point], scores[best_point]