From ee28e2fe8ed1a1af9b69a337321d35d1ac493f92 Mon Sep 17 00:00:00 2001 From: Jens West Date: Wed, 2 Mar 2022 11:18:19 +0200 Subject: [PATCH] Fix bike distance for unreacheable destinations --- Scripts/assignment/assignment_period.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Scripts/assignment/assignment_period.py b/Scripts/assignment/assignment_period.py index 7fcad91a..193deae4 100644 --- a/Scripts/assignment/assignment_period.py +++ b/Scripts/assignment/assignment_period.py @@ -142,6 +142,7 @@ def assign(self, matrices, iteration): path_not_found = mtxs["time"][mtx_class] > 999999 mtxs[mtx_type][mtx_class][path_not_found] = 999999 # adjust impedance + mtxs["time"]["bike"] = mtxs["time"]["bike"].clip(None, 9999.) if iteration != "last": for ass_cl in ("car_work", "car_leisure"): mtxs["cost"][ass_cl] += self.dist_unit_cost * mtxs["dist"][ass_cl] @@ -434,8 +435,6 @@ def _get_matrices(self, mtx_type, is_last_iteration=False): mtx = self._damp_travel_time(subtype) else: mtx = self._get_matrix(mtx_type, subtype) - if mtx_type == "time" and subtype == "bike": - mtx = mtx.clip(None, 9999.) matrices[subtype] = mtx if not is_last_iteration: matrices["transit_leisure"] = matrices["transit_work"]