Mercurial Hosting > traffic-intelligence
diff python/tests/moving.txt @ 531:f012a8ad7a0e
corrected bug in Point.timeToCollision that might result in negative TTCs
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Fri, 27 Jun 2014 17:32:11 -0400 |
parents | 1dced8932b08 |
children | a3add9f751ef |
line wrap: on
line diff
--- a/python/tests/moving.txt Thu Jun 26 23:20:36 2014 -0400 +++ b/python/tests/moving.txt Fri Jun 27 17:32:11 2014 -0400 @@ -93,6 +93,14 @@ True >>> abs(Point.timeToCollision(p1, p2, v1, v2, 0.1)-4.5) < 0.00001 True +>>> p1=Point(0,1) +>>> p2=Point(1,0) +>>> v1 = Point(0,0.1) +>>> v2 = Point(0.1, 0) +>>> Point.timeToCollision(p1, p2, v1, v2, 0.) == None +True +>>> Point.timeToCollision(p2, p1, v2, v1, 0.) == None +True >>> o1 = MovingObject(positions = Trajectory([[0]*3,[2]*3]), velocities = Trajectory([[0]*3,[1]*3])) >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median)