Skip to content

Commit

Permalink
fix #14815
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed May 2, 2024
1 parent 8190105 commit 7acfddd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,7 @@ MSBaseVehicle::replaceStop(int nextStopIndex, SUMOVehicleParameter::Stop stop, c
return true;
}

if (!stopLane->allowsVehicleClass(getVClass())) {
if (!stopLane->allowsVehicleClass(getVClass(), myRoutingMode)) {
errorMsg = ("Disallowed stop lane '" + stopLane->getID() + "'");
return false;
}
Expand Down Expand Up @@ -1870,7 +1870,7 @@ MSBaseVehicle::insertStop(int nextStopIndex, SUMOVehicleParameter::Stop stop, co
MSLane* stopLane = MSLane::dictionary(stop.lane);
MSEdge* stopEdge = &stopLane->getEdge();

if (!stopLane->allowsVehicleClass(getVClass())) {
if (!stopLane->allowsVehicleClass(getVClass(), myRoutingMode)) {
errorMsg = ("Disallowed stop lane '" + stopLane->getID() + "'");
return false;
}
Expand Down
6 changes: 6 additions & 0 deletions src/microsim/MSLane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4528,4 +4528,10 @@ MSLane::getSpaceTillLastStanding(const MSVehicle* ego, bool& foundStopped) const
return getLength() - lengths;
}


bool
MSLane::allowsVehicleClass(SUMOVehicleClass vclass, int routingMode) const {
return (((routingMode & libsumo::ROUTING_MODE_IGNORE_TRANSIENT_PERMISSIONS) ? myOriginalPermissions : myPermissions) & vclass) == vclass;
}

/****************************************************************************/
2 changes: 2 additions & 0 deletions src/microsim/MSLane.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ class MSLane : public Named, public Parameterised {
return (myPermissions & vclass) == vclass;
}

bool allowsVehicleClass(SUMOVehicleClass vclass, int routingMode) const;

/** @brief Returns whether the given vehicle class may change left from this lane */
inline bool allowsChangingLeft(SUMOVehicleClass vclass) const {
return (myChangeLeft & vclass) == vclass;
Expand Down

0 comments on commit 7acfddd

Please sign in to comment.