Mercurial Hosting > traffic-intelligence
diff python/traffic_engineering.py @ 796:9f8e9fb5621b dev
minor
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 23 May 2016 23:54:45 -0400 |
parents | 944949c8ef3e |
children | 2cd1ce245024 |
line wrap: on
line diff
--- a/python/traffic_engineering.py Fri Apr 29 16:08:45 2016 -0400 +++ b/python/traffic_engineering.py Mon May 23 23:54:45 2016 -0400 @@ -309,7 +309,11 @@ def uniformDelay(cycleLength, effectiveGreen, saturationDegree): '''Computes the uniform delay''' - return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)/(1-float(effectiveGreen*saturationDegree)/cycleLength) + return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)**2/(1-float(effectiveGreen*saturationDegree)/cycleLength) + +def randomDelay(volume, saturationDegree): + '''Computes the random delay = queueing time for M/D/1''' + return saturationDegree**2/(2*volume*(1-saturationDegree)) def incrementalDelay(T, X, c, k=0.5, I=1): '''Computes the incremental delay (HCM)