From 47b26c4882708074da5d4c5003d1bdf31a7a16e5 Mon Sep 17 00:00:00 2001 From: Ruben1729 Date: Tue, 12 Mar 2024 13:33:23 -0400 Subject: [PATCH] Links outside viewport not considered for events --- matsim_visualizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim_visualizer.py b/matsim_visualizer.py index d5b87f8..17100ae 100644 --- a/matsim_visualizer.py +++ b/matsim_visualizer.py @@ -102,7 +102,7 @@ class MatsimVisualizer: current_time = float(event.get('time')) ticked = False - if link_id is not None and event_type is not None and time is not None: + if link_id is not None and event_type is not None and time is not None and any(link['id'] == link_id for link in self._links): if event_type in ['entered link', 'vehicle enters traffic']: self._traffic_per_tick[self._tick][link_id] += 1 ticked = True