changeset 37:911b52744ceb

added uniform delay function
author Nicolas Saunier <nico@confins.net>
date Mon, 12 Apr 2010 15:54:20 -0400
parents 571b11304ec9
children 0d321c23d337
files python/traffic_engineering.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
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)