# HG changeset patch # User Nicolas Saunier # Date 1398310552 14400 # Node ID 850ed17c7b2f77bfa65f3e0a92fd0e991c722806 # Parent 30fb60428e098d9bada2f9fb2494e46bc432f332 added some computation of delay diff -r 30fb60428e09 -r 850ed17c7b2f python/traffic_engineering.py --- 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 #########################