Skip to content

Commit

Permalink
avoiding dead-ends due to permission changes. refs #5121
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 1, 2019
1 parent 7e47f8e commit 808c0f4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/netbuild/NBEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2698,17 +2698,18 @@ NBEdge::appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool noGeometr
if (noTLSControlled && myTo->isTLControlled()) {
return;
}
if (onlyDeadends) {
int allowedOutgoing = 0;
for (NBEdge* out : myTo->getOutgoingEdges()) {
if ((out->getPermissions() & SVC_PASSENGER) != 0 || out->getPermissions() == getPermissions()) {
allowedOutgoing++;
if (allowedOutgoing > 1) {
return;
}
int allowedOutgoing = 0;
for (NBEdge* out : myTo->getOutgoingEdges()) {
if ((out->getPermissions() & SVC_PASSENGER) != 0 || out->getPermissions() == getPermissions()) {
allowedOutgoing++;
if (allowedOutgoing > 1) {
break;
}
}
}
if (onlyDeadends && allowedOutgoing > 1) {
return;
}
const int fromLane = (int)myLanes.size() - 1;
const int toLane = (int)myTurnDestination->getNumLanes() - 1;
if (checkPermissions) {
Expand All @@ -2735,7 +2736,7 @@ NBEdge::appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool noGeometr
return;
}
};
if (noGeometryLike && myTo->geometryLike() && myTo->getOutgoingEdges().size() > 1) {
if (noGeometryLike && myTo->geometryLike() && allowedOutgoing > 1) {
return;
}
setConnection(fromLane, myTurnDestination, toLane, L2L_VALIDATED);
Expand Down

0 comments on commit 808c0f4

Please sign in to comment.