43 #define DEBUG_COND (veh->getID()=="disabled") 50 :
MSCFModel(vtype, accel, decel, headwayTime), myDawdle(dawdle), myTauDecel(decel * headwayTime) {}
78 #ifdef DEBUG_EXECUTE_MOVE 80 std::cout <<
"\nMOVE_HELPER\n" 81 <<
"veh '" << veh->
getID() <<
"' vMin=" << vMin
82 <<
" vMax=" << vMax <<
" vDawdle=" << vDawdle
83 <<
" vSafe" << vSafe <<
" vNext=" << vNext
112 return followSpeed(veh, speed, gap2pred, predSpeed, predMaxDecel);
148 if (predSpeed == 0 && gap < 0.01) {
157 + (predSpeed * predSpeed)
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
Representation of a vehicle in the micro simulation.
SUMOReal maximumSafeStopSpeedBallistic(SUMOReal gap, SUMOReal currentSpeed, bool onInsertion=false, SUMOReal headway=-1) const
Returns the maximum next velocity for stopping within gap when using the ballistic positional update...
MSLane * getLane() const
Returns the lane the vehicle is on.
The car-following model abstraction.
~MSCFModel_KraussOrig1()
Destructor.
SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
SUMOReal getMaxDecel() const
Get the vehicle type's maximum deceleration [m/s^2].
static SUMOReal rand()
Returns a random real number in [0, 1)
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
SUMOReal myTauDecel
The precomputed value for myDecel*myTau.
virtual 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) ...
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 insertionFollowSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling) This method is used during the insertion stage...
MSAbstractLaneChangeModel & getLaneChangeModel()
SUMOReal myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
virtual SUMOReal vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Returns the "safe" velocity.
MSCFModel_KraussOrig1(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime)
Constructor.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
SUMOReal maximumSafeFollowSpeed(SUMOReal gap, SUMOReal egoSpeed, SUMOReal predSpeed, SUMOReal predMaxDecel, bool onInsertion=false) const
Returns the maximum safe velocity for following the given leader.
virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change.
static bool gSemiImplicitEulerUpdate
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
const std::string & getID() const
Returns the name of the vehicle.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)