comparison python/tests/moving.txt @ 582:7e1ae4d97f1a

corrected bug for curvilinear trajectory with only one position and differentiation
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 18 Sep 2014 15:36:57 -0400
parents d0abd2ee17b9
children 6ebfb43e938e
comparison
equal deleted inserted replaced
581:10e8a9f2bd9f 582:7e1ae4d97f1a
142 >>> t = CurvilinearTrajectory(S = [1., 2., 3., 5.], Y = [0.5, 0.5, 0.6, 0.7], lanes = ['1']*4) 142 >>> t = CurvilinearTrajectory(S = [1., 2., 3., 5.], Y = [0.5, 0.5, 0.6, 0.7], lanes = ['1']*4)
143 >>> t.differentiate() # doctest:+ELLIPSIS 143 >>> t.differentiate() # doctest:+ELLIPSIS
144 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1'] 144 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1']
145 >>> t.differentiate(True) # doctest:+ELLIPSIS 145 >>> t.differentiate(True) # doctest:+ELLIPSIS
146 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1'] [2.0, 0.099..., '1'] 146 [1.0, 0.0, '1'] [1.0, 0.099..., '1'] [2.0, 0.099..., '1'] [2.0, 0.099..., '1']
147 >>> t = CurvilinearTrajectory(S = [1.], Y = [0.5], lanes = ['1'])
148 >>> t.differentiate().empty()
149 True
147 150
148 >>> o1 = MovingObject(positions = Trajectory([[0]*3,[2]*3]), velocities = Trajectory([[0]*3,[1]*3])) 151 >>> o1 = MovingObject(positions = Trajectory([[0]*3,[2]*3]), velocities = Trajectory([[0]*3,[1]*3]))
149 >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median) 152 >>> o1.classifyUserTypeSpeedMotorized(0.5, np.median)
150 >>> userTypeNames[o1.getUserType()] 153 >>> userTypeNames[o1.getUserType()]
151 'car' 154 'car'