comparison trafficintelligence/tests/indicators.txt @ 1042:b1ba6d44fcb9

corrected bug in severity indicators
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 04 Jul 2018 16:21:09 -0400
parents aafbc0bab925
children 56d0195d043e
comparison
equal deleted inserted replaced
1041:fc7c0f38e8a6 1042:b1ba6d44fcb9
17 3 17 3
18 >>> indic1.getIthValue(3) 18 >>> indic1.getIthValue(3)
19 >>> indic1[2] 19 >>> indic1[2]
20 0 20 0
21 21
22 >>> ttc = SeverityIndicator('TTC', list(range(11)), TimeInterval(1,11), mostSevereIsMax = False)
23 >>> ttc.getMostSevereValue(1)
24 0.0
25 >>> ttc.getMostSevereValue(2)
26 0.5
27 >>> ttc.getMostSevereValue(centile = 10.)
28 1.0
29 >>> ttc.mostSevereIsMax = True
30 >>> ttc.getMostSevereValue(1)
31 10.0
32 >>> ttc.getMostSevereValue(2)
33 9.5
34 >>> ttc.getMostSevereValue(centile = 10.)
35 9.0
36
22 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) 37 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]])
23 >>> m = indicatorMap([1,2,3], t1, 1) 38 >>> m = indicatorMap([1,2,3], t1, 1)
24 >>> m[(1.0, 3.0)] 39 >>> m[(1.0, 3.0)]
25 2.0 40 2.0
26 >>> m[(2.0, 6.0)] 41 >>> m[(2.0, 6.0)]