nsaunier/traffic-intelligence
tweak to record t1 and t2 in indicators when computing PET
Commit 39740c4668ac · Nicolas Saunier · 2024-05-14 16:41 -0400
Comments
No comments yet.
Diff
diff --git a/trafficintelligence/events.py b/trafficintelligence/events.py
--- a/trafficintelligence/events.py
+++ b/trafficintelligence/events.py
@@ -296,7 +296,7 @@
'Warning: when computing PET from interactions, there could be PETs between objects that do not coexist and therefore are not considered interactions'
pet, t1, t2= moving.MovingObject.computePET(self.roadUser1, self.roadUser2, collisionDistanceThreshold, computePetWithBoundingPoly)
if pet is not None:
- self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[10], {min(t1, t2): pet}, mostSevereIsMax = False))
+ self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[10], {min(t1, t2): pet, max(t1, t2): pet}, mostSevereIsMax = False))
def setCollision(self, collision):
'''indicates if it is a collision: argument should be boolean'''