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

Method SetupAlgorithmMode

libs/routing/index_router.cpp:1803–1824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1801}
1802
1803void IndexRouter::SetupAlgorithmMode(IndexGraphStarter & starter, bool guidesActive) const
1804{
1805 // We use NoLeaps for pedestrians and bicycles with route points near to the Guides tracks
1806 // because it is much easier to implement. Otherwise for pedestrians and bicycles we use Joints.
1807 if (guidesActive)
1808 {
1809 starter.GetGraph().SetMode(WorldGraphMode::NoLeaps);
1810 return;
1811 }
1812
1813 // We use leaps for cars only. Other vehicle types do not have weights in their cross-mwm sections.
1814 switch (m_vehicleType)
1815 {
1816 case VehicleType::Pedestrian:
1817 case VehicleType::Bicycle: starter.GetGraph().SetMode(WorldGraphMode::Joints); break;
1818 case VehicleType::Transit: starter.GetGraph().SetMode(WorldGraphMode::NoLeaps); break;
1819 case VehicleType::Car:
1820 starter.GetGraph().SetMode(AreMwmsNear(starter) ? WorldGraphMode::Joints : WorldGraphMode::LeapsOnly);
1821 break;
1822 case VehicleType::Count: CHECK(false, ("Unknown vehicle type:", m_vehicleType)); break;
1823 }
1824}
1825} // namespace routing

Callers

nothing calls this directly

Calls 1

SetModeMethod · 0.45

Tested by

no test coverage detected