Mercurial Hosting > traffic-intelligence
comparison python/tests/moving.txt @ 69:cc192d0450b3
added full support for two implementations of indicators, with tests
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 10 Nov 2010 23:41:49 -0500 |
parents | 6d11d9e7ad4e |
children | 5d487f183fe2 |
comparison
equal
deleted
inserted
replaced
68:846fa9dc47de | 69:cc192d0450b3 |
---|---|
23 13 | 23 13 |
24 | 24 |
25 >>> Point.distanceNorm2(Point(3,4),Point(1,7)) | 25 >>> Point.distanceNorm2(Point(3,4),Point(1,7)) |
26 3.6055512754639891 | 26 3.6055512754639891 |
27 | 27 |
28 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) | |
29 >>> t1.length() | |
30 3 | |
31 >>> t1[1] | |
32 (1.500000,3.500000) | |
33 | |
34 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) | |
35 >>> indic1.empty() | |
36 False | |
37 >>> indic1[5] | |
38 3 | |
39 >>> indic1[3] | |
40 >>> [v for v in indic1] | |
41 [0, 3, -4] | |
42 >>> indic1 = TemporalIndicator('bla', {2:0,4:3,5:-5}) | |
43 >>> indic1[4] | |
44 3 | |
45 >>> indic1[3] | |
46 >>> [v for v in indic1] | |
47 [0, 3, -5] | |
48 | |
49 >>> indicatorMap([1,2,3], t1, 1) | |
50 {(1.0, 3.0): 2.0, (2.0, 6.0): 3.0, (0.0, 0.0): 1.0} | |
51 >>> indicatorMap([1,2,3], t1, 4) | |
52 {(0.0, 1.0): 3.0, (0.0, 0.0): 1.5} |