70 return MIN2(vsafe, vmax);
74 return MAX2(
MIN2(vsafe, vmax), vmin);
MSCFModel_Krauss(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime)
Constructor.
Representation of a vehicle in the micro simulation.
SUMOReal maximumSafeStopSpeed(SUMOReal gap, SUMOReal currentSpeed, bool onInsertion=false, SUMOReal headway=-1) const
Returns the maximum next velocity for stopping within gap.
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
The car-following model abstraction.
virtual SUMOReal vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Returns the "safe" velocity.
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
static SUMOReal rand()
Returns a random real number in [0, 1)
The original Krauss (1998) car-following model and parameter.
~MSCFModel_Krauss()
Destructor.
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) this uses the m...
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
SUMOReal minNextSpeed(SUMOReal 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 and parameter.
SUMOReal myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) this uses the maximumSafeFollowSpeed.
SUMOReal maximumSafeFollowSpeed(SUMOReal gap, SUMOReal egoSpeed, SUMOReal predSpeed, SUMOReal predMaxDecel, bool onInsertion=false) const
Returns the maximum safe velocity for following the given leader.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
static bool gSemiImplicitEulerUpdate
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].