Co-Simulation/Sumo/sumo-1.7.0/src/microsim/cfmodels/MSCFModel_PWag2009.cpp
// in addition, the parameters myTauLast, probAP, and sigmaAcc are needed; sigmaAcc can use myDawdle
// myTauLast might use the current time-step size, but this yields eventually an extreme model, I would be
// more careful and set it to something around 0.3 or 0.4, which are among the shortest headways I have
// seen so far in data ...
in addition, the parameters myTauLast, probAP, and sigmaAcc are needed; sigmaAcc can use myDawdle
myTauLast might use the current time-step size, but this yields eventually an extreme model, I would be
more careful and set it to something around 0.3 or 0.4, which are among the shortest headways I have
seen so far in data
in addition the parameters myTauLast probAP and sigmaAcc are needed ; sigmaAcc can use myDawdle myTauLast might use the current time - step size but this yields eventually an extreme model I would be more careful and set it to something around 0 . 3 or 0 . 4 which are among the shortest headways I have seen so far in data
double
MSCFModel_PWag2009::followSpeed(const MSVehicle* const veh, double speed, double gap, double predSpeed, double , const MSVehicle* const ) const {
    if (predSpeed == 0 && gap < 0.01) {
        return 0;
    }
    const double vsafe = -myTauLastDecel + sqrt(myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap);
    const double asafe = SPEED2ACCEL(vsafe - speed);
    VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables();
    double apref = vars->aOld;
    if (apref <= asafe && RandHelper::rand(veh->getRNG()) <= myActionPointProbability * TS) {
        apref = myDecelDivTau * (gap + (predSpeed - speed) * myHeadwayTime - speed * myHeadwayTime) / (speed + myTauDecel);
        apref = MIN2(apref, myAccel);
        apref = MAX2(apref, -myDecel);
        apref += myDawdle * RandHelper::rand((double) - 1., (double)1., veh->getRNG());
    }
    if (apref > asafe) {
        apref = asafe;
    }
    return MAX2(0., speed + ACCEL2SPEED(apref));
}
double MSCFModel_PWag2009 :: followSpeed ( const MSVehicle * const veh , double speed , double gap , double predSpeed , double , const MSVehicle * const ) const { if ( predSpeed == 0 && gap < 0.01 ) { return 0 ; } const double vsafe = - myTauLastDecel + sqrt ( myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap ) ; const double asafe = SPEED2ACCEL ( vsafe - speed ) ; VehicleVariables * vars = ( VehicleVariables * ) veh -> getCarFollowVariables ( ) ; double apref = vars -> aOld ; if ( apref <= asafe && RandHelper :: rand ( veh -> getRNG ( ) ) <= myActionPointProbability * TS ) { apref = myDecelDivTau * ( gap + ( predSpeed - speed ) * myHeadwayTime - speed * myHeadwayTime ) / ( speed + myTauDecel ) ; apref = MIN2 ( apref , myAccel ) ; apref = MAX2 ( apref , - myDecel ) ; apref += myDawdle * RandHelper :: rand ( ( double ) - 1. , ( double ) 1. , veh -> getRNG ( ) ) ; } if ( apref > asafe ) { apref = asafe ; } return MAX2 ( 0. , speed + ACCEL2SPEED ( apref ) ) ; }
in addition, the parameters myTauLast, probAP, and sigmaAcc are needed; sigmaAcc can use myDawdle
myTauLast might use the current time-step size, but this yields eventually an extreme model, I would be
more careful and set it to something around 0.3 or 0.4, which are among the shortest headways I have
seen so far in data ...
in addition the parameters myTauLast probAP and sigmaAcc are needed ; sigmaAcc can use myDawdle myTauLast might use the current time - step size but this yields eventually an extreme model I would be more careful and set it to something around 0 . 3 or 0 . 4 which are among the shortest headways I have seen so far in data ...
/*predMaxDecel*/ /*pred*/