Mercurial > hg > nsaunier > traffic-intelligence
comparison python/tests/moving.txt @ 661:dc70d9e711f5
some method name change and new methods for features in objects (MovingObject) and methods to access indicator values in interactions
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Mon, 18 May 2015 13:53:25 +0200 |
| parents | 2d1d33ae1c69 |
| children | 01b89182891a |
comparison
equal
deleted
inserted
replaced
| 660:994dd644f6ab | 661:dc70d9e711f5 |
|---|---|
| 1 >>> from moving import * | 1 >>> from moving import * |
| 2 >>> import storage | |
| 2 >>> import numpy as np | 3 >>> import numpy as np |
| 3 | 4 |
| 4 >>> Interval().empty() | 5 >>> Interval().empty() |
| 5 True | 6 True |
| 6 >>> Interval(0,1).empty() | 7 >>> Interval(0,1).empty() |
| 134 True | 135 True |
| 135 >>> Point.timeToCollision(p2, p1, v2, v1, 0.) == None | 136 >>> Point.timeToCollision(p2, p1, v2, v1, 0.) == None |
| 136 True | 137 True |
| 137 >>> Point.midPoint(p1, p2) | 138 >>> Point.midPoint(p1, p2) |
| 138 (0.500000,0.500000) | 139 (0.500000,0.500000) |
| 140 | |
| 141 >>> objects = storage.loadTrajectoriesFromSqlite('../samples/laurier.sqlite', 'object') | |
| 142 >>> len(objects) | |
| 143 5 | |
| 144 >>> objects[0].hasFeatures() | |
| 145 False | |
| 146 >>> features = storage.loadTrajectoriesFromSqlite('../samples/laurier.sqlite', 'feature') | |
| 147 >>> for o in objects: o.setFeatures(features) | |
| 148 >>> objects[0].hasFeatures() | |
| 149 True | |
| 139 | 150 |
| 140 >>> o1 = MovingObject.generate(Point(-5.,0.), Point(1.,0.), TimeInterval(0,10)) | 151 >>> o1 = MovingObject.generate(Point(-5.,0.), Point(1.,0.), TimeInterval(0,10)) |
| 141 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(0,10)) | 152 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(0,10)) |
| 142 >>> MovingObject.computePET(o1, o2, 0.1) | 153 >>> MovingObject.computePET(o1, o2, 0.1) |
| 143 0.0 | 154 0.0 |
