38 myK(vtype->getParameter().getCFParam(
SUMO_ATTR_K, 0.5)),
40 myTauDecel(myDecel * myHeadwayTime) {
81 if (predSpeed == 0 && gap < 0.01) {
89 double va =
MAX2((
double) 0,
MIN3(vfree, vsafe, vcond)) + vars->
rand;
@ SUMO_ATTR_CF_KERNER_PHI
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
T MIN4(T a, T b, T c, T d)
car-following model by B. Kerner
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
~MSCFModel_Kerner()
Destructor.
double myTauDecel
The precomputed value for myDecel*myTau.
double myPhi
Kerner's phi.
double _v(const MSVehicle *const veh, double speed, double vfree, double gap, double predSpeed) const
Returns the "safe" velocity.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed (no dawdling)
MSCFModel::VehicleVariables * createVehicleVariables() const
Returns model specific values which are stored inside a vehicle and must be used with casting.
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
MSCFModel_Kerner(const MSVehicleType *vtype)
Constructor.
The car-following model abstraction.
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
virtual double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
CalcReason
What the return value of stop/follow/free-Speed is used for.
double myCollisionMinGapFactor
The factor of minGap that must be maintained to avoid a collision event.
double myDecel
The vehicle's maximum deceleration [m/s^2].
double myAccel
The vehicle's maximum acceleration [m/s^2].
Representation of a vehicle in the micro simulation.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
The car-following model and parameter.
const SUMOVTypeParameter & getParameter() const
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1)
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.