tweak to record t1 and t2 in indicators when computing PET

Commit 39740c4668ac · Nicolas Saunier · 2024-05-14 16:41 -0400

Changeset
39740c4668ac223d64b5f429f0d0abd2e9121ef3

View source at this commit

Comments

No comments yet.

Log in to comment

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