comparison 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
comparison
equal deleted inserted replaced
630:69a98f84f3eb 631:2d1d33ae1c69
198 commonTimeInterval = self.timeInterval 198 commonTimeInterval = self.timeInterval
199 self.collisionPoints, self.crossingZones = predictionParameters.computeCrossingsCollisions(self.roadUser1, self.roadUser2, collisionDistanceThreshold, timeHorizon, computeCZ, debug, commonTimeInterval, nProcesses,usePrototypes,route1,route2,prototypes,secondStepPrototypes,nMatching,objects,noiseEntryNums,noiseExitNums,minSimilarity,mostMatched,useDestination,useSpeedPrototype,acceptPartialLength, step) 199 self.collisionPoints, self.crossingZones = predictionParameters.computeCrossingsCollisions(self.roadUser1, self.roadUser2, collisionDistanceThreshold, timeHorizon, computeCZ, debug, commonTimeInterval, nProcesses,usePrototypes,route1,route2,prototypes,secondStepPrototypes,nMatching,objects,noiseEntryNums,noiseExitNums,minSimilarity,mostMatched,useDestination,useSpeedPrototype,acceptPartialLength, step)
200 for i, cp in self.collisionPoints.iteritems(): 200 for i, cp in self.collisionPoints.iteritems():
201 TTCs[i] = prediction.SafetyPoint.computeExpectedIndicator(cp) 201 TTCs[i] = prediction.SafetyPoint.computeExpectedIndicator(cp)
202 # add probability of collision, and probability of successful evasive action 202 # add probability of collision, and probability of successful evasive action
203 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[7], TTCs)) 203 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[7], TTCs, mostSevereIsMax=False))
204 204
205 if computeCZ: 205 if computeCZ:
206 pPETs = {} 206 pPETs = {}
207 for i, cz in self.crossingZones.iteritems(): 207 for i, cz in self.crossingZones.iteritems():
208 pPETs[i] = prediction.SafetyPoint.computeExpectedIndicator(cz) 208 pPETs[i] = prediction.SafetyPoint.computeExpectedIndicator(cz)
209 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[9], pPETs)) 209 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[9], pPETs, mostSevereIsMax=False))
210
211 def computePET(self, collisionDistanceThreshold):
212 # TODO add crossing zone
213 self.pet = moving.MovingObject.computePET(self.roadUser1, self.roadUser2, collisionDistanceThreshold)
210 214
211 def addVideoFilename(self,videoFilename): 215 def addVideoFilename(self,videoFilename):
212 self.videoFilename= videoFilename 216 self.videoFilename= videoFilename
213 217
214 def addInteractionType(self,interactionType): 218 def addInteractionType(self,interactionType):