diff python/prediction.py @ 467:08b67c9baca2

finished description and constructor
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 05 Mar 2014 23:01:00 -0500
parents e891a41c6c75
children a84b9ba9631f
line wrap: on
line diff
--- 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'''