diff python/traffic_engineering.py @ 37:911b52744ceb

added uniform delay function
author Nicolas Saunier <nico@confins.net>
date Mon, 12 Apr 2010 15:54:20 -0400
parents 571b11304ec9
children 930a6282c9a9
line wrap: on
line diff
--- a/python/traffic_engineering.py	Mon Apr 12 13:40:05 2010 -0400
+++ b/python/traffic_engineering.py	Mon Apr 12 15:54:20 2010 -0400
@@ -108,3 +108,7 @@
     else:
         print 'Issue deceleration should be strictly positive'
         return None
+
+def uniformDelay(cycleLength, effectiveGreen, saturationDegree):
+    '''Computes the uniform delay'''
+    return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)/(1-float(effectiveGreen*saturationDegree)/cycleLength)