comparison python/event.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
children f955e83da499
comparison
equal deleted inserted replaced
55:88d5ee5ac164 56:61fe73df2d36
1 #! /usr/bin/env python
2 '''Libraries for events
3 Interactions, pedestrian crossing...'''
4
5 #import utils;
6
7 __metaclass__ = type
8
9 class Interaction(STObject):
10 '''Class for an interaction between two road users
11 or a road user and an obstacle
12
13 link to the moving objects
14 '''
15
16 def __init__(self, num = None, timeInterval = None, roaduserNum1 = None, roaduserNum2 = None, movingObject1 = None, movingObject2 = None):
17 STObject.__init__(self, num, timeInterval)
18 self.roaduserNum1 = roaduserNum1
19 self.roaduserNum2 = roaduserNum2
20 self.movingObject1 = movingObject1
21 self.movingObject2 = movingObject2
22
23 class Crossing(STObject):
24 '''Class for the event of a street crossing
25
26 TODO: detecter passage sur la chaussee
27 identifier origines et destination (ou uniquement chaussee dans FOV)
28 carac traversee
29 detecter proximite veh (retirer si trop similaire simultanement
30 carac interaction'''
31
32 def __init__(self, roaduserNum = None, num = None, timeInterval = None):
33 self.roaduserNum = roaduserNum
34 self.num = num
35 self.timeInterval = timeInterval
36
37
38
39 if __name__ == "__main__":
40 import doctest
41 import unittest
42 #suite = doctest.DocFileSuite('tests/moving.txt')
43 suite = doctest.DocTestSuite()
44 unittest.TextTestRunner().run(suite)
45