# HG changeset patch # User Nicolas Saunier # Date 1561260781 14400 # Node ID cef7aa2f99316e01687c305ff7a5887b15ec5523 # Parent 7135b5eaa6b44c0c3156304201728837c57b41d8 minor shorthand method diff -r 7135b5eaa6b4 -r cef7aa2f9931 trafficintelligence/moving.py --- a/trafficintelligence/moving.py Fri Jun 21 15:54:04 2019 -0400 +++ b/trafficintelligence/moving.py Sat Jun 22 23:33:01 2019 -0400 @@ -879,12 +879,16 @@ print('Index {} beyond trajectory length {}-1'.format(i, self.length())) def getCumulativeDistance(self, i): - '''Return the cumulative distance between the beginning and point i''' + '''Returns the cumulative distance between the beginning and point i''' if i < self.length(): return self.cumulativeDistances[i] else: print('Index {} beyond trajectory length {}'.format(i, self.length())) + def getTotalDistance(self): + '''Returns the total distance (shorthand for cumulative distance [-1]''' + return self.getCumulativeDistance(-1) + def getMaxDistance(self, metric): 'Returns the maximum distance between points in the trajectory' positions = self.getPositions().asArray().T