| 548 | } |
| 549 | |
| 550 | void IndexGraphStarter::AddFakeEdges(Segment const & segment, bool isOutgoing, EdgeListT & edges) const |
| 551 | { |
| 552 | EdgeListT fakeEdges; |
| 553 | for (auto const & edge : edges) |
| 554 | { |
| 555 | for (auto const & s : m_fake.GetFake(edge.GetTarget())) |
| 556 | { |
| 557 | // |segment| |s| |
| 558 | // *------------>*-----------> |
| 559 | bool const sIsOutgoing = GetJunction(segment, true /* front */) == GetJunction(s, false /* front */); |
| 560 | |
| 561 | // |s| |segment| |
| 562 | // *------------>*-----------> |
| 563 | bool const sIsIngoing = GetJunction(s, true /* front */) == GetJunction(segment, false /* front */); |
| 564 | |
| 565 | if ((isOutgoing && sIsOutgoing) || (!isOutgoing && sIsIngoing)) |
| 566 | { |
| 567 | // For ingoing edges we use source weight which is the same for |s| and for |edge| and is |
| 568 | // already calculated. |
| 569 | fakeEdges.emplace_back(s, isOutgoing ? CalcSegmentWeight(s, EdgeEstimator::Purpose::Weight) : edge.GetWeight()); |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | edges.append(fakeEdges.begin(), fakeEdges.end()); |
| 574 | } |
| 575 | |
| 576 | bool IndexGraphStarter::HasNoPassThroughAllowed(Ending const & ending) const |
| 577 | { |