comparison python/tests/moving.txt @ 887:e2452abba0e7

added option to compute PET in safety analysis script, and save in database
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 22 Mar 2017 10:44:24 -0400
parents 84420159c5f4
children 3a06007a4bb7
comparison
equal deleted inserted replaced
886:d2eb8c93f7de 887:e2452abba0e7
172 True 172 True
173 173
174 >>> o1 = MovingObject.generate(Point(-5.,0.), Point(1.,0.), TimeInterval(0,10)) 174 >>> o1 = MovingObject.generate(Point(-5.,0.), Point(1.,0.), TimeInterval(0,10))
175 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(0,10)) 175 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(0,10))
176 >>> MovingObject.computePET(o1, o2, 0.1) 176 >>> MovingObject.computePET(o1, o2, 0.1)
177 0.0 177 (0.0, 5, 5)
178 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(5,15)) 178 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(5,15))
179 >>> MovingObject.computePET(o1, o2, 0.1) 179 >>> MovingObject.computePET(o1, o2, 0.1)
180 5.0 180 (5.0, 5, 10)
181 >>> o2 = MovingObject.generate(Point(0.,-5.), Point(0.,1.), TimeInterval(15,30))
182 >>> MovingObject.computePET(o1, o2, 0.1)
183 (15.0, 5, 20)
181 184
182 >>> t = CurvilinearTrajectory(S = [1., 2., 3., 5.], Y = [0.5, 0.5, 0.6, 0.7], lanes = ['1']*4) 185 >>> t = CurvilinearTrajectory(S = [1., 2., 3., 5.], Y = [0.5, 0.5, 0.6, 0.7], lanes = ['1']*4)
183 >>> t.differentiate() # doctest:+ELLIPSIS 186 >>> t.differentiate() # doctest:+ELLIPSIS
184 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1'] 187 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1']
185 >>> t.differentiate(True) # doctest:+ELLIPSIS 188 >>> t.differentiate(True) # doctest:+ELLIPSIS