# HG changeset patch # User Nicolas Saunier # Date 1271102060 14400 # Node ID 911b52744cebeee1d8ceab7c8f2be21855a119eb # Parent 571b11304ec9b3e5d5541771e56889d9e94217e5 added uniform delay function diff -r 571b11304ec9 -r 911b52744ceb python/traffic_engineering.py --- 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)