Mercurial Hosting > traffic-intelligence
diff trafficintelligence/tests/events.txt @ 1275:9f1711a85c56
added code to make sure TTC is replaced of recomputed and not having a value
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 19 Jun 2024 16:11:35 -0400 |
parents | ca70a79688ae |
children |
line wrap: on
line diff
--- a/trafficintelligence/tests/events.txt Tue Jun 18 15:30:21 2024 -0400 +++ b/trafficintelligence/tests/events.txt Wed Jun 19 16:11:35 2024 -0400 @@ -52,6 +52,17 @@ >>> inter.getIndicator(Interaction.indicatorNames[1])[6] # doctest:+ELLIPSIS 3.1415... +# test if reseting object +>>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,-1.), TimeInterval(0,10)) +>>> inter.setRoadUsers([o1,o2]) +>>> ttc = inter.getIndicator("Time to Collision") +>>> ttc[0] +5.0 +>>> inter.computeIndicators() +>>> inter.computeCrossingsCollisions(predictionParams, 0.1, 10) +>>> inter.getIndicator("Time to Collision") is None +True + # test low speed >>> inter = Interaction(roadUser1 = o1, roadUser2 = o2) >>> inter.computeIndicators()