40 myTwoSqrtAccelDecel(double(2 * sqrt(myAccel * myDecel))) {
84 const double vNext = veh->
getSpeed() + acc;
85 const double gap = (vNext - vL) * (veh->
getSpeed() + vL) / (2 *
myDecel) + vL;
94 const double predSpeed,
const double desSpeed,
const bool respectMinGap)
const {
103 double newSpeed = egoSpeed;
104 double gap = gap2pred;
106 const double delta_v = newSpeed - predSpeed;
111 const double acc =
myAccel * (1. - pow(newSpeed / desSpeed,
myDelta) - (s * s) / (gap * gap));
117 return MAX2(0., newSpeed);
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
~MSCFModel_IDM()
Destructor.
Representation of a vehicle in the micro simulation.
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
const MSVehicleType * myType
The type to which this model definition belongs to.
MSLane * getLane() const
Returns the lane the vehicle is on.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
const bool myIDMM
whether the model is IDMM or IDM
const double myDelta
The IDM delta exponent.
The car-following model abstraction.
const double myAdaptationFactor
The IDMM adaptation factor beta.
double myAccel
The vehicle's maximum acceleration [m/s^2].
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
MSCFModel_IDM(const MSVehicleType *vtype, bool idmm)
Constructor.
virtual double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
The car-following model and parameter.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
const double myAdaptationTime
The IDMM adaptation time tau.
double levelOfService
state variable for remembering speed deviation history (lambda)
double _v(const MSVehicle *const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap=true) const
double getMinGap() const
Get the free space in front of vehicles of this class.
const double myTwoSqrtAccelDecel
A computational shortcut.
double maximumSafeStopSpeed(double gap, double currentSpeed, bool onInsertion=false, double headway=-1) const
Returns the maximum next velocity for stopping within gap.
double myDecel
The vehicle's maximum deceleration [m/s^2].
const int myIterations
The number of iterations in speed calculations.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle's safe speed (no dawdling)
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
double getSpeed() const
Returns the vehicle's current speed.