Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 56:61fe73df2d36
created new package, moved Interaction class and created Crossing class
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 27 Oct 2010 18:32:27 -0400 |
| parents | 88d5ee5ac164 |
| children | 40e1508380ed |
comparison
equal
deleted
inserted
replaced
| 55:88d5ee5ac164 | 56:61fe73df2d36 |
|---|---|
| 329 | 329 |
| 330 def __init__(self, name, values = {}): | 330 def __init__(self, name, values = {}): |
| 331 self.name = name | 331 self.name = name |
| 332 self.values = values | 332 self.values = values |
| 333 | 333 |
| 334 class Interaction(STObject): | |
| 335 '''Class for an interaction between two road users | |
| 336 or a road user and an obstacle | |
| 337 | |
| 338 link to the moving objects | |
| 339 ''' | |
| 340 | |
| 341 def __init__(self, num = None, timeInterval = None, protagonistNum1 = None, protagonistNum2 = None, movingObject1 = None, movingObject2 = None): | |
| 342 STObject.__init__(self, num, timeInterval) | |
| 343 self.protagonistNum1 = protagonistNum1 | |
| 344 self.protagonistNum2 = protagonistNum2 | |
| 345 self.movingObject1 = movingObject1 | |
| 346 self.movingObject2 = movingObject2 | |
| 347 | |
| 348 if __name__ == "__main__": | 334 if __name__ == "__main__": |
| 349 import doctest | 335 import doctest |
| 350 import unittest | 336 import unittest |
| 351 suite = doctest.DocFileSuite('tests/moving.txt') | 337 suite = doctest.DocFileSuite('tests/moving.txt') |
| 352 #suite = doctest.DocTestSuite() | 338 #suite = doctest.DocTestSuite() |
