Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 633:f410c8fb07b7
minor function to export speed as temporal indicator for display
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 17 Feb 2015 15:32:29 +0100 |
parents | 2d1d33ae1c69 |
children | 6ae68383071e |
comparison
equal
deleted
inserted
replaced
632:2f1a583bfd20 | 633:f410c8fb07b7 |
---|---|
1079 def setFeatures(self, features): | 1079 def setFeatures(self, features): |
1080 self.features = [features[i] for i in self.featureNumbers] | 1080 self.features = [features[i] for i in self.featureNumbers] |
1081 | 1081 |
1082 def getSpeeds(self): | 1082 def getSpeeds(self): |
1083 return self.getVelocities().norm() | 1083 return self.getVelocities().norm() |
1084 | |
1085 def getSpeedIndicator(self): | |
1086 from indicators import SeverityIndicator | |
1087 return SeverityIndicator('Speed', {t:self.getVelocityAtInstant(t).norm2() for t in self.getTimeInterval()}) | |
1084 | 1088 |
1085 def getPositionAt(self, i): | 1089 def getPositionAt(self, i): |
1086 return self.positions[i] | 1090 return self.positions[i] |
1087 | 1091 |
1088 def getVelocityAt(self, i): | 1092 def getVelocityAt(self, i): |