Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/tests/moving.txt @ 1097:b3f8b26ee838
modification for simulation
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 18 Feb 2019 17:23:26 -0500 |
| parents | c96388c696ac |
| children | 799ef82caa1a |
comparison
equal
deleted
inserted
replaced
| 1096:9a32d63bae3f | 1097:b3f8b26ee838 |
|---|---|
| 209 >>> t1 = CurvilinearTrajectory.generate(3, 1., 10, 'b') | 209 >>> t1 = CurvilinearTrajectory.generate(3, 1., 10, 'b') |
| 210 >>> t1.length() | 210 >>> t1.length() |
| 211 10 | 211 10 |
| 212 >>> t1[3] | 212 >>> t1[3] |
| 213 [6.0, 0, 'b'] | 213 [6.0, 0, 'b'] |
| 214 >>> t2 = CurvilinearTrajectory.generate(3, 1., 10, 'a', 1.) | 214 >>> t2 = CurvilinearTrajectory.generate(15, 1., 10, 'a', 1.) |
| 215 >>> t2[4] | 215 >>> t2[4] |
| 216 [7.0, 1.0, 'a'] | 216 [19.0, 1.0, 'a'] |
| 217 >>> t1.append(t2) | 217 >>> t1.append(t2) |
| 218 >>> t1.length() | 218 >>> t1.length() |
| 219 20 | 219 20 |
| 220 >>> t1[9] | |
| 221 [12.0, 0, 'b'] | |
| 222 >>> o = MovingObject(0, TimeInterval(1,21)) | |
| 223 >>> o.curvilinearPositions = t1 | |
| 224 >>> o.interpolateCurvilinearPositions(2.3) | |
| 225 [4.3, 0.0, 'b'] | |
| 226 >>> o.interpolateCurvilinearPositions(10.7) # doctest:+ELLIPSIS | |
| 227 [14.09999..., 0.69999..., 'a'] | |
| 220 | 228 |
| 221 >>> a = Trajectory.generate(Point(0.,0.), Point(10.,0.), 4) | 229 >>> a = Trajectory.generate(Point(0.,0.), Point(10.,0.), 4) |
| 222 >>> t = Trajectory.generate(Point(0.1,-1.), Point(1.,0.), 22) | 230 >>> t = Trajectory.generate(Point(0.1,-1.), Point(1.,0.), 22) |
| 223 >>> prepareAlignments([a]) | 231 >>> prepareAlignments([a]) |
| 224 >>> ct = CurvilinearTrajectory.fromTrajectoryProjection(t, [a]) | 232 >>> ct = CurvilinearTrajectory.fromTrajectoryProjection(t, [a]) |
