[sumo-user] Brake gap Euler calculation

Hello,

I copied the calculation of brake gap from: https://github.com/eclipse/sumo/blob/08766930f4b3d3df95aa5cfcf92bae0358724710/src/microsim/cfmodels/MSCFModel.cpp#L89 line by line:

STEP_LENGTH = 1

speedReduction = STEP_LENGTH * decel
steps = int(speed/speedReduction)
return STEP_LENGTH * (steps * speed - speedReduction * steps * (steps + 1) / 2) + speed * headwayTime

In the original definition, ACCEL2SPEED is defined in https://github.com/eclipse/sumo/blob/9bab618a12a49ae925954e23c2386dd67b7717ea/src/utils/common/SUMOTime.h#L49 where the relevant lines to calculate TS in the same file:

// the step length in ms
extern SUMOTime DELTA_T;
// the step length in seconds as double
#define TS (static_cast<double>(DELTA_T/1000.))

would mean that if my step length is the default value of 1 second, DELTA_T will hold the same value in milliseconds (ms), that is, 1000 ms? And hence, TS will hold a value of 1000/1000 = 1s. So the first line const double speedReduction = ACCEL2SPEED(decel); will be a speedReduction = decel * 1, that is, the value of maximum deceleration ability of a vehicle?

I was told that in general, egoSpeed * tau + egoBrakeGap = secureGap + leaderBrakeGap so I am trying to verify my calculation of brake gap using that (Since there is no other way to get brakeGap using TraCI?)

# egoSpeed * tau + egoBrakeGap = secureGap + leaderBrakeGap