comparison trafficintelligence/tests/moving.txt @ 1134:4b2a55d570c1

resolve issue for short features when merging objects manually
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 05 Mar 2020 16:20:29 -0500
parents c4d9c270f999
children b55adb13f262
comparison
equal deleted inserted replaced
1133:c4d9c270f999 1134:4b2a55d570c1
276 >>> t=5 276 >>> t=5
277 >>> o13.getPositionAtInstant(t) == (o1.getPositionAtInstant(t)+o3.getPositionAtInstant(t)).divide(2) 277 >>> o13.getPositionAtInstant(t) == (o1.getPositionAtInstant(t)+o3.getPositionAtInstant(t)).divide(2)
278 True 278 True
279 >>> len(o13.getFeatures()) 279 >>> len(o13.getFeatures())
280 2 280 2
281 >>> o12 = MovingObject.concatenate(o1, o2, 5) 281
282 >>> o12 = MovingObject.concatenate(o1, o2, 5, minFeatureLength = 6)
282 >>> o12.getTimeInterval() == TimeInterval(o1.getFirstInstant(), o2.getLastInstant()) 283 >>> o12.getTimeInterval() == TimeInterval(o1.getFirstInstant(), o2.getLastInstant())
283 True 284 True
284 >>> v = o12.getVelocityAtInstant(12) 285 >>> v = o12.getVelocityAtInstant(12)
285 >>> v == Point(3./4, 2./4) 286 >>> v == Point(3./4, 2./4)
286 True 287 True
287 >>> o12.getPositionAtInstant(11) == o1.getPositionAtInstant(10)+v 288 >>> o12.getPositionAtInstant(11) == o1.getPositionAtInstant(10)+v
288 True 289 True
289 >>> len(o12.getFeatures()) 290 >>> len(o12.getFeatures())
290 3 291 3
292 >>> f = o12.getFeatures()[-1]
293 >>> f.length()
294 6.0
291 295
292 >>> o1 = MovingObject.generate(1, Point(0., 2.), Point(0., 1.), TimeInterval(0,2)) 296 >>> o1 = MovingObject.generate(1, Point(0., 2.), Point(0., 1.), TimeInterval(0,2))
293 >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median) 297 >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median)
294 >>> userTypeNames[o1.getUserType()] 298 >>> userTypeNames[o1.getUserType()]
295 'car' 299 'car'