41 #define DEBUG_COND (veh->isSelected()) 42 #define DEBUG_DRIVER_ERRORS 61 const double vDawdle =
MAX2(vMin,
dawdle2(vMax, sigma));
93 return MIN2(vsafe, vmax);
97 return MAX2(
MIN2(vsafe, vmax), vmin);
122 return MAX2(0., speed);
double maximumSafeFollowSpeed(double gap, double egoSpeed, double predSpeed, double predMaxDecel, bool onInsertion=false) const
Returns the maximum safe velocity for following the given leader.
Representation of a vehicle in the micro simulation.
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.
The car-following model abstraction.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
The original Krauss (1998) car-following model and parameter.
double myAccel
The vehicle's maximum acceleration [m/s^2].
~MSCFModel_Krauss()
Destructor.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap2pred) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) this uses the m...
The car-following model and parameter.
bool hasDriverState() const
Whether this vehicle is equipped with a MSDriverState.
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points...
MSCFModel_Krauss(const MSVehicleType *vtype)
Constructor.
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 ...
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
double maximumSafeStopSpeed(double gap, double currentSpeed, bool onInsertion=false, double headway=-1) const
Returns the maximum next velocity for stopping within gap.
const SUMOVTypeParameter & getParameter() const
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...
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
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) this uses the maximumSafeFollowSpeed.
double dawdle2(double speed, double sigma) const
Applies driver imperfection (dawdling / sigma)
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply custom speed adaptations within the given speed bounds
static bool gSemiImplicitEulerUpdate
bool passingMinor() const
decide whether the vehicle is passing a minor link or has comitted to do so
void applyHeadwayPerceptionError(const MSVehicle *const veh, double speed, double &gap) const
Overwrites gap by the perceived value obtained from the vehicle's driver state.