Mercurial > hg > nsaunier > traffic-intelligence
diff python/tests/moving.txt @ 795:a34ec862371f
merged with dev branch
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 09 May 2016 15:33:11 -0400 |
| parents | 84420159c5f4 |
| children | e2452abba0e7 |
line wrap: on
line diff
--- a/python/tests/moving.txt Tue Nov 03 13:48:56 2015 -0500 +++ b/python/tests/moving.txt Mon May 09 15:33:11 2016 -0400 @@ -19,6 +19,12 @@ 2.0 >>> TimeInterval(10,8).length() 0.0 +>>> TimeInterval(10,8) == TimeInterval(10,8) +True +>>> TimeInterval(10,8) == TimeInterval(8,10) +True +>>> TimeInterval(11,8) == TimeInterval(10,8) +False >>> [i for i in TimeInterval(9,13)] [9, 10, 11, 12, 13] @@ -41,6 +47,10 @@ >>> TimeInterval.unionIntervals([TimeInterval(3,6), TimeInterval(8,10),TimeInterval(11,15)]) [3, 15] +>>> Point(0,3) == Point(0,3) +True +>>> Point(0,3) == Point(0,3.2) +False >>> Point(3,4)-Point(1,7) (2.000000,-3.000000) >>> -Point(1,2) @@ -70,6 +80,17 @@ (2.000000,2.000000) >>> segmentIntersection(Point(0,1), Point(1,2), Point(2,0), Point(3,2)) +>>> t1 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6)]) +>>> t2 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6)]) +>>> t1 == t2 +True +>>> t3 = Trajectory.fromPointList([(92.24, 102.9), (56.7, 69.6)]) +>>> t1 == t3 +False +>>> t3 = Trajectory.fromPointList([(92.2, 102.9), (56.7, 69.6), (56.7, 69.6)]) +>>> t1 == t3 +False + >>> left = Trajectory.fromPointList([(92.291666666666686, 102.99239033124439), (56.774193548387103, 69.688898836168306)]) >>> middle = Trajectory.fromPointList([(87.211021505376351, 93.390778871978512), (59.032258064516128, 67.540286481647257)]) >>> right = Trajectory.fromPointList([(118.82392473118281, 115.68263205013426), (63.172043010752688, 66.600268576544309)]) @@ -176,7 +197,7 @@ 'pedestrian' >>> o1 = MovingObject.generate(Point(0.,0.), Point(1.,0.), TimeInterval(0,10)) ->>> gt1 = BBAnnotation(1, TimeInterval(0,10), MovingObject.generate(Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10))) +>>> gt1 = BBMovingObject(1, TimeInterval(0,10), MovingObject.generate(Point(0.2,0.6), Point(1.,0.), TimeInterval(0,10)), MovingObject.generate(Point(-0.2,-0.4), Point(1.,0.), TimeInterval(0,10))) >>> gt1.computeCentroidTrajectory() >>> computeClearMOT([gt1], [], 0.2, 0, 10) (None, 0.0, 11, 0, 0, 11) @@ -189,9 +210,9 @@ >>> o1 = MovingObject(1, TimeInterval(0,3), positions = Trajectory([range(4), [0.1, 0.1, 1.1, 1.1]])) >>> o2 = MovingObject(2, TimeInterval(0,3), positions = Trajectory([range(4), [0.9, 0.9, -0.1, -0.1]])) ->>> gt1 = BBAnnotation(1, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [0.]*4])), MovingObject(positions = Trajectory([range(4), [0.]*4]))) +>>> gt1 = BBMovingObject(1, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [0.]*4])), MovingObject(positions = Trajectory([range(4), [0.]*4]))) >>> gt1.computeCentroidTrajectory() ->>> gt2 = BBAnnotation(2, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [1.]*4])), MovingObject(positions = Trajectory([range(4), [1.]*4]))) +>>> gt2 = BBMovingObject(2, TimeInterval(0,3), MovingObject(positions = Trajectory([range(4), [1.]*4])), MovingObject(positions = Trajectory([range(4), [1.]*4]))) >>> gt2.computeCentroidTrajectory() >>> computeClearMOT([gt1, gt2], [o1, o2], 0.2, 0, 3) # doctest:+ELLIPSIS (0.1..., 0.75, 0, 2, 0, 8)
