diff python/tests/prediction.txt @ 998:933670761a57

updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sun, 27 May 2018 23:22:48 -0400
parents 05d4302bf67e
children
line wrap: on
line diff
--- a/python/tests/prediction.txt	Fri May 25 18:15:18 2018 -0400
+++ b/python/tests/prediction.txt	Sun May 27 23:22:48 2018 -0400
@@ -51,7 +51,7 @@
 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(10)+moving.Point(0.5, 0.5), proto.getVelocityAt(10)*0.9, proto, True)
 >>> absolute(et.initialSpeed - proto.getVelocityAt(10).norm2()*0.9) < 1e-5
 True
->>> for t in xrange(int(proto.length())): x=et.predictPosition(t)
+>>> for t in range(int(proto.length())): x=et.predictPosition(t)
 >>> traj = et.getPredictedTrajectory()
 >>> traj.computeCumulativeDistances()
 >>> absolute(array(traj.distances).mean() - et.initialSpeed < 1e-3)
@@ -62,7 +62,7 @@
 True
 >>> proto = moving.MovingObject.generate(1, moving.Point(-5.,0.), moving.Point(1.,0.), moving.TimeInterval(0,10))
 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(0)+moving.Point(0., 1.), proto.getVelocityAt(0)*0.5, proto, False)
->>> for t in xrange(int(proto.length()/0.5)): x=et.predictPosition(t)
+>>> for t in range(int(proto.length()/0.5)): x=et.predictPosition(t)
 >>> et.predictPosition(10) # doctest:+ELLIPSIS
 (0.0...,1.0...)
 >>> et.predictPosition(12) # doctest:+ELLIPSIS