diff python/indicators.py @ 692:9a258687af4c dev

corrected some errors for ttc
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 29 Jun 2015 23:09:58 -0400
parents fa9aa5f08210
children 5ee22bf7e4d5
line wrap: on
line diff
--- a/python/indicators.py	Mon Jun 29 16:15:04 2015 -0400
+++ b/python/indicators.py	Mon Jun 29 23:09:58 2015 -0400
@@ -152,6 +152,13 @@
         else:
             return None
 
+    def getInstantOfMostSevereValue(self):
+        '''Returns the instant at which the indicator reaches its most severe value'''
+        if self.mostSevereIsMax:
+            return max(self.values, key=self.values.get)
+        else:
+            return min(self.values, key=self.values.get)
+
 # functions to aggregate discretized maps of indicators
 # TODO add values in the cells between the positions (similar to discretizing vector graphics to bitmap)