comparison 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
comparison
equal deleted inserted replaced
466:e891a41c6c75 467:08b67c9baca2
52 The prototype is in the format of a moving.Trajectory: it could be 52 The prototype is in the format of a moving.Trajectory: it could be
53 1. an observed trajectory (extracted from video) 53 1. an observed trajectory (extracted from video)
54 2. a generic polyline (eg the road centerline) that a vehicle is supposed to follow 54 2. a generic polyline (eg the road centerline) that a vehicle is supposed to follow
55 55
56 Prediction can be done 56 Prediction can be done
57 1. at constant speed (the instant speed of the user''' 57 1. at constant speed (the instantaneous user speed)
58 58 2. following the trajectory path, at the speed of the user
59 def __init__(self) 59 (applying a constant ratio equal
60 to the ratio of the user instantaneous speed and the trajectory closest speed)'''
61
62 def __init__(self, initialPosition, initialVelocity, prototypeTrajectory, constantSpeed = True, probability = 1.):
63 self.prototypeTrajectory = prototypeTrajectory
64 self.constantSpeed = constantSpeed
65 self.probability = probability
66 self.predictedPositions = {0: initialPosition}
67 self.predictedSpeedOrientations = {0: moving.NormAngle.fromPoint(initialVelocity)}
60 68
61 class PredictedTrajectoryRandomControl(PredictedTrajectory): 69 class PredictedTrajectoryRandomControl(PredictedTrajectory):
62 '''Random vehicle control: suitable for normal adaptation''' 70 '''Random vehicle control: suitable for normal adaptation'''
63 def __init__(self, initialPosition, initialVelocity, accelerationDistribution, steeringDistribution, probability = 1., maxSpeed = None): 71 def __init__(self, initialPosition, initialVelocity, accelerationDistribution, steeringDistribution, probability = 1., maxSpeed = None):
64 '''Constructor 72 '''Constructor