Mercurial > hg > nsaunier > traffic-intelligence
comparison trafficintelligence/tests/indicators.txt @ 1256:56d0195d043e
cleaning indicators (no more time interval) and runtimeerror with arccos
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 03 Apr 2024 14:41:20 -0400 |
| parents | b1ba6d44fcb9 |
| children | 76f5693b530c |
comparison
equal
deleted
inserted
replaced
| 1255:c0fe55a6b82f | 1256:56d0195d043e |
|---|---|
| 1 >>> from trafficintelligence.indicators import * | 1 >>> from trafficintelligence.indicators import * |
| 2 >>> from trafficintelligence.moving import TimeInterval,Trajectory | 2 >>> from trafficintelligence.moving import TimeInterval, Trajectory |
| 3 | 3 |
| 4 >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) | 4 >>> indic1 = TemporalIndicator('bla', {4:0,5:3,6:-4}) |
| 5 >>> indic1.empty() | 5 >>> indic1.empty() |
| 6 False | 6 False |
| 7 >>> indic1.getIthValue(1) | 7 >>> indic1.getIthValue(1) |
| 8 3 | 8 3 |
| 9 >>> indic1.getIthValue(3) | 9 >>> indic1.getIthValue(3) |
| 17 3 | 17 3 |
| 18 >>> indic1.getIthValue(3) | 18 >>> indic1.getIthValue(3) |
| 19 >>> indic1[2] | 19 >>> indic1[2] |
| 20 0 | 20 0 |
| 21 | 21 |
| 22 >>> ttc = SeverityIndicator('TTC', list(range(11)), TimeInterval(1,11), mostSevereIsMax = False) | 22 >>> ttc = SeverityIndicator('TTC', {t:t-1 for t in TimeInterval(1,11)}, mostSevereIsMax = False) |
| 23 >>> ttc.getMostSevereValue(1) | 23 >>> ttc.getMostSevereValue(1) |
| 24 0.0 | 24 0.0 |
| 25 >>> ttc.getMostSevereValue(2) | 25 >>> ttc.getMostSevereValue(2) |
| 26 0.5 | 26 0.5 |
| 27 >>> ttc.getMostSevereValue(centile = 10.) | 27 >>> ttc.getMostSevereValue(centile = 10.) |
