Mercurial > hg > nsaunier > traffic-intelligence
comparison python/moving.py @ 552:ca6bded754ac
corrected more bugs from merging (caught in regression tests)
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 08 Jul 2014 17:04:55 -0400 |
| parents | dc3739ac2371 |
| children | f13220f765e0 |
comparison
equal
deleted
inserted
replaced
| 551:dc3739ac2371 | 552:ca6bded754ac |
|---|---|
| 635 lateral coordiante is stored as second coordinate''' | 635 lateral coordiante is stored as second coordinate''' |
| 636 | 636 |
| 637 def __init__(self, S = None, Y = None, lanes = None): | 637 def __init__(self, S = None, Y = None, lanes = None): |
| 638 if S == None or Y == None or len(S) != len(Y): | 638 if S == None or Y == None or len(S) != len(Y): |
| 639 self.positions = [[],[]] | 639 self.positions = [[],[]] |
| 640 if len(S) != len(Y): | 640 if S != None and Y != None and len(S) != len(Y): |
| 641 print("S and Y coordinates of different lengths\nInitializing to empty lists") | 641 print("S and Y coordinates of different lengths\nInitializing to empty lists") |
| 642 else: | 642 else: |
| 643 self.positions = [S,Y] | 643 self.positions = [S,Y] |
| 644 if lanes == None or len(lanes) != self.length(): | 644 if lanes == None or len(lanes) != self.length(): |
| 645 self.lanes = [] | 645 self.lanes = [] |
