Mercurial > hg > nsaunier > traffic-intelligence
comparison 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 | 76f5693b530c |
comparison
equal
deleted
inserted
replaced
| 1274:0bfcbc58352f | 1275:9f1711a85c56 |
|---|---|
| 49 True | 49 True |
| 50 >>> inter.getIndicator(Interaction.indicatorNames[1])[5] is None | 50 >>> inter.getIndicator(Interaction.indicatorNames[1])[5] is None |
| 51 True | 51 True |
| 52 >>> inter.getIndicator(Interaction.indicatorNames[1])[6] # doctest:+ELLIPSIS | 52 >>> inter.getIndicator(Interaction.indicatorNames[1])[6] # doctest:+ELLIPSIS |
| 53 3.1415... | 53 3.1415... |
| 54 | |
| 55 # test if reseting object | |
| 56 >>> o2 = MovingObject.generate(2, Point(0.,-5.), Point(0.,-1.), TimeInterval(0,10)) | |
| 57 >>> inter.setRoadUsers([o1,o2]) | |
| 58 >>> ttc = inter.getIndicator("Time to Collision") | |
| 59 >>> ttc[0] | |
| 60 5.0 | |
| 61 >>> inter.computeIndicators() | |
| 62 >>> inter.computeCrossingsCollisions(predictionParams, 0.1, 10) | |
| 63 >>> inter.getIndicator("Time to Collision") is None | |
| 64 True | |
| 54 | 65 |
| 55 # test low speed | 66 # test low speed |
| 56 >>> inter = Interaction(roadUser1 = o1, roadUser2 = o2) | 67 >>> inter = Interaction(roadUser1 = o1, roadUser2 = o2) |
| 57 >>> inter.computeIndicators() | 68 >>> inter.computeIndicators() |
| 58 >>> predictionParams = ConstantPredictionParameters() | 69 >>> predictionParams = ConstantPredictionParameters() |
