 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
52 myAX(vtype->getLength() + 1. + 2. * mySecurity),
53 myCX(25. *(1. + mySecurity + myEstimation)),
54 myMinAccel(0.2 * myAccel) {
72 return _v(veh, predSpeed, gap2pred);
103 const double bx = (1 + 7 *
mySecurity) * sqrt(speed);
115 const double dv = v - predSpeed;
117 const double bx = (1 + 7 *
mySecurity) * sqrt(v);
118 const double abx =
myAX + bx;
120 const double sdx =
myAX + ex * bx;
121 const double sdv_root = (dx -
myAX) /
myCX;
122 const double sdv = sdv_root * sdv_root;
123 const double cldv = sdv * ex * ex;
129 }
else if (dx < sdx) {
132 }
else if (dv > opdv) {
138 if (dv > sdv && dx <
D_MAX) {
149 std::cout <<
SIMTIME <<
" Wiedemann::_v veh=" << veh->
getID()
150 <<
" predSpeed=" << predSpeed <<
" gap=" << gap
151 <<
" dv=" << dv <<
" dx=" << dx <<
" ax=" <<
myAX <<
" bx=" << bx <<
" abx=" << abx
152 <<
" sdx=" << sdx <<
" sdv=" << sdv <<
" cldv=" << cldv <<
" opdv=" << opdv
153 <<
" accel=" << accel <<
" vNew=" << vNew <<
"\n";
163 double bmax = 0.2 + 0.8 *
myAccel * (7 - sqrt(v));
165 double accel = dx <= 2 * abx ?
MIN2(
myMinAccel, bmax * (dx - abx) / abx) : bmax;
183 return 0.5 * dv * dv / (abx - dx);
192 double accel = 0.5 * dv * dv / (
myAX - dx);
The car-following model and parameter.
#define UNUSED_PARAMETER(x)
@ SUMO_ATTR_CF_WIEDEMANN_ESTIMATION
virtual double maxNextSpeed(double speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
const double mySecurity
The driver's security parameter // also 'ZF1'.
MSCFModel_Wiedemann(const MSVehicleType *vtype)
Constructor.
double following(double sign) const
virtual double getSecureGap(const MSVehicle *const, 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 fullspeed(double v, double vpref, double dx, double bx) const
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)
static double randNorm(double mean, double variance, std::mt19937 *rng=0)
Access to a random number from a normal distribution.
double approaching(double dv, double dx, double abx) const
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
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 followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle *const pred=0) const
Computes the vehicle's safe speed (no dawdling)
~MSCFModel_Wiedemann()
Destructor.
double getMaxSpeed() const
Returns the maximum speed.
virtual bool isSelected() const
whether this vehicle is selected in the GUI
double myEmergencyDecel
The vehicle's maximum emergency deceleration [m/s^2].
double accelSign
state variable for remembering the drift direction
double _v(const MSVehicle *veh, double predSpeed, double gap) const
double getActionStepLengthSecs() const
Returns the vehicle's action step length in secs, i.e. the interval between two action points.
double maximumSafeStopSpeed(double gap, double currentSpeed, bool onInsertion=false, double headway=-1) const
Returns the maximum next velocity for stopping within gap.
static const double D_MAX
free-flow distance in m
double interactionGap(const MSVehicle *const, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
const double myEstimation
The driver's estimation parameter // also 'ZF2'.
@ SUMO_ATTR_CF_WIEDEMANN_SECURITY
MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
double getLength() const
Get vehicle's length [m].
double emergency(double dv, double dx) const
const std::string & getID() const
Returns the name of the vehicle.
const MSVehicleType * myType
The type to which this model definition belongs to.
The car-following model abstraction.
const double myAX
the minimum front-bumper to front-bumper distance when standing
double getSpeed() const
Returns the vehicle's current speed.
double myAccel
The vehicle's maximum acceleration [m/s^2].
const double myCX
perception threshold modifier
const double myMinAccel
The vehicle's minimum acceleration [m/s^2] // also b_null.
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)
std::mt19937 * getRNG() const
Representation of a vehicle in the micro simulation.