Mercurial Hosting > traffic-intelligence
diff python/traffic_engineering.py @ 493:850ed17c7b2f
added some computation of delay
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 23 Apr 2014 23:35:52 -0400 |
parents | 7828fec8bbd2 |
children | 3b13ec964476 |
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 #########################