Optional transit line penalties when no explicit line was given (#19)

* 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.
This commit is contained in:
Alexander Held 2020-10-13 20:27:20 +02:00 committed by GitHub
parent e06c15656b
commit 08b0685ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 9 deletions

View file

@ -331,6 +331,12 @@ void MotConfigReader::parse(const std::vector<std::string>& paths) {
p.getDouble(secStr, "routing_line_unmatched_punish_fac");
}
if (p.hasKey(secStr, "routing_no_lines_punish_fac")) {
procedKeys.insert("routing_no_lines_punish_fac");
curCfg.routingOpts.noLinesPunishFact =
p.getDouble(secStr, "routing_no_lines_punish_fac");
}
if (p.hasKey(secStr, "routing_platform_unmatched_punish")) {
procedKeys.insert("routing_platform_unmatched_punish");
curCfg.routingOpts.platformUnmatchedPen =