diff python/events.py @ 631:2d1d33ae1c69

major work on pPET and pet, issues remain for pPET computed with predicted trajectories
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 17 Feb 2015 03:55:55 +0100
parents 69a98f84f3eb
children 2f1a583bfd20
line wrap: on
line diff
--- a/python/events.py	Tue Feb 17 02:21:31 2015 +0100
+++ b/python/events.py	Tue Feb 17 03:55:55 2015 +0100
@@ -200,13 +200,17 @@
         for i, cp in self.collisionPoints.iteritems():
             TTCs[i] = prediction.SafetyPoint.computeExpectedIndicator(cp)
         # add probability of collision, and probability of successful evasive action
-        self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[7], TTCs))
+        self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[7], TTCs, mostSevereIsMax=False))
         
         if computeCZ:
             pPETs = {}
             for i, cz in self.crossingZones.iteritems():
                 pPETs[i] = prediction.SafetyPoint.computeExpectedIndicator(cz)
-            self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[9], pPETs))
+            self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[9], pPETs, mostSevereIsMax=False))
+
+    def computePET(self, collisionDistanceThreshold):
+        # TODO add crossing zone
+        self.pet = moving.MovingObject.computePET(self.roadUser1, self.roadUser2, collisionDistanceThreshold)
 
     def addVideoFilename(self,videoFilename):
         self.videoFilename= videoFilename