Skip to content

Commit

Permalink
fix #14526
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 16, 2024
1 parent 7a1ef7c commit 814b005
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ MSBaseVehicle::stopsAtEdge(const MSEdge* edge) const {
return true;
}
}
return false;
return myRoute->getLastEdge() == edge;
}


Expand Down
2 changes: 1 addition & 1 deletion src/microsim/devices/MSDevice_Taxi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ MSDevice_Taxi::setParameter(const std::string& key, const std::string& value) {

bool
MSDevice_Taxi::compatibleLine(const std::string& taxiLine, const std::string& rideLine) {
return (taxiLine == rideLine
return ((taxiLine == rideLine && StringUtils::startsWith(rideLine, "taxi") && StringUtils::startsWith(taxiLine, "taxi"))
|| (taxiLine == TAXI_SERVICE && StringUtils::startsWith(rideLine, "taxi:"))
|| (rideLine == TAXI_SERVICE && StringUtils::startsWith(taxiLine, "taxi:")));
}
Expand Down
13 changes: 7 additions & 6 deletions src/microsim/transportables/MSStageDriving.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,13 @@ bool
MSStageDriving::isWaitingFor(const SUMOVehicle* vehicle) const {
assert(myLines.size() > 0);
return (myLines.count(vehicle->getID()) > 0
|| myLines.count(vehicle->getParameter().line) > 0
|| MSDevice_Taxi::compatibleLine(vehicle->getParameter().line, *myLines.begin())
|| (myLines.count("ANY") > 0 && (
myDestinationStop == nullptr
? vehicle->stopsAtEdge(myDestination)
: vehicle->stopsAt(myDestinationStop))));
|| ((myLines.count(vehicle->getParameter().line) > 0
|| myLines.count("ANY") > 0) &&
// even if the line matches we still have to check for stops (#14526)
(myDestinationStop == nullptr
? vehicle->stopsAtEdge(myDestination)
: vehicle->stopsAt(myDestinationStop)))
|| MSDevice_Taxi::compatibleLine(vehicle->getParameter().line, *myLines.begin()));
}


Expand Down

0 comments on commit 814b005

Please sign in to comment.