Skip to content

Commit

Permalink
fix #5121
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jan 30, 2019
1 parent 0e14c91 commit f52facb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/netbuild/NBEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@ NBEdge::prepareEdgePriorities(const EdgeVector* outgoing) {


void
NBEdge::appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool checkPermissions) {
NBEdge::appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool noGeometryLike, bool checkPermissions) {
// do nothing if no turnaround is known
if (myTurnDestination == nullptr || myTo->getType() == NODETYPE_RAIL_CROSSING) {
return;
Expand Down Expand Up @@ -2647,6 +2647,9 @@ NBEdge::appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool checkPerm
return;
}
};
if (noGeometryLike && myTo->geometryLike() && myTo->getOutgoingEdges().size() > 1) {
return;
}
setConnection(fromLane, myTurnDestination, toLane, L2L_VALIDATED);
}

Expand Down
2 changes: 1 addition & 1 deletion src/netbuild/NBEdge.h
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ class NBEdge : public Named, public Parameterised {
* of this edge to the leftmost lane of myTurnDestination).
* @param[in] noTLSControlled Whether the turnaround shall not be connected if this edge is controlled by a tls
*/
void appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool checkPermissions);
void appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool noGeometryLike, bool checkPermissions);

/** @brief Returns the node at the given edges length (using an epsilon)
@note When no node is existing at the given position, 0 is returned
Expand Down
6 changes: 3 additions & 3 deletions src/netbuild/NBEdgeCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,17 +818,17 @@ NBEdgeCont::recheckLanes() {


void
NBEdgeCont::appendTurnarounds(bool noTLSControlled, bool onlyDeadends) {
NBEdgeCont::appendTurnarounds(bool noTLSControlled, bool onlyDeadends, bool noGeometryLike) {
for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); i++) {
(*i).second->appendTurnaround(noTLSControlled, onlyDeadends, true);
(*i).second->appendTurnaround(noTLSControlled, onlyDeadends, noGeometryLike, true);
}
}


void
NBEdgeCont::appendTurnarounds(const std::set<std::string>& ids, bool noTLSControlled) {
for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); it++) {
myEdges[*it]->appendTurnaround(noTLSControlled, false, false);
myEdges[*it]->appendTurnaround(noTLSControlled, false, false, false);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/netbuild/NBEdgeCont.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class NBEdgeCont {
* @todo Recheck whether a visitor-pattern should be used herefor
* @see NBEdge::appendTurnaround
*/
void appendTurnarounds(bool noTLSControlled, bool onlyDeadends);
void appendTurnarounds(bool noTLSControlled, bool onlyDeadends, bool noGeometryLike);


/** @brief Appends turnarounds to all edges stored in the container
Expand Down
3 changes: 3 additions & 0 deletions src/netbuild/NBFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ NBFrame::fillOptions(bool forNetgen) {
oc.addSynonyme("no-turnarounds.tls", "no-tls-turnarounds", true);
oc.addDescription("no-turnarounds.tls", "Junctions", "Disables building turnarounds at tls-controlled junctions");

oc.doRegister("no-turnarounds.geometry", new Option_Bool(true));
oc.addDescription("no-turnarounds.geometry", "Junctions", "Disables building turnarounds at geometry-like junctions");

oc.doRegister("no-turnarounds.except-deadend", new Option_Bool(false));
oc.addDescription("no-turnarounds.except-deadend", "Junctions", "Disables building turnarounds except at dead end junctions");

Expand Down
2 changes: 1 addition & 1 deletion src/netbuild/NBNetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ NBNetBuilder::compute(OptionsCont& oc, const std::set<std::string>& explicitTurn
before = SysUtils::getCurrentMillis();
PROGRESS_BEGIN_MESSAGE("Processing turnarounds");
if (!oc.getBool("no-turnarounds")) {
myEdgeCont.appendTurnarounds(oc.getBool("no-turnarounds.tls"), oc.getBool("no-turnarounds.except-deadend"));
myEdgeCont.appendTurnarounds(oc.getBool("no-turnarounds.tls"), oc.getBool("no-turnarounds.except-deadend"), oc.getBool("no-turnarounds.geometry"));
} else {
myEdgeCont.appendTurnarounds(explicitTurnarounds, oc.getBool("no-turnarounds.tls"));
}
Expand Down

0 comments on commit f52facb

Please sign in to comment.