46 double decel,
double emergencyDecel,
double apparentDecel,
47 double dawdle,
double headwayTime,
48 double tmp1,
double tmp2,
double tmp3,
double tmp4,
double tmp5) :
51 MSCFModel(vtype, accel, decel, emergencyDecel, apparentDecel, headwayTime),
52 myDawdle(dawdle), myTauDecel(decel * headwayTime),
53 myTmp1(tmp1), myTmp2(tmp2), myTmp3(tmp3), myTmp4(tmp4), myTmp5(tmp5) {
62 std::cout <<
"# s2s-speed: " <<
myS2Sspeed << std::endl;
70 std::cout <<
"# maxDeltaGap = " <<
maxDeltaGap << std::endl;
98 if (vars->
ggOld.size() > 1) {
99 std::cout <<
"# more than one entry in ggOld list. Speed is " << vPos <<
", corresponding dist is " << vars->
ggOld[(int) vPos] <<
"\n";
100 for (std::map<int, double>::iterator I = vars->
ggOld.begin(); I != vars->
ggOld.end(); I++) {
101 std::cout <<
"# " << (*I).first <<
' ' << (*I).second << std::endl;
117 double tTauTest = gap / speed;
119 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
124 double vsafe =
_vsafe(veh, gap, predSpeed);
132 vars->
ggOld[(int)vNew] = gap;
142 double tTauTest = gap / speed;
144 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
161 if (predSpeed == 0 && gap < 0.01) {
168 double vsafe = (double)(-1. * bTau
171 + (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) ...
double getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
Representation of a vehicle in the micro simulation.
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
double myApparentDecel
The vehicle's deceleration as expected by surrounding traffic [m/s^2].
MSLane * getLane() const
Returns the lane the vehicle is on.
The car-following model abstraction.
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].
double moveHelper(MSVehicle *const veh, double vPos) const
Applies interaction with stops and lane changing model influences.
~MSCFModel_SmartSK()
Destructor.
virtual double _vsafe(const MSVehicle *const veh, double gap, double predSpeed) const
Returns the "safe" velocity.
#define WRITE_WARNING(msg)
The car-following model and parameter.
MSAbstractLaneChangeModel & getLaneChangeModel()
virtual double patchSpeed(const double min, const double wanted, const double max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change. It uses information on LC-related desired ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
virtual double getSpeedAfterMaxDecel(double v) const
Returns the velocity after maximum deceleration.
double myDecel
The vehicle's maximum deceleration [m/s^2].
virtual double dawdle(double speed) const
Applies driver imperfection (dawdling / sigma)
double processNextStop(double currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
MSCFModel_SmartSK(const MSVehicleType *vtype, double accel, double decel, double emergencyDecel, double apparentDecel, double dawdle, double headwayTime, double tmp1, double tmp2, double tmp3, double tmp4, double tmp5)
Constructor.
double myEmergencyDecel
The vehicle's maximum emergency 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 myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
double getSpeed() const
Returns the vehicle's current speed.
virtual double followSpeed(const MSVehicle *const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
double myS2Sspeed
new variables needed in this model; myS2Sspeed is the speed below which the vehicle does not move whe...
const std::string & getID() const
Returns the name of the vehicle.
std::map< int, double > ggOld
double myTmp1
temporary (testing) parameter