changeset 493:850ed17c7b2f

added some computation of delay
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 23 Apr 2014 23:35:52 -0400
parents 30fb60428e09
children 41a72146685e 82c06ad62254 6ebdd90ce3ee
files python/traffic_engineering.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/python/traffic_engineering.py	Wed Apr 23 16:20:40 2014 -0400
+++ b/python/traffic_engineering.py	Wed Apr 23 23:35:52 2014 -0400
@@ -266,6 +266,15 @@
     '''Computes the uniform delay'''
     return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)/(1-float(effectiveGreen*saturationDegree)/cycleLength)
 
+def overflowDelay(T, X, c, k=0.5, I=1):
+    '''Computes the overflow delay (HCM)
+    T in hours
+    c capacity of the lane group
+    k default for fixed time signal
+    I=1 for isolated intersection (Poisson arrival)'''
+    from math import sqrt
+    return 900*T*(X - 1 + sqrt((X - 1)**2 + 8*k*I*X/(c*T)))
+
 #########################
 # misc
 #########################