better handling of trip hops with an impossibly small travel time, minor homogenization of edge case behavior of hops() and hopsFast() for hops near maxCost

This commit is contained in:
Patrick Brosi 2023-10-13 22:49:37 +02:00
parent cb606ef75f
commit f6228ee7a2
3 changed files with 28 additions and 14 deletions

View file

@ -182,14 +182,14 @@ double ExpoTransWeight::weight(uint32_t c, double d, double t0, double d0,
// _____________________________________________________________________________
uint32_t ExpoTransWeight::invWeight(double c, const RoutingOpts& rOpts) {
return std::round((c / rOpts.transitionPen) * 10);
return std::round((c / rOpts.transitionPen) * 10.0);
}
// _____________________________________________________________________________
uint32_t ExpoTransWeight::maxCost(double tTime, const RoutingOpts& rOpts) {
// abort after 3 times the scheduled time, but assume a min time of
// 1 minute!
return std::ceil(fmax(tTime, 60) * 3 * rOpts.lineUnmatchedPunishFact *
return std::ceil(fmax(tTime, 60) * 3.0 * rOpts.lineUnmatchedPunishFact *
rOpts.lineNameToUnmatchedPunishFact *
rOpts.lineNameFromUnmatchedPunishFact * 10);
}