Mercurial Hosting > traffic-intelligence
annotate trafficintelligence/tests/indicators.txt @ 1029:c6cf75a2ed08
reorganization of imports
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 18 Jun 2018 22:50:59 -0400 |
parents | cc5cb04b04b0 |
children | aafbc0bab925 |
rev | line source |
---|---|
247
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
1 >>> from indicators import * |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
2 >>> from moving import TimeInterval,Trajectory |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
3 |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
4 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
5 >>> indic1.empty() |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
6 False |
287
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
7 >>> indic1.getIthValue(1) |
247
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
8 3 |
287
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
9 >>> indic1.getIthValue(3) |
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
10 >>> indic1[6] |
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
11 -4 |
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
12 >>> indic1[7] |
247
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
13 >>> [v for v in indic1] |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
14 [0, 3, -4] |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
15 >>> indic1 = TemporalIndicator('bla', {2:0,4:3,5:-5}) |
287
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
16 >>> indic1.getIthValue(1) |
247
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
17 3 |
287
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
18 >>> indic1.getIthValue(3) |
285
5957aa1d69e1
Integrating Mohamed's changes
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
247
diff
changeset
|
19 >>> indic1[2] |
287
66691c06928c
first version of indicator LCSS
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
285
diff
changeset
|
20 0 |
247
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
21 |
8f0ed138d373
moved the tests for indicators
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
diff
changeset
|
22 >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) |
998
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
23 >>> m = indicatorMap([1,2,3], t1, 1) |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
24 >>> m[(1.0, 3.0)] |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
25 2.0 |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
26 >>> m[(2.0, 6.0)] |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
27 3.0 |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
28 >>> m[(0.0, 0.0)] |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
29 1.0 |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
30 >>> m = indicatorMap([1,2,3], t1, 4) |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
31 >>> m[(0.0, 1.0)] |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
32 3.0 |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
33 >>> m[(0.0, 0.0)] |
933670761a57
updated code to python 3 (tests pass and scripts run, but non-executed parts of code are probably still not correct)
Nicolas Saunier <nicolas.saunier@polymtl.ca>
parents:
287
diff
changeset
|
34 1.5 |