| 125 | } |
| 126 | |
| 127 | RouteWeight LeapsGraph::CalcMiddleCrossMwmWeight(std::vector<Segment> const & path) |
| 128 | { |
| 129 | ASSERT_GREATER(path.size(), 1, ()); |
| 130 | auto & crossMwmGraph = m_starter.GetGraph().GetCrossMwmGraph(); |
| 131 | |
| 132 | RouteWeight res; |
| 133 | for (size_t i = 1; i < path.size() - 2; ++i) |
| 134 | { |
| 135 | auto const & from = path[i]; |
| 136 | auto const & to = path[i + 1]; |
| 137 | NumMwmId const fromMwm = from.GetMwmId(); |
| 138 | NumMwmId const toMwm = to.GetMwmId(); |
| 139 | ASSERT(fromMwm != kFakeNumMwmId && toMwm != kFakeNumMwmId, ()); |
| 140 | |
| 141 | if (fromMwm != toMwm) |
| 142 | res += m_hierarchyHandler.GetCrossBorderPenalty(fromMwm, toMwm); |
| 143 | else |
| 144 | res += crossMwmGraph.GetWeightSure(from, to); |
| 145 | } |
| 146 | |
| 147 | return res; |
| 148 | } |
| 149 | |
| 150 | } // namespace routing |
no test coverage detected