Mercurial Hosting > traffic-intelligence
diff python/prediction.py @ 469:7d2310f64511
merge done
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 06 Mar 2014 15:01:33 -0500 |
parents | 08b67c9baca2 |
children | a84b9ba9631f |
line wrap: on
line diff
--- a/python/prediction.py Thu Mar 06 15:01:19 2014 -0500 +++ b/python/prediction.py Thu Mar 06 15:01:33 2014 -0500 @@ -54,9 +54,17 @@ 2. a generic polyline (eg the road centerline) that a vehicle is supposed to follow Prediction can be done - 1. at constant speed (the instant speed of the user''' + 1. at constant speed (the instantaneous user speed) + 2. following the trajectory path, at the speed of the user + (applying a constant ratio equal + to the ratio of the user instantaneous speed and the trajectory closest speed)''' - def __init__(self) + def __init__(self, initialPosition, initialVelocity, prototypeTrajectory, constantSpeed = True, probability = 1.): + self.prototypeTrajectory = prototypeTrajectory + self.constantSpeed = constantSpeed + self.probability = probability + self.predictedPositions = {0: initialPosition} + self.predictedSpeedOrientations = {0: moving.NormAngle.fromPoint(initialVelocity)} class PredictedTrajectoryRandomControl(PredictedTrajectory): '''Random vehicle control: suitable for normal adaptation'''