diff python/tests/moving.txt @ 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 17b02c8054d0
children dc70d9e711f5
line wrap: on
line diff
--- a/python/tests/moving.txt	Tue Feb 17 02:21:31 2015 +0100
+++ b/python/tests/moving.txt	Tue Feb 17 03:55:55 2015 +0100
@@ -53,9 +53,9 @@
 >>> Point.distanceNorm2(Point(3,4),Point(1,7))
 3.605551275463989
 
->>> Point(3,2).inPolygonNoShapely(np.array([[0,0],[1,0],[1,1],[0,1]]))
+>>> Point(3,2).inPolygon(np.array([[0,0],[1,0],[1,1],[0,1]]))
 False
->>> Point(3,2).inPolygonNoShapely(np.array([[0,0],[4,0],[4,3],[0,3]]))
+>>> Point(3,2).inPolygon(np.array([[0,0],[4,0],[4,3],[0,3]]))
 True
 
 >>> predictPositionNoLimit(10, Point(0,0), Point(1,1)) # doctest:+ELLIPSIS
@@ -84,10 +84,6 @@
 True
 >>> t1[1]
 (1.500000,3.500000)
->>> t1.getTrajectoryInPolygonNoShapely(np.array([[0,0],[4,0],[4,3],[0,3]]))
-(0.500000,0.500000)
->>> t1.getTrajectoryInPolygonNoShapely(np.array([[10,10],[14,10],[14,13],[10,13]])).length()
-0
 
 >>> t1.differentiate()
 (1.000000,3.000000) (1.000000,3.000000)
@@ -141,6 +137,14 @@
 >>> Point.midPoint(p1, p2)
 (0.500000,0.500000)
 
+>>> o1 = MovingObject.generate(Point(-5.,0.), Point(1.,0.), TimeInterval(0,10))
+>>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(0,10))
+>>> MovingObject.computePET(o1, o2, 0.1)
+0.0
+>>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(5,15))
+>>> MovingObject.computePET(o1, o2, 0.1)
+5.0
+
 >>> t = CurvilinearTrajectory(S = [1., 2., 3., 5.], Y = [0.5, 0.5, 0.6, 0.7], lanes = ['1']*4)
 >>> t.differentiate() # doctest:+ELLIPSIS
 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1']