diff 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
line wrap: on
line diff
--- a/trafficintelligence/tests/indicators.txt	Wed Jul 04 16:06:23 2018 -0400
+++ b/trafficintelligence/tests/indicators.txt	Wed Jul 04 16:21:09 2018 -0400
@@ -19,6 +19,21 @@
 >>> indic1[2]
 0
 
+>>> ttc = SeverityIndicator('TTC', list(range(11)), TimeInterval(1,11), mostSevereIsMax = False)
+>>> ttc.getMostSevereValue(1)
+0.0
+>>> ttc.getMostSevereValue(2)
+0.5
+>>> ttc.getMostSevereValue(centile = 10.)
+1.0
+>>> ttc.mostSevereIsMax = True
+>>> ttc.getMostSevereValue(1)
+10.0
+>>> ttc.getMostSevereValue(2)
+9.5
+>>> ttc.getMostSevereValue(centile = 10.)
+9.0
+
 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]])
 >>> m = indicatorMap([1,2,3], t1, 1)
 >>> m[(1.0, 3.0)]