# HG changeset patch # User Nicolas Saunier # Date 1394136093 18000 # Node ID 7d2310f6451126715bb60a6e9cd3d745f6218914 # Parent 5304299e53a521781d018069cfe875559ec7a937# Parent 08b67c9baca2c66fe5f03e5c515a22a156e453ab merge done diff -r 5304299e53a5 -r 7d2310f64511 python/prediction.py --- 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'''