Mercurial > hg > nsaunier > traffic-intelligence
comparison python/event.py @ 93:19603b5fa578
added timeinterval computation for indicators based on dictionaries
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 13 Jun 2011 14:15:08 -0400 |
| parents | ded58c424783 |
| children | 7da14f07e1f9 |
comparison
equal
deleted
inserted
replaced
| 92:a5ef9e40688e | 93:19603b5fa578 |
|---|---|
| 34 return i | 34 return i |
| 35 else: | 35 else: |
| 36 return None | 36 return None |
| 37 | 37 |
| 38 def computeIndicators(self): | 38 def computeIndicators(self): |
| 39 '''Computes the collision course cosine only if the cosine is positive''' | |
| 39 collisionCourseDotProduct = [0]*self.timeInterval.length() | 40 collisionCourseDotProduct = [0]*self.timeInterval.length() |
| 40 collisionCourseCosine = {} | 41 collisionCourseCosine = {} |
| 41 distances = [0]*self.timeInterval.length() | 42 distances = [0]*self.timeInterval.length() |
| 42 for i,instant in enumerate(self.timeInterval): | 43 for i,instant in enumerate(self.timeInterval): |
| 43 deltap = self.movingObject1.getPositionAtInstant(instant)-self.movingObject2.getPositionAtInstant(instant) | 44 deltap = self.movingObject1.getPositionAtInstant(instant)-self.movingObject2.getPositionAtInstant(instant) |
