changeset 796:9f8e9fb5621b dev

minor
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 23 May 2016 23:54:45 -0400
parents ee3433fc0026
children 2ffaf1a7cde9
files python/traffic_engineering.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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)