Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/moving.py @ 1209:2064e52019db
work on TTC for BEV
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 26 Apr 2023 23:36:32 -0400 |
| parents | 36f0d18e1fad |
| children | 1bad5f9b60de |
comparison
equal
deleted
inserted
replaced
| 1208:a07e455baaa6 | 1209:2064e52019db |
|---|---|
| 718 | 718 |
| 719 def empty(self): | 719 def empty(self): |
| 720 return self.__len__() == 0 | 720 return self.__len__() == 0 |
| 721 | 721 |
| 722 def __getitem__(self, i): | 722 def __getitem__(self, i): |
| 723 if isinstance(i, int) or issubdtype(i, npinteger): | 723 if isinstance(i, int):# or issubdtype(i, npinteger): |
| 724 return Point(self.positions[0][i], self.positions[1][i]) | 724 return Point(self.positions[0][i], self.positions[1][i]) |
| 725 elif isinstance(i, slice): | 725 elif isinstance(i, slice): |
| 726 return Trajectory([self.positions[0][i],self.positions[1][i]]) | 726 return Trajectory([self.positions[0][i],self.positions[1][i]]) |
| 727 else: | 727 else: |
| 728 raise TypeError("Invalid argument type.") | 728 raise TypeError("Invalid argument type.") |
