From f813c1f842415d47f4fac7cd1f6377f514ef2d79 Mon Sep 17 00:00:00 2001 From: Alexander Held | geOps Date: Tue, 29 Sep 2020 11:23:41 +0200 Subject: [PATCH] Enable transit line penalties also when no explicit line was given Currently, if no transit line is given, all edges get penalty factor 0 regardless of whether there are transit lines following the edge or not. The change introduced in this commit will give penalty factor 0 if there is at least one transit line following the edge and penalty factor 1 if there are no tranist lines at all following the edge. Behavior in the case when a transit line is given is untouched. This should improve routing results by preferring edges with associated transit lines. This used to be the behaviour before some refactoring. Maybe it was broken unintentionally. --- src/pfaedle/router/Router.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pfaedle/router/Router.cpp b/src/pfaedle/router/Router.cpp index 38e49c7..98054a1 100644 --- a/src/pfaedle/router/Router.cpp +++ b/src/pfaedle/router/Router.cpp @@ -108,7 +108,7 @@ EdgeCost CostFunc::operator()(const trgraph::Edge* from, const trgraph::Node* n, // _____________________________________________________________________________ double CostFunc::transitLineCmp(const trgraph::EdgePL& e) const { if (_rAttrs.shortName.empty() && _rAttrs.toString.empty() && - _rAttrs.fromString.empty()) + _rAttrs.fromString.empty() && !e.getLines().empty()) return 0; double best = 1; for (const auto* l : e.getLines()) {