51 :
MSCFModel(vtype, accel, decel, headwayTime), myDawdle(dawdle), myTauDecel(decel * headwayTime),
52 myTmp1(tmp1), myTmp2(tmp2), myTmp3(tmp3), myTmp4(tmp4), myTmp5(tmp5) {
61 std::cout <<
"# s2s-speed: " <<
myS2Sspeed << std::endl;
69 std::cout <<
"# maxDeltaGap = " <<
maxDeltaGap << std::endl;
97 if (vars->
ggOld.size() > 1) {
98 std::cout <<
"# more than one entry in ggOld list. Speed is " << vPos <<
", corresponding dist is " << vars->
ggOld[(int) vPos] <<
"\n";
99 for (std::map<int, SUMOReal>::iterator I = vars->
ggOld.begin(); I != vars->
ggOld.end(); I++) {
100 std::cout <<
"# " << (*I).first <<
' ' << (*I).second << std::endl;
118 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
131 vars->
ggOld[(int)vNew] = gap;
143 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
160 if (predSpeed == 0 && gap < 0.01) {
170 + (predSpeed * predSpeed)
SUMOReal getSpeedAfterMaxDecel(SUMOReal v) const
Returns the velocity after maximum deceleration.
virtual SUMOReal stopSpeed(const MSVehicle *const veh, const SUMOReal speed, SUMOReal 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.
MSLane * getLane() const
Returns the lane the vehicle is on.
virtual SUMOReal _vsafe(const MSVehicle *const veh, SUMOReal gap, SUMOReal predSpeed) const
Returns the "safe" velocity.
The car-following model abstraction.
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.
SUMOReal myAccel
The vehicle's maximum acceleration [m/s^2].
static SUMOReal rand()
Returns a random real number in [0, 1)
~MSCFModel_SmartSK()
Destructor.
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
virtual SUMOReal followSpeed(const MSVehicle *const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const
Computes the vehicle's safe speed (no dawdling)
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
#define WRITE_WARNING(msg)
The car-following model and parameter.
MSAbstractLaneChangeModel & getLaneChangeModel()
MSCFModel_SmartSK(const MSVehicleType *vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime, SUMOReal tmp1, SUMOReal tmp2, SUMOReal tmp3, SUMOReal tmp4, SUMOReal tmp5)
Constructor.
std::map< int, SUMOReal > ggOld
SUMOReal myTmp1
temporary (testing) parameter
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
SUMOReal myS2Sspeed
new variables needed in this model; myS2Sspeed is the speed below which the vehicle does not move whe...
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
SUMOReal moveHelper(MSVehicle *const veh, SUMOReal vPos) const
Applies interaction with stops and lane changing model influences.
virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change.
virtual void updateMyHeadway(const MSVehicle *const veh) const
SUMOReal myTauDecel
The precomputed value for myDecel*myTau.
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
const std::string & getID() const
Returns the name of the vehicle.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
SUMOReal myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.