48#define PRED_DECEL_MULT 0.5
49#define PRED_DECEL_MULT_EMERGENCY 0.55
58 myAX(vtype->getLength() + 1. + 2. * mySecurity),
59 myCX(25. *(1. + mySecurity + myEstimation)),
60 myMinAccel(0.2 * myAccel),
61 myMaxApproachingDecel((myDecel + myEmergencyDecel) / 2) {
81 return _v(veh, predSpeed, gap2pred, pred !=
nullptr ? pred->
getAcceleration() : 0);
112 const double bx = (1 + 7 *
mySecurity) * sqrt(speed);
124 const double dv = v - predSpeed;
126 const double bx = (1 + 7 *
mySecurity) * sqrt(v);
127 const double abx =
myAX + bx;
129 const double sdx =
myAX + ex * bx;
130 const double sdv_root = (dx -
myAX) /
myCX;
131 const double sdv = sdv_root * sdv_root;
132 const double cldv = sdv * ex * ex;
140 accel =
emergency(dv, dx, predAccel, v, gap, abx, bx);
142 }
else if (dx < sdx) {
146 }
else if (dv > opdv) {
154 if (dv > sdv && dx < dmax) {
164 const double rawAccel = accel;
170 std::cout <<
SIMTIME <<
" Wiedemann::_v veh=" << veh->
getID()
171 <<
" v=" << v <<
" pV=" << predSpeed <<
" pA=" << predAccel <<
" gap=" << gap
172 <<
" dv=" << dv <<
" dx=" << dx <<
" ax=" <<
myAX <<
" bx=" << bx <<
" abx=" << abx
173 <<
" sdx=" << sdx <<
" sdv=" << sdv <<
" cldv=" << cldv <<
" opdv=" << opdv
174 <<
" branch=" << branch <<
" rawAccel=" << rawAccel
175 <<
" accel=" << accel <<
" vNew=" << vNew <<
"\n";
187 double bmax = 0.2 + 0.8 *
myAccel * (7 - sqrt(v));
189 double accel = dx <= 2 * abx ?
MIN2(
myMinAccel, bmax * (dx - abx) / abx) : bmax;
223 const double accel = (0.5 * dv * dv / (
myAX - dx)
225 + bmin * (abx - gap) / bx);
#define PRED_DECEL_MULT_EMERGENCY
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
@ SUMO_ATTR_COLLISION_MINGAP_FACTOR
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
#define UNUSED_PARAMETER(x)
double getMaxSpeed() const
Returns the maximum speed (the minimum of desired and technical maximum speed)
virtual bool isSelected() const
whether this vehicle is selected in the GUI
double accelSign
state variable for remembering the drift direction
The Wiedemann Model car-following model.
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double following(double sign) const
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
double getSecureGap(const MSVehicle *const veh, const MSVehicle *const pred, const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
~MSCFModel_Wiedemann()
Destructor.
const double myMinAccel
The vehicle's minimum acceleration [m/s^2] // also b_null.
double approaching(double dv, double dx, double abx, double predAccel) const
double stopSpeed(const MSVehicle *const veh, const double speed, double gap, double decel, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling)
const double myMaxApproachingDecel
The maximum deceleration when approaching.
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0, const CalcReason usage=CalcReason::CURRENT) const
Computes the vehicle's safe speed (no dawdling)
double _v(const MSVehicle *veh, double predSpeed, double gap, double predAccel) const
static const double D_MAX
free-flow distance in m
const double myEstimation
The driver's estimation parameter // also 'ZF2'.
double fullspeed(double v, double vpref, double dx, double bx) const
MSCFModel_Wiedemann(const MSVehicleType *vtype)
Constructor.
double emergency(double dv, double dx, double predAccel, double v, double gap, double abx, double bx) const
const double myAX
the minimum front-bumper to front-bumper distance when standing
const double myCX
perception threshold modifier
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
const double mySecurity
The driver's security parameter // also 'ZF1'.
The car-following model abstraction.
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
virtual double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
CalcReason
What the return value of stop/follow/free-Speed is used for.
virtual double getSecureGap(const MSVehicle *const veh, const MSVehicle *const, const double speed, const double leaderSpeed, const double leaderMaxDecel) const
Returns the minimum gap to reserve if the leader is braking at maximum (>=0)
double myCollisionMinGapFactor
The factor of minGap that must be maintained to avoid a collision event.
double myDecel
The vehicle's maximum deceleration [m/s^2].
double brakeGap(const double speed) const
Returns the distance the vehicle needs to halt including driver's reaction time tau (i....
double maximumSafeStopSpeed(double gap, double decel, double currentSpeed, bool onInsertion=false, double headway=-1, bool relaxEmergency=true) const
Returns the maximum next velocity for stopping within gap.
double myAccel
The vehicle's maximum acceleration [m/s^2].
const MSVehicleType * myType
The type to which this model definition belongs to.
static bool gComputeLC
whether the simulationLoop is in the lane changing phase
Representation of a vehicle in the micro simulation.
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
double getAcceleration() const
Returns the vehicle's acceleration in m/s (this is computed as the last step's mean acceleration in c...
double getSpeed() const
Returns the vehicle's current speed.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
The car-following model and parameter.
double getLength() const
Get vehicle's length [m].
const SUMOVTypeParameter & getParameter() const
const std::string & getID() const
Returns the id.
static double randNorm(double mean, double variance, SumoRNG *rng=nullptr)
Access to a random number from a normal distribution.
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.