comparison trafficintelligence/events.py @ 1263:39740c4668ac

tweak to record t1 and t2 in indicators when computing PET
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 14 May 2024 16:41:28 -0400
parents 56d0195d043e
children ebb18043616e
comparison
equal deleted inserted replaced
1262:f10e84505443 1263:39740c4668ac
294 294
295 def computePET(self, collisionDistanceThreshold, computePetWithBoundingPoly): 295 def computePET(self, collisionDistanceThreshold, computePetWithBoundingPoly):
296 'Warning: when computing PET from interactions, there could be PETs between objects that do not coexist and therefore are not considered interactions' 296 'Warning: when computing PET from interactions, there could be PETs between objects that do not coexist and therefore are not considered interactions'
297 pet, t1, t2= moving.MovingObject.computePET(self.roadUser1, self.roadUser2, collisionDistanceThreshold, computePetWithBoundingPoly) 297 pet, t1, t2= moving.MovingObject.computePET(self.roadUser1, self.roadUser2, collisionDistanceThreshold, computePetWithBoundingPoly)
298 if pet is not None: 298 if pet is not None:
299 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[10], {min(t1, t2): pet}, mostSevereIsMax = False)) 299 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[10], {min(t1, t2): pet, max(t1, t2): pet}, mostSevereIsMax = False))
300 300
301 def setCollision(self, collision): 301 def setCollision(self, collision):
302 '''indicates if it is a collision: argument should be boolean''' 302 '''indicates if it is a collision: argument should be boolean'''
303 self.collision = collision 303 self.collision = collision
304 304