changeset 797:2ffaf1a7cde9 dev

merged
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 23 May 2016 23:55:06 -0400
parents 9f8e9fb5621b (diff) 8eb8a6bd70e8 (current diff)
children 5b99b676265e
files
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/traffic_engineering.py	Mon May 02 15:03:19 2016 -0400
+++ b/python/traffic_engineering.py	Mon May 23 23:55:06 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)