39#define DEBUG_COND (veh->isSelected())
40#define DEBUG_DRIVER_ERRORS
43 : accelDawdle(1e6), updateOffset(
SIMSTEP % dawdleStep +
DELTA_T) { }
106 const bool relaxEmergency = usage !=
FUTURE;
150 return MAX2(0., speed);
#define WRITE_WARNINGF(...)
@ SUMO_ATTR_JM_SIGMA_MINOR
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
double accelDawdle
the accleration due to dawdling
VehicleVariables(SUMOTime dawdleStep)
Krauss car-following model, with acceleration decrease and faster start.
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) this uses the maximumSafeFollowSpeed.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply custom speed adaptations within the given speed bounds
double dawdle2(double speed, double sigma, SumoRNG *rng) const
Applies driver imperfection (dawdling / sigma)
~MSCFModel_Krauss()
Destructor.
MSCFModel_Krauss(const MSVehicleType *vtype)
Constructor.
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) this uses the m...
SUMOTime myDawdleStep
The vehicle's update period for dawdling.
The original Krauss (1998) car-following model and parameter.
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
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 minNextSpeedEmergency(double speed, const MSVehicle *const veh=0) const
Returns the minimum speed after emergency braking, given the current speed (depends on the numerical ...
virtual std::string getParameter(const MSVehicle *veh, const std::string &key) const
try to get the given parameter for this carFollowingModel
void applyHeadwayPerceptionError(const MSVehicle *const veh, double speed, double &gap) const
Overwrites gap by the perceived value obtained from the vehicle's driver state.
void applyHeadwayAndSpeedDifferencePerceptionErrors(const MSVehicle *const veh, double speed, double &gap, double &predSpeed, double predMaxDecel, const MSVehicle *const pred) const
Overwrites gap2pred and predSpeed by the perceived values obtained from the vehicle's driver state,...
double maximumSafeFollowSpeed(double gap, double egoSpeed, double predSpeed, double predMaxDecel, bool onInsertion=false) const
Returns the maximum safe velocity for following the given leader.
CalcReason
What the return value of stop/follow/free-Speed is used for.
@ FUTURE
the return value is used for calculating future speeds
double maximumSafeStopSpeed(double gap, double decel, double currentSpeed, bool onInsertion=false, double headway=-1, bool relaxEmergency=true) const
Returns the maximum next velocity for stopping within gap.
double myAccel
The vehicle's maximum acceleration [m/s^2].
static bool gSemiImplicitEulerUpdate
double getVehicleMaxSpeed(const SUMOTrafficObject *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
Representation of a vehicle in the micro simulation.
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
const MSLane * getLane() const
Returns the lane the vehicle is on.
bool passingMinor() const
decide whether the vehicle is passing a minor link or has comitted to do so
double getSpeed() const
Returns the vehicle's current speed.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
The car-following model and parameter.
const std::string & getID() const
Returns the name of the vehicle type.
const SUMOVTypeParameter & getParameter() const
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1)
double getJMParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.