comparison python/traffic_engineering.py @ 796:9f8e9fb5621b dev

minor
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 23 May 2016 23:54:45 -0400
parents 944949c8ef3e
children 2cd1ce245024
comparison
equal deleted inserted replaced
792:ee3433fc0026 796:9f8e9fb5621b
307 print 'Issue deceleration should be strictly positive' 307 print 'Issue deceleration should be strictly positive'
308 return None 308 return None
309 309
310 def uniformDelay(cycleLength, effectiveGreen, saturationDegree): 310 def uniformDelay(cycleLength, effectiveGreen, saturationDegree):
311 '''Computes the uniform delay''' 311 '''Computes the uniform delay'''
312 return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)/(1-float(effectiveGreen*saturationDegree)/cycleLength) 312 return 0.5*cycleLength*(1-float(effectiveGreen)/cycleLength)**2/(1-float(effectiveGreen*saturationDegree)/cycleLength)
313
314 def randomDelay(volume, saturationDegree):
315 '''Computes the random delay = queueing time for M/D/1'''
316 return saturationDegree**2/(2*volume*(1-saturationDegree))
313 317
314 def incrementalDelay(T, X, c, k=0.5, I=1): 318 def incrementalDelay(T, X, c, k=0.5, I=1):
315 '''Computes the incremental delay (HCM) 319 '''Computes the incremental delay (HCM)
316 T in hours 320 T in hours
317 c capacity of the lane group 321 c capacity of the lane group