Get all nodes in dense areas but make sure we don't underflow in sparse ones

This commit is contained in:
Patrick Niklaus
2015-01-16 00:17:40 +01:00
parent 3a5e41ed91
commit 59727a6967
4 changed files with 6 additions and 19 deletions
+3 -15
View File
@@ -81,30 +81,18 @@ template <class DataFacadeT> class MapMatchingPlugin : public BasePlugin
route_parameters.coordinates[current_coordinate - 1],
route_parameters.coordinates[current_coordinate]);
std::cout << "Searching: " << current_coordinate << std::endl;
std::vector<std::pair<PhantomNode, double>> candidates;
if (!facade->IncrementalFindPhantomNodeForCoordinateWithDistance(
if (!facade->IncrementalFindPhantomNodeForCoordinateWithMaxDistance(
route_parameters.coordinates[current_coordinate],
candidates,
last_distance,
last_distance/2.0,
5,
20))
{
std::cout << "Nothing found for " << current_coordinate << std::endl;
continue;
return 400;
}
candidate_lists.push_back(candidates);
std::cout << current_coordinate << " (" << (last_distance / 2.0) << ") : "
<< candidates.size() << std::endl;
BOOST_ASSERT(candidate_lists[current_coordinate].size() == 10);
}
if (2 > candidate_lists.size())
{
return 400;
}
// call the actual map matching