Mercurial Hosting > traffic-intelligence
diff python/prediction.py @ 466:e891a41c6c75
name change in prediction.py
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Wed, 05 Mar 2014 17:47:26 -0500 |
parents | dcc821b98efc |
children | 08b67c9baca2 |
line wrap: on
line diff
--- a/python/prediction.py Thu Feb 27 03:30:28 2014 -0500 +++ b/python/prediction.py Wed Mar 05 17:47:26 2014 -0500 @@ -47,8 +47,19 @@ def getControl(self): return self.control -class PredictedTrajectoryNormalAdaptation(PredictedTrajectory): - '''Random small adaptation of vehicle control ''' +class PredictedTrajectoryPrototype(PredictedTrajectory): + '''Predicted trajectory that follows a prototype trajectory + The prototype is in the format of a moving.Trajectory: it could be + 1. an observed trajectory (extracted from video) + 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''' + + def __init__(self) + +class PredictedTrajectoryRandomControl(PredictedTrajectory): + '''Random vehicle control: suitable for normal adaptation''' def __init__(self, initialPosition, initialVelocity, accelerationDistribution, steeringDistribution, probability = 1., maxSpeed = None): '''Constructor accelerationDistribution and steeringDistribution are distributions @@ -245,11 +256,11 @@ velocities = [obj.getVelocityAtInstant(instant)] for i in xrange(self.nPredictedTrajectories): for initialPosition,initialVelocity in zip(positions, velocities): - predictedTrajectories.append(PredictedTrajectoryNormalAdaptation(initialPosition, - initialVelocity, - self.accelerationDistribution, - self.steeringDistribution, - maxSpeed = self.maxSpeed)) + predictedTrajectories.append(PredictedTrajectoryRandomControl(initialPosition, + initialVelocity, + self.accelerationDistribution, + self.steeringDistribution, + maxSpeed = self.maxSpeed)) return predictedTrajectories class PointSetPredictionParameters(PredictionParameters):