47 double emergencyDecel,
double apparentDecel,
48 double dawdle,
double headwayTime) :
71 return MIN2(vsafe, vmax);
75 return MAX2(
MIN2(vsafe, vmax), vmin);
101 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 myApparentDecel
The vehicle's deceleration as expected by surrounding traffic [m/s^2].
virtual double minNextSpeed(double speed, const MSVehicle *const veh=0) const
Returns the minimum speed given the current speed (depends on the numerical update scheme and its ste...
The car-following model abstraction.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) this uses the maximumSafeFollowSpeed.
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.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
static double rand()
Returns a random real number in [0, 1)
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.
double myDecel
The vehicle's maximum deceleration [m/s^2].
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
static bool gSemiImplicitEulerUpdate
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
MSCFModel_Krauss(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double dawdle, double headwayTime)
Constructor.
double dawdle(double speed) const
Applies driver imperfection (dawdling / sigma)