42 #define DEBUG_COND (veh->getID()=="disabled") 48 double emergencyDecel,
double apparentDecel,
49 double dawdle,
double headwayTime) :
50 MSCFModel(vtype, accel, decel, emergencyDecel, apparentDecel, headwayTime), myDawdle(dawdle),
51 myTauDecel(decel * headwayTime) {}
63 double vMax =
MAX2(vMin,
71 const double vDawdle =
MAX2(vMin,
dawdle(vMax));
75 #ifdef DEBUG_MOVE_HELPER 77 std::cout <<
"\nMOVE_HELPER\n" 78 <<
"veh '" << veh->
getID() <<
"' vMin=" << vMin
79 <<
" vMax=" << vMax <<
" vDawdle=" << vDawdle
80 <<
" vSafe" << vSafe <<
" vNext=" << vNext <<
" vPos=" << vPos <<
" veh->getSpeed()=" << oldV
110 return followSpeed(veh, speed, gap2pred, predSpeed, predMaxDecel);
146 if (predSpeed == 0 && gap < 0.01) {
155 + (predSpeed * predSpeed)
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 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.
~MSCFModel_KraussOrig1()
Destructor.
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.
double myAccel
The vehicle's maximum acceleration [m/s^2].
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 followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
MSCFModel_KraussOrig1(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double dawdle, double headwayTime)
Constructor.
double myDecel
The vehicle's maximum deceleration [m/s^2].
virtual double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
double insertionFollowSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) This method is used during the insertion stage...
virtual double vsafe(double gap, double predSpeed, double predMaxDecel) const
Returns the "safe" velocity.
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
double maximumSafeStopSpeedBallistic(double gap, double currentSpeed, bool onInsertion=false, double headway=-1) const
Returns the maximum next velocity for stopping within gap when using the ballistic positional update...
virtual 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) ...
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
static bool gSemiImplicitEulerUpdate
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myTauDecel
The precomputed value for myDecel*myTau.
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.
virtual double dawdle(double speed) const
Applies driver imperfection (dawdling / sigma)