comparison python/traffic_engineering.py @ 801:c5f98916297e

merged with dev branch
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 31 May 2016 17:07:23 -0400
parents 9f8e9fb5621b
children 2cd1ce245024
comparison
equal deleted inserted replaced
795:a34ec862371f 801:c5f98916297e
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