Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/events.py @ 1144:6a8fe3ed3bc6
bug correction
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 28 Apr 2020 01:01:14 -0400 |
| parents | cc5cb04b04b0 |
| children | b219d5a1bb55 |
comparison
equal
deleted
inserted
replaced
| 1143:8ac52ebff5f7 | 1144:6a8fe3ed3bc6 |
|---|---|
| 47 | 47 |
| 48 link to the moving objects | 48 link to the moving objects |
| 49 contains the indicators in a dictionary with the names as keys | 49 contains the indicators in a dictionary with the names as keys |
| 50 ''' | 50 ''' |
| 51 | 51 |
| 52 categories = {'Head On': 0, | 52 categories = {'headon': 0, |
| 53 'rearend': 1, | 53 'rearend': 1, |
| 54 'side': 2, | 54 'side': 2, |
| 55 'parallel': 3} | 55 'parallel': 3} |
| 56 | 56 |
| 57 indicatorNames = ['Collision Course Dot Product', | 57 indicatorNames = ['Collision Course Dot Product', |
| 214 minDistances={} | 214 minDistances={} |
| 215 for instant in self.timeInterval: | 215 for instant in self.timeInterval: |
| 216 minDistances[instant] = moving.MovingObject.minDistance(self.roadUser1, self.roadUser2, instant) | 216 minDistances[instant] = moving.MovingObject.minDistance(self.roadUser1, self.roadUser2, instant) |
| 217 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[3], minDistances, mostSevereIsMax = False)) | 217 self.addIndicator(indicators.SeverityIndicator(Interaction.indicatorNames[3], minDistances, mostSevereIsMax = False)) |
| 218 | 218 |
| 219 def categorize(self): | |
| 220 '''Computes the interaction category by instant ''' | |
| 221 | |
| 219 def computeCrossingsCollisions(self, predictionParameters, collisionDistanceThreshold, timeHorizon, computeCZ = False, debug = False, timeInterval = None): | 222 def computeCrossingsCollisions(self, predictionParameters, collisionDistanceThreshold, timeHorizon, computeCZ = False, debug = False, timeInterval = None): |
| 220 '''Computes all crossing and collision points at each common instant for two road users. ''' | 223 '''Computes all crossing and collision points at each common instant for two road users. ''' |
| 221 TTCs = {} | 224 TTCs = {} |
| 222 collisionProbabilities = {} | 225 collisionProbabilities = {} |
| 223 if timeInterval is not None: | 226 if timeInterval is not None: |
