changeset 205:aeaaf5579b46

minor changes to traffic engineering
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 20 Mar 2012 22:32:38 -0400
parents 966c2cd2bd9f
children 82b4101d9a2f
files python/traffic_engineering.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/python/traffic_engineering.py	Tue Mar 06 18:44:03 2012 -0500
+++ b/python/traffic_engineering.py	Tue Mar 20 22:32:38 2012 -0400
@@ -148,7 +148,7 @@
         else:
             pass
 
-    def getPCEVolume(self):
+    def getPCUVolume(self):
         '''Returns the passenger-car equivalent for the input volume'''
         v = 0
         for p, e in zip(self.proportions, self.equivalents):
@@ -159,13 +159,12 @@
     '''Represents an intersection movement
     with a volume, a type (through, left or right)
     and an equivalent for movement type'''
-    def __init__(self, volume, type, mvtEquivalent = 1):
+    def __init__(self, volume, mvtEquivalent = 1):
         self.volume = volume
-        self.type = type
         self.mvtEquivalent = mvtEquivalent
 
     def getTVUVolume(self):
-        return self.mvtEquivalent*self.volume.getPCEVolume()    
+        return self.mvtEquivalent*self.volume.getPCUVolume()    
 
 class IntersectionApproach:
     def __init__(self, leftTurnVolume, throughVolume, rightTurnVolume):
@@ -174,7 +173,7 @@
         self.rightTurnVolume = rightTurnVolume
 
     def getTVUVolume(self, leftTurnEquivalent = 1, throughEquivalent = 1, rightTurnEquivalent = 1):
-        return self.leftTurnVolume.getPCEVolume()*leftTurnEquivalent+self.throughVolume.getPCEVolume()*throughEquivalent+self.rightTurnVolume.getPCEVolume()*rightTurnEquivalent
+        return self.leftTurnVolume.getPCUVolume()*leftTurnEquivalent+self.throughVolume.getPCUVolume()*throughEquivalent+self.rightTurnVolume.getPCUVolume()*rightTurnEquivalent
 
 class LaneGroup:
     '''Class that represents a group of mouvements'''