54 double emergencyDecel,
double apparentDecel,
55 double dawdle,
double headwayTime) :
84 const double vDawdle =
MAX2(vMin,
dawdle2(vMax, sigma));
88 assert(vNext >= vMin);
89 assert(vNext <= vMax);
91 #ifdef DEBUG_MOVE_HELPER 93 std::cout <<
"\nMOVE_HELPER\n" 94 <<
"veh '" << veh->
getID() <<
"' vMin=" << vMin
95 <<
" vMax=" << vMax <<
" vDawdle=" << vDawdle
96 <<
" vSafe" << vSafe <<
" vNext=" << vNext <<
" vPos=" << vPos <<
" veh->getSpeed()=" << oldV
121 return MIN2(vsafe, vmax);
125 return MAX2(
MIN2(vsafe, vmax), vmin);
151 return MAX2(0., speed);
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
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.
double myApparentDecel
The vehicle's deceleration as expected by surrounding traffic [m/s^2].
MSLane * getLane() const
Returns the lane the vehicle is on.
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.
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.
MSAbstractLaneChangeModel & getLaneChangeModel()
virtual double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change. It uses information on LC-related desired ...
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points...
virtual double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
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
double myDecel
The vehicle's maximum deceleration [m/s^2].
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 processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
double dawdle2(double speed, double sigma) const
Applies driver imperfection (dawdling / sigma)
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
static bool gSemiImplicitEulerUpdate
bool passingMinor() const
decide whether the vehicle is passing a minor link or has comitted to do so
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
double getSpeed() const
Returns the vehicle's current speed.
const std::string & getID() const
Returns the name of the vehicle.
MSCFModel_Krauss(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double dawdle, double headwayTime)
Constructor.