Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/prediction.txt @ 1012:01db14e947e4
resolved
| author | Wendlasida |
|---|---|
| date | Fri, 01 Jun 2018 10:47:49 -0400 |
| parents | 933670761a57 |
| children |
comparison
equal
deleted
inserted
replaced
| 1011:4f0312bee393 | 1012:01db14e947e4 |
|---|---|
| 49 >>> proto = storage.loadTrajectoriesFromSqlite('../samples/laurier.sqlite', 'feature', [1204])[0] | 49 >>> proto = storage.loadTrajectoriesFromSqlite('../samples/laurier.sqlite', 'feature', [1204])[0] |
| 50 >>> proto.getPositions().computeCumulativeDistances() | 50 >>> proto.getPositions().computeCumulativeDistances() |
| 51 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(10)+moving.Point(0.5, 0.5), proto.getVelocityAt(10)*0.9, proto, True) | 51 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(10)+moving.Point(0.5, 0.5), proto.getVelocityAt(10)*0.9, proto, True) |
| 52 >>> absolute(et.initialSpeed - proto.getVelocityAt(10).norm2()*0.9) < 1e-5 | 52 >>> absolute(et.initialSpeed - proto.getVelocityAt(10).norm2()*0.9) < 1e-5 |
| 53 True | 53 True |
| 54 >>> for t in xrange(int(proto.length())): x=et.predictPosition(t) | 54 >>> for t in range(int(proto.length())): x=et.predictPosition(t) |
| 55 >>> traj = et.getPredictedTrajectory() | 55 >>> traj = et.getPredictedTrajectory() |
| 56 >>> traj.computeCumulativeDistances() | 56 >>> traj.computeCumulativeDistances() |
| 57 >>> absolute(array(traj.distances).mean() - et.initialSpeed < 1e-3) | 57 >>> absolute(array(traj.distances).mean() - et.initialSpeed < 1e-3) |
| 58 True | 58 True |
| 59 | 59 |
| 60 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(10)+moving.Point(0.6, 0.6), proto.getVelocityAt(10)*0.7, proto, False) | 60 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(10)+moving.Point(0.6, 0.6), proto.getVelocityAt(10)*0.7, proto, False) |
| 61 >>> absolute(et.initialSpeed - proto.getVelocityAt(10).norm2()*0.7) < 1e-5 | 61 >>> absolute(et.initialSpeed - proto.getVelocityAt(10).norm2()*0.7) < 1e-5 |
| 62 True | 62 True |
| 63 >>> proto = moving.MovingObject.generate(1, moving.Point(-5.,0.), moving.Point(1.,0.), moving.TimeInterval(0,10)) | 63 >>> proto = moving.MovingObject.generate(1, moving.Point(-5.,0.), moving.Point(1.,0.), moving.TimeInterval(0,10)) |
| 64 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(0)+moving.Point(0., 1.), proto.getVelocityAt(0)*0.5, proto, False) | 64 >>> et = PredictedTrajectoryPrototype(proto.getPositionAt(0)+moving.Point(0., 1.), proto.getVelocityAt(0)*0.5, proto, False) |
| 65 >>> for t in xrange(int(proto.length()/0.5)): x=et.predictPosition(t) | 65 >>> for t in range(int(proto.length()/0.5)): x=et.predictPosition(t) |
| 66 >>> et.predictPosition(10) # doctest:+ELLIPSIS | 66 >>> et.predictPosition(10) # doctest:+ELLIPSIS |
| 67 (0.0...,1.0...) | 67 (0.0...,1.0...) |
| 68 >>> et.predictPosition(12) # doctest:+ELLIPSIS | 68 >>> et.predictPosition(12) # doctest:+ELLIPSIS |
| 69 (1.0...,1.0...) | 69 (1.0...,1.0...) |
| 70 | 70 |
