Mercurial Hosting > traffic-intelligence
comparison python/event.py @ 94:7da14f07e1f9
bug introduced by conversion of interval length to int
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 13 Jun 2011 16:10:36 -0400 |
parents | 19603b5fa578 |
children | 857bcd41e9a2 |
comparison
equal
deleted
inserted
replaced
93:19603b5fa578 | 94:7da14f07e1f9 |
---|---|
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 '''Computes the collision course cosine only if the cosine is positive''' |
40 collisionCourseDotProduct = [0]*self.timeInterval.length() | 40 collisionCourseDotProduct = [0]*int(self.timeInterval.length()) |
41 collisionCourseCosine = {} | 41 collisionCourseCosine = {} |
42 distances = [0]*self.timeInterval.length() | 42 distances = [0]*self.timeInterval.length() |
43 for i,instant in enumerate(self.timeInterval): | 43 for i,instant in enumerate(self.timeInterval): |
44 deltap = self.movingObject1.getPositionAtInstant(instant)-self.movingObject2.getPositionAtInstant(instant) | 44 deltap = self.movingObject1.getPositionAtInstant(instant)-self.movingObject2.getPositionAtInstant(instant) |
45 deltav = self.movingObject2.getVelocityAtInstant(instant)-self.movingObject1.getVelocityAtInstant(instant) | 45 deltav = self.movingObject2.getVelocityAtInstant(instant)-self.movingObject1.getVelocityAtInstant(instant) |