Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/tests/moving.txt @ 1064:cbc026dacf0b
changed interval string representation
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 15 Jul 2018 22:52:26 -0400 |
| parents | fc7c0f38e8a6 |
| children | 7853106677b7 |
comparison
equal
deleted
inserted
replaced
| 1063:3c37d8d20e97 | 1064:cbc026dacf0b |
|---|---|
| 5 >>> Interval().empty() | 5 >>> Interval().empty() |
| 6 True | 6 True |
| 7 >>> Interval(0,1).empty() | 7 >>> Interval(0,1).empty() |
| 8 False | 8 False |
| 9 >>> Interval(0,1) | 9 >>> Interval(0,1) |
| 10 [0, 1] | 10 0-1 |
| 11 >>> Interval(0,1).length() | 11 >>> Interval(0,1).length() |
| 12 1.0 | 12 1.0 |
| 13 >>> Interval(23.2,24.9).length() | 13 >>> Interval(23.2,24.9).length() |
| 14 1.6999999999999993 | 14 1.6999999999999993 |
| 15 >>> Interval(10,8).length() | 15 >>> Interval(10,8).length() |
| 16 0.0 | 16 0.0 |
| 17 | |
| 18 >>> i = Interval.parse('3-5') | |
| 19 >>> i.first == 3 and i.last == 5 | |
| 20 True | |
| 21 >>> type(i) | |
| 22 <class 'trafficintelligence.moving.Interval'> | |
| 23 >>> i = TimeInterval.parse('3-5') | |
| 24 >>> type(i) | |
| 25 <class 'trafficintelligence.moving.TimeInterval'> | |
| 26 >>> list(i) | |
| 27 [3, 4, 5] | |
| 17 | 28 |
| 18 >>> TimeInterval(0,1).length() | 29 >>> TimeInterval(0,1).length() |
| 19 2.0 | 30 2.0 |
| 20 >>> TimeInterval(10,8).length() | 31 >>> TimeInterval(10,8).length() |
| 21 0.0 | 32 0.0 |
| 43 >>> TimeInterval(3,6).distance(TimeInterval(8,10)) | 54 >>> TimeInterval(3,6).distance(TimeInterval(8,10)) |
| 44 2 | 55 2 |
| 45 >>> TimeInterval(20,30).distance(TimeInterval(3,15)) | 56 >>> TimeInterval(20,30).distance(TimeInterval(3,15)) |
| 46 5 | 57 5 |
| 47 >>> TimeInterval.unionIntervals([TimeInterval(3,6), TimeInterval(8,10),TimeInterval(11,15)]) | 58 >>> TimeInterval.unionIntervals([TimeInterval(3,6), TimeInterval(8,10),TimeInterval(11,15)]) |
| 48 [3, 15] | 59 3-15 |
| 49 | 60 |
| 50 >>> Point(0,3) == Point(0,3) | 61 >>> Point(0,3) == Point(0,3) |
| 51 True | 62 True |
| 52 >>> Point(0,3) == Point(0,3.2) | 63 >>> Point(0,3) == Point(0,3.2) |
| 53 False | 64 False |
