| 286 | } |
| 287 | |
| 288 | double IndexGraphStarter::CalculateETA(Segment const & from, Segment const & to) const |
| 289 | { |
| 290 | // We don't distinguish fake segment weight and fake segment transit time. |
| 291 | if (IsFakeSegment(to)) |
| 292 | return CalcSegmentWeight(to, EdgeEstimator::Purpose::ETA).GetWeight(); |
| 293 | |
| 294 | if (IsFakeSegment(from)) |
| 295 | return CalculateETAWithoutPenalty(to); |
| 296 | |
| 297 | if (IsGuidesSegment(from) || IsGuidesSegment(to)) |
| 298 | { |
| 299 | double res = 0.0; |
| 300 | if (IsGuidesSegment(from)) |
| 301 | res += CalcGuidesSegmentWeight(from, EdgeEstimator::Purpose::ETA).GetWeight(); |
| 302 | else |
| 303 | res += CalculateETAWithoutPenalty(from); |
| 304 | |
| 305 | if (IsGuidesSegment(to)) |
| 306 | res += CalcGuidesSegmentWeight(to, EdgeEstimator::Purpose::ETA).GetWeight(); |
| 307 | else |
| 308 | res += CalculateETAWithoutPenalty(to); |
| 309 | |
| 310 | return res; |
| 311 | } |
| 312 | |
| 313 | if (IsRegionsGraphMode()) |
| 314 | return m_regionsGraph->CalcSegmentWeight(from).GetWeight() + m_regionsGraph->CalcSegmentWeight(to).GetWeight(); |
| 315 | |
| 316 | return m_graph.CalculateETA(from, to); |
| 317 | } |
| 318 | |
| 319 | double IndexGraphStarter::CalculateETAWithoutPenalty(Segment const & segment) const |
| 320 | { |
nothing calls this directly
no test coverage detected