Mercurial Hosting > traffic-intelligence
view python/tests/indicators.txt @ 251:4978b5baf8f1
Win32 version for traffic intelligence. Use the README-Win32.txt to know how to
fetch the dependencies. A batch file is included to automate most of the process
author | Jeep-Tour@Jeep-Tour-PC |
---|---|
date | Mon, 23 Jul 2012 12:27:50 -0400 |
parents | 8f0ed138d373 |
children | 5957aa1d69e1 |
line wrap: on
line source
>>> from indicators import * >>> from moving import TimeInterval,Trajectory >>> indic1 = TemporalIndicator('bla', [0,3,-4], TimeInterval(4,6)) >>> indic1.empty() False >>> indic1[5] 3 >>> indic1[3] >>> [v for v in indic1] [0, 3, -4] >>> indic1 = TemporalIndicator('bla', {2:0,4:3,5:-5}) >>> indic1[4] 3 >>> indic1[3] >>> [v for v in indic1] [0, 3, -5] >>> t1 = Trajectory([[0.5,1.5,2.5],[0.5,3.5,6.5]]) >>> indicatorMap([1,2,3], t1, 1) {(1.0, 3.0): 2.0, (2.0, 6.0): 3.0, (0.0, 0.0): 1.0} >>> indicatorMap([1,2,3], t1, 4) {(0.0, 1.0): 3.0, (0.0, 0.0): 1.5}