MCPcopy Create free account
hub / github.com/comaps/comaps / GetScoreForUniformity

Method GetScoreForUniformity

tools/openlr/score_paths_connector.cpp:327–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327Score 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

Callers

nothing calls this directly

Calls 5

ProcessEdgeMethod · 0.80
GetHighwayClassDiffMethod · 0.80
AreAllOneWaysEqualMethod · 0.80
AreAllRoundaboutEqualMethod · 0.80
AreAllLinksEqualMethod · 0.80

Tested by

no test coverage detected