46 :
MSCFModel(vtype, accel, decel, headwayTime), myDawdle(dawdle), myTauDecel(decel* headwayTime),
47 myTmp1(tmp1), myTmp2(tmp2), myTmp3(tmp3), myTmp4(tmp4), myTmp5(tmp5) {
55 std::cout <<
"# s2s-speed: " <<
myS2Sspeed << std::endl;
61 std::cout <<
"# maxDeltaGap = " <<
maxDeltaGap << std::endl;
88 if (vars->
ggOld.size() > 1) {
89 std::cout <<
"# more than one entry in ggOld list. Speed is " << vPos <<
", corresponding dist is " << vars->
ggOld[(
int) vPos] <<
"\n";
90 for (std::map<int, SUMOReal>::iterator I = vars->
ggOld.begin(); I != vars->
ggOld.end(); I++) {
91 std::cout <<
"# " << (*I).first <<
' ' << (*I).second << std::endl;
109 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
134 if ((tTauTest < vars->myHeadway) && (tTauTest >
TS)) {
151 if (predSpeed == 0 && gap < 0.01) {
161 + (predSpeed * predSpeed)
SUMOReal getSpeedAfterMaxDecel(SUMOReal v) const
Returns the velocity after maximum deceleration.
Representation of a vehicle in the micro simulation.
virtual SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle *const veh) const
Returns the maximum speed given the current speed.
The car-following model abstraction.
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 myAccel
The vehicle's maximum acceleration [m/s^2].
static SUMOReal rand()
Returns a random real number in [0, 1)
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) ...
~MSCFModel_SmartSK()
Destructor.
SUMOReal myHeadwayTime
The driver's desired time headway (aka reaction time tau) [s].
SUMOReal processNextStop(SUMOReal currentVelocity)
Processes stops, returns the velocity needed to reach the stop.
virtual void updateMyHeadway(const MSVehicle *const veh) const
#define WRITE_WARNING(msg)
virtual SUMOReal dawdle(SUMOReal speed) const
Applies driver imperfection (dawdling / sigma)
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...
MSCFModel::VehicleVariables * getCarFollowVariables() const
Returns the vehicle's car following model variables.
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.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
SUMOReal myTauDecel
The precomputed value for myDecel*myTau.
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
MSLane * getLane() const
Returns the lane the vehicle is on.
SUMOReal myDecel
The vehicle's maximum deceleration [m/s^2].
virtual SUMOReal _vsafe(const MSVehicle *const veh, SUMOReal gap, SUMOReal predSpeed) const
Returns the "safe" velocity.
SUMOReal myDawdle
The vehicle's dawdle-parameter. 0 for no dawdling, 1 for max.
const std::string & getID() const
Returns the name of the vehicle.
virtual MSCFModel * duplicate(const MSVehicleType *vtype) const
Duplicates the car-following model.