55 double accel,
double decel,
double emergencyDecel,
double apparentDecel,
56 double security,
double estimation) :
57 MSCFModel(vtype, accel, decel, emergencyDecel, apparentDecel, 1.0),
59 myEstimation(estimation),
60 myAX(vtype->getLength() + 1. + 2. * security),
61 myCX(25. *(1. + security + estimation)),
62 myMinAccel(0.2 * myAccel) {
80 return _v(veh, predSpeed, gap2pred);
115 const double dv = v - predSpeed;
118 const double sdx =
myAX + ex * (bx -
myAX);
119 const double sdv_root = (dx -
myAX) /
myCX;
120 const double sdv = sdv_root * sdv_root;
121 const double cldv = sdv * ex * ex;
127 }
else if (dx < sdx) {
130 }
else if (dv > opdv) {
136 if (dv > sdv && dx <
D_MAX) {
151 double bmax = 0.2 + 0.8 *
myAccel * (7 - sqrt(v));
153 double accel = dx <= 2 * bx ?
MIN2(
myMinAccel, bmax * (dx - bx) / bx) : bmax;
171 return 0.5 * dv * dv / (bx - dx);
200 if (predSpeed == 0 && gap < 0.01) {
205 const int predSteps = int(predSpeed / speedReduction);
206 const double leaderContrib = 2. *
myDecel * (gap +
SPEED2DIST(predSteps * predSpeed - speedReduction * predSteps * (predSteps + 1) / 2));
207 return (
double)(-tauDecel + sqrt(tauDecel * tauDecel + leaderContrib));
Representation of a vehicle in the micro simulation.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
const MSVehicleType * myType
The type to which this model definition belongs to.
double krauss_vsafe(double gap, double predSpeed) const
vsafe from krauss since Wiedemann is deficient at approaching
double myApparentDecel
The vehicle's deceleration as expected by surrounding traffic [m/s^2].
const double myCX
perception threshold modifier
const double mySecurity
The driver's security parameter // also 'ZF1'.
The car-following model abstraction.
double stopSpeed(const MSVehicle *const veh, const double speed, double gap) const
Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) ...
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].
virtual double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
double following(double sign) const
#define UNUSED_PARAMETER(x)
The car-following model and parameter.
double getMaxSpeed() const
Returns the maximum speed.
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
static double randNorm(double mean, double variance, std::mt19937 *rng=0)
Access to a random number from a normal distribution.
double _v(const MSVehicle *veh, double predSpeed, double gap) const
static const double D_MAX
free-flow distance in m
double emergency(double dv, double dx) const
~MSCFModel_Wiedemann()
Destructor.
virtual double getSpeedAfterMaxDecel(double v) const
Returns the velocity after maximum deceleration.
double accelSign
state variable for remembering the drift direction
double myDecel
The vehicle's maximum deceleration [m/s^2].
double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
double approaching(double dv, double dx, double bx) const
double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
const double myMinAccel
The vehicle's minimum acceleration [m/s^2].
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
double getLength() const
Get vehicle's length [m].
const double myEstimation
The driver's estimation parameter // also 'ZF2'.
double myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
double getSpeed() const
Returns the vehicle's current speed.
const double myAX
front-bumper to front-bumper distance
MSCFModel_Wiedemann(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double security, double estimation)
Constructor.
double fullspeed(double v, double vpref, double dx, double bx) const