47 :
MSCFModel(vtype, accel, decel, headwayTime), myDelta(delta),
48 myAdaptationFactor(1.), myAdaptationTime(0.),
49 myIterations(
MAX2(1, int(
TS / internalStepping + .5))),
50 myTwoSqrtAccelDecel(
SUMOReal(2 * sqrt(accel* decel))) {
59 :
MSCFModel(vtype, accel, decel, headwayTime), myDelta(4.),
60 myAdaptationFactor(adaptationFactor), myAdaptationTime(adaptationTime),
61 myIterations(
MAX2(1, int(
TS / internalStepping + .5))),
62 myTwoSqrtAccelDecel(
SUMOReal(2 * sqrt(accel* decel))) {
88 if (gap2pred < 0.01) {
112 const SUMOReal predSpeed,
const SUMOReal desSpeed,
const bool respectMinGap)
const {
124 const SUMOReal delta_v = newSpeed - predSpeed;
SUMOReal stopSpeed(const MSVehicle *const veh, const SUMOReal speed, SUMOReal gap2pred) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
~MSCFModel_IDM()
Destructor.
Representation of a vehicle in the micro simulation.
const MSVehicleType * myType
The type to which this model definition belongs to.
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
The car-following model abstraction.
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
const SUMOReal myDelta
The IDM delta exponent.
SUMOReal levelOfService
state variable for remembering speed deviation history (lambda)
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
The car-following model and parameter.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
MSCFModel_IDM(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal headwayTime, SUMOReal delta, SUMOReal internalStepping)
Constructor.
SUMOReal getMinGap() const
Get the free space in front of vehicles of this class.
const SUMOReal myTwoSqrtAccelDecel
A computational shortcut.
SUMOReal interactionGap(const MSVehicle *const , SUMOReal 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.
virtual SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
SUMOReal desiredSpeed(const MSVehicle *const veh) const
const int myIterations
The number of iterations in speed calculations.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
SUMOReal _v(const MSVehicle *const veh, const SUMOReal gap2pred, const SUMOReal mySpeed, const SUMOReal predSpeed, const SUMOReal desSpeed, const bool respectMinGap=true) const
const SUMOReal myAdaptationFactor
The IDMM adaptation factor beta.
const SUMOReal myAdaptationTime
The IDMM adaptation time tau.
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].