diff trafficintelligence/moving.py @ 1125:b358bed29ab4

updates and bugs
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 30 Jan 2020 10:17:07 -0500
parents bb58506c1bfd
children 2682b4696cdf
line wrap: on
line diff
--- a/trafficintelligence/moving.py	Tue Jun 25 17:23:43 2019 -0400
+++ b/trafficintelligence/moving.py	Thu Jan 30 10:17:07 2020 -0500
@@ -738,6 +738,11 @@
         else:
             return False
 
+    def append(self,other):
+        '''adds positions of other to the trajectory (in-place modification)'''
+        for p in other:
+            self.addPosition(p)
+
     def setPositionXY(self, i, x, y):
         if i < self.__len__():
             self.positions[0][i] = x
@@ -1076,11 +1081,6 @@
         lanes = [lane]*nPoints
         return CurvilinearTrajectory(S, Y, lanes)
 
-    def append(self,other):
-        '''adds positions of other to the curvilinear trajectory (in-place modification)'''
-        for p in other:
-            self.addPosition(p)
-
     @staticmethod
     def fromTrajectoryProjection(t, alignments, halfWidth = 3):
         ''' Add, for every object position, the class 'moving.CurvilinearTrajectory()'
@@ -1216,7 +1216,8 @@
                  'motorcycle',
                  'bicycle',
                  'bus',
-                 'truck']
+                 'truck',
+                 'automated']
 
 userType2Num = utils.inverseEnumeration(userTypeNames)
 
@@ -1425,6 +1426,12 @@
         else:
             return None
 
+    def getCurvilinearVelocities(self):
+        if hasattr(self, 'curvilinearVelocities'):
+            return self.curvilinearVelocities
+        else:
+            return None
+
     def plotCurvilinearPositions(self, lane = None, options = '', withOrigin = False, **kwargs):
         if hasattr(self, 'curvilinearPositions'):
             if lane is None: