Mercurial Hosting > traffic-intelligence
changeset 54:c354d41ef7cd
corrected code for usertype in movingobject
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 13 Oct 2010 19:08:12 -0400 |
parents | 0a5bdbf0d1b4 |
children | 88d5ee5ac164 |
files | python/moving.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/python/moving.py Wed Oct 13 19:02:45 2010 -0400 +++ b/python/moving.py Wed Oct 13 19:08:12 2010 -0400 @@ -249,22 +249,23 @@ class MovingObject(STObject): '''Class for moving objects - i.e. with a trajectory and a geometry (volume) - and a type (e.g. road user) + i.e. with a trajectory and a geometry (volume) (constant) + and a usertype (e.g. road user) ''' - def __init__(self, num = None, timeInterval = None, positions = None, geometry = None, type = None): + def __init__(self, num = None, timeInterval = None, positions = None, geometry = None, userType = None): STObject.__init__(self, num, timeInterval) self.positions = positions self.geometry = geometry - self.type = type + self.userType = userType # compute bounding polygon from trajectory def getObjectInTimeInterval(self, inter): - '''Returns a new object extracted from self, existing at time interval inter''' + '''Returns a new object extracted from self, + restricted to time interval inter''' if inter.inside(self.timeInterval): inter = TimeInterval(inter.first-self.getFirstInstant(), inter.last-self.getFirstInstant()) - obj = MovingObject(self.num, inter, self.positions.getTrajectoryInInterval(inter), self.geometry, self.type) + obj = MovingObject(self.num, inter, self.positions.getTrajectoryInInterval(inter), self.geometry, self.userType) if self.velocities: obj.velocities = self.velocities.getTrajectoryInInterval(inter) return obj