Links outside viewport not considered for events

This commit is contained in:
Ruben1729 2024-03-12 13:33:23 -04:00
parent 35ec942d94
commit 47b26c4882

View File

@ -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