Mercurial Hosting > traffic-intelligence
comparison python/moving.py @ 921:630934595871
work in progress with prototype class
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 05 Jul 2017 18:01:43 -0400 |
parents | 3a06007a4bb7 |
children | 063d1267585d |
comparison
equal
deleted
inserted
replaced
920:499154254f37 | 921:630934595871 |
---|---|
1660 'A positive result indicates that the road users are getting closer' | 1660 'A positive result indicates that the road users are getting closer' |
1661 return Point.cosine(movingObject1.getPositionAtInstant(instant)-movingObject2.getPositionAtInstant(instant), #deltap | 1661 return Point.cosine(movingObject1.getPositionAtInstant(instant)-movingObject2.getPositionAtInstant(instant), #deltap |
1662 movingObject2.getVelocityAtInstant(instant)-movingObject1.getVelocityAtInstant(instant)) #deltav | 1662 movingObject2.getVelocityAtInstant(instant)-movingObject1.getVelocityAtInstant(instant)) #deltav |
1663 | 1663 |
1664 | 1664 |
1665 class Prototype(object): | |
1666 'Class for a prototype' | |
1667 | |
1668 def __init__(self, filename, num, trajectoryType, nMatchings = None): | |
1669 self.filename = filename | |
1670 self.num = num | |
1671 self.trajectoryType = trajectoryType | |
1672 self.nMatchings = nMatchings | |
1673 self.movingObject = None | |
1674 | |
1675 def getFilename(self): | |
1676 return self.filename | |
1677 def getNum(self): | |
1678 return self.num | |
1679 def getTrajectoryType(self): | |
1680 return self.trajectoryType | |
1681 def getNMatchings(self): | |
1682 return self.nMatchings | |
1683 def getMovingObject(self): | |
1684 return self.movingObject | |
1685 def setMovingObject(self, o): | |
1686 self.movingObject = o | |
1687 | |
1688 | |
1665 ################## | 1689 ################## |
1666 # Annotations | 1690 # Annotations |
1667 ################## | 1691 ################## |
1668 | 1692 |
1669 class BBMovingObject(MovingObject): | 1693 class BBMovingObject(MovingObject): |