| 325 | } |
| 326 | |
| 327 | Score ScorePathsConnector::GetScoreForUniformity(Graph::EdgeVector const & path) |
| 328 | { |
| 329 | EdgeContainer edgeContainer(m_graph); |
| 330 | for (auto const & edge : path) |
| 331 | edgeContainer.ProcessEdge(edge); |
| 332 | |
| 333 | auto const hwClassDiff = edgeContainer.GetHighwayClassDiff(); |
| 334 | Score constexpr kScoreForTheSameHwClass = 40; |
| 335 | Score constexpr kScoreForNeighboringHwClasses = 15; |
| 336 | Score const hwClassScore = hwClassDiff == 0 ? kScoreForTheSameHwClass |
| 337 | : hwClassDiff == 1 ? kScoreForNeighboringHwClasses |
| 338 | : 0; |
| 339 | |
| 340 | Score constexpr kScoreForOneWayOnly = 17; |
| 341 | Score constexpr kScoreForRoundaboutOnly = 18; |
| 342 | Score constexpr kScoreForLinkOnly = 10; |
| 343 | Score const allEqualScore = (edgeContainer.AreAllOneWaysEqual() ? kScoreForOneWayOnly : 0) + |
| 344 | (edgeContainer.AreAllRoundaboutEqual() ? kScoreForRoundaboutOnly : 0) + |
| 345 | (edgeContainer.AreAllLinksEqual() ? kScoreForLinkOnly : 0); |
| 346 | |
| 347 | return hwClassScore + allEqualScore; |
| 348 | } |
| 349 | } // namespace openlr |
nothing calls this directly
no test coverage detected