comparison trafficintelligence/tests/moving.txt @ 1252:fe35473acee3

adding method to compute PET using polygon for the outline of a vehicle (bird eye view of the vehicle)
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 22 Mar 2024 14:33:25 -0400
parents 69b531c7a061
children
comparison
equal deleted inserted replaced
1251:2b1c8fe8f7e4 1252:fe35473acee3
258 >>> MovingObject.computePET(o1, o2, 0.1) 258 >>> MovingObject.computePET(o1, o2, 0.1)
259 (5.0, 5, 10) 259 (5.0, 5, 10)
260 >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,1.), TimeInterval(15,30)) 260 >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,1.), TimeInterval(15,30))
261 >>> MovingObject.computePET(o1, o2, 0.1) 261 >>> MovingObject.computePET(o1, o2, 0.1)
262 (15.0, 5, 20) 262 (15.0, 5, 20)
263
264 >>> o1 = MovingObject(1, TimeInterval(0,10), features=[MovingObject.generate(1, Point(0., 3.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(2, Point(2., 3.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(3, Point(2., 4.), Point(1., 0.), TimeInterval(0,10)), MovingObject.generate(4, Point(0., 4.), Point(1., 0.), TimeInterval(0,10))])
265 >>> o2 = MovingObject(2, TimeInterval(0,10), features=[MovingObject.generate(5, Point(6., 0.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(6, Point(7., 0.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(7, Point(7., 2.), Point(0., 1.), TimeInterval(0,10)), MovingObject.generate(8, Point(6., 2.), Point(0., 1.), TimeInterval(0,10))])
266 >>> MovingObject.computePET(o1, o2, useBoundingPoly = True)
267 (2.0, 5, 3)
263 268
264 >>> t1 = CurvilinearTrajectory.generate(3, 1., 10, 'b') 269 >>> t1 = CurvilinearTrajectory.generate(3, 1., 10, 'b')
265 >>> t1.length() 270 >>> t1.length()
266 10 271 10
267 >>> t1[3] 272 >>> t1[3]