Skip to content

Commit

Permalink
fix #14503
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 13, 2024
1 parent 918e07d commit caa3d9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2935,7 +2935,11 @@ MSVehicle::slowDownForSchedule(double vMinComfortable) const {
std::pair<double, double> timeDist = estimateTimeToNextStop();
double arrivalDelay = SIMTIME + timeDist.first - STEPS2TIME(stop.pars.arrival);
double t = STEPS2TIME(stop.pars.arrival - SIMSTEP);
if (stop.pars.started >= 0 && MSGlobals::gUseStopStarted) {
if (stop.pars.hasParameter(toString(SUMO_ATTR_FLEX_ARRIVAL))) {
SUMOTime flexStart = string2time(stop.pars.getParameter(toString(SUMO_ATTR_FLEX_ARRIVAL)));
arrivalDelay += STEPS2TIME(stop.pars.arrival - flexStart);
t = STEPS2TIME(flexStart - SIMSTEP);
} else if (stop.pars.started >= 0 && MSGlobals::gUseStopStarted) {
arrivalDelay += STEPS2TIME(stop.pars.arrival - stop.pars.started);
t = STEPS2TIME(stop.pars.started - SIMSTEP);
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/xml/SUMOXMLDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::attrs[] = {
{ "carFollowModel.ignoreIDs", SUMO_ATTR_CF_IGNORE_IDS },
{ "carFollowModel.ignoreTypes", SUMO_ATTR_CF_IGNORE_TYPES },
/// @}
{ "flexArrival", SUMO_ATTR_FLEX_ARRIVAL },

{ "last", SUMO_ATTR_LAST },
{ "cost", SUMO_ATTR_COST },
Expand Down
1 change: 1 addition & 0 deletions src/utils/xml/SUMOXMLDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ enum SumoXMLAttr {
SUMO_ATTR_CF_IGNORE_IDS,
SUMO_ATTR_CF_IGNORE_TYPES,
/// @}
SUMO_ATTR_FLEX_ARRIVAL,

/// @name route alternatives / distribution attributes
/// @{
Expand Down

0 comments on commit caa3d9f

Please sign in to comment.