Mercurial Hosting > traffic-intelligence
changeset 471:a8f95bbd79bc
merge done
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 12 Mar 2014 13:36:54 -0400 |
parents | a84b9ba9631f (diff) 7d2310f64511 (current diff) |
children | a50c026fdf14 |
files | |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/python/prediction.py Thu Mar 06 15:01:33 2014 -0500 +++ b/python/prediction.py Wed Mar 12 13:36:54 2014 -0400 @@ -66,6 +66,15 @@ self.predictedPositions = {0: initialPosition} self.predictedSpeedOrientations = {0: moving.NormAngle.fromPoint(initialVelocity)} + def predictPosition(self, nTimeSteps): + if nTimeSteps > 0 and not nTimeSteps in self.predictedPositions.keys(): + if constantSpeed: + # calculate cumulative distance + pass + else: # see c++ code, calculate ratio + pass + return self.predictedPositions[nTimeSteps] + class PredictedTrajectoryRandomControl(PredictedTrajectory): '''Random vehicle control: suitable for normal adaptation''' def __init__(self, initialPosition, initialVelocity, accelerationDistribution, steeringDistribution, probability = 1., maxSpeed = None):