# HG changeset patch # User Nicolas Saunier # Date 1394078460 18000 # Node ID 08b67c9baca2c66fe5f03e5c515a22a156e453ab # Parent e891a41c6c75fa468fa1a14313ac9234d78612d0 finished description and constructor diff -r e891a41c6c75 -r 08b67c9baca2 python/prediction.py --- a/python/prediction.py Wed Mar 05 17:47:26 2014 -0500 +++ b/python/prediction.py Wed Mar 05 23:01:00 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'''