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

Method AddFakeEdges

libs/routing/index_graph_starter.cpp:550–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550void 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
576bool IndexGraphStarter::HasNoPassThroughAllowed(Ending const & ending) const
577{

Callers

nothing calls this directly

Calls 6

GetTargetMethod · 0.80
emplace_backMethod · 0.45
GetWeightMethod · 0.45
appendMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected