44 myTauDecel(myDecel * myHeadwayTime),
58 std::cout <<
"# s2s-speed: " <<
myS2Sspeed << std::endl;
66 std::cout <<
"# maxDeltaGap = " <<
maxDeltaGap << std::endl;
82 if (vars->
ggOld.size() > 1) {
83 std::cout <<
"# more than one entry in ggOld list. Speed is " << vPos <<
", corresponding dist is " << vars->
ggOld[(int) vPos] <<
"\n";
84 for (std::map<int, double>::iterator I = vars->
ggOld.begin(); I != vars->
ggOld.end(); I++) {
85 std::cout <<
"# " << (*I).first <<
' ' << (*I).second << std::endl;
100 double tTauTest = gap / speed;
102 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
107 double vsafe =
_vsafe(veh, gap, predSpeed);
115 vars->
ggOld[(int)vNew] = gap;
125 double tTauTest = gap / speed;
127 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
148 if (predSpeed == 0 && gap < 0.01) {
155 double vsafe = (double)(-1. * bTau
158 + (predSpeed * predSpeed)
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) ...
Representation of a vehicle in the micro simulation.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
std::mt19937 * getRNG() const
Structure representing possible vehicle parameter.
The car-following model abstraction.
virtual double dawdle(double speed, std::mt19937 *rng) const
Applies driver imperfection (dawdling / sigma)
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
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].
~MSCFModel_SmartSK()
Destructor.
virtual double _vsafe(const MSVehicle *const veh, double gap, double predSpeed) const
Returns the "safe" velocity.
double patchSpeedBeforeLC(const MSVehicle *veh, double vMin, double vMax) const
apply dawdling
virtual double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences. Called at most once per simulation...
The car-following model and parameter.
MSCFModel_SmartSK(const MSVehicleType *vtype)
Constructor.
virtual 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)
virtual double getSpeedAfterMaxDecel(double v) const
Returns the velocity after maximum deceleration.
double myDecel
The vehicle's maximum deceleration [m/s^2].
double myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
double myTauDecel
The precomputed value for myDecel*myTau.
virtual void updateMyHeadway(const MSVehicle *const veh) const
double getSpeed() const
Returns the vehicle's current speed.
double myS2Sspeed
new variables needed in this model; myS2Sspeed is the speed below which the vehicle does not move whe...
double finalizeSpeed(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
std::map< int, double > ggOld
double myTmp1
temporary (testing) parameter