remove more debug code
This commit is contained in:
parent
e766d206f1
commit
9722f56be8
@ -734,7 +734,6 @@ class StaticRTree
|
|||||||
foot_point_coordinate_on_segment,
|
foot_point_coordinate_on_segment,
|
||||||
current_ratio);
|
current_ratio);
|
||||||
|
|
||||||
SimpleLogger().Write() << "nearest: " << std::setprecision(8) << foot_point_coordinate_on_segment;
|
|
||||||
// store phantom node in result vector
|
// store phantom node in result vector
|
||||||
result_phantom_node_vector.emplace_back(
|
result_phantom_node_vector.emplace_back(
|
||||||
current_segment.forward_edge_based_node_id,
|
current_segment.forward_edge_based_node_id,
|
||||||
@ -783,7 +782,7 @@ class StaticRTree
|
|||||||
traversal_queue = std::priority_queue<IncrementalQueryCandidate>{};
|
traversal_queue = std::priority_queue<IncrementalQueryCandidate>{};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SimpleLogger().Write() << "inspected_elements: " << inspected_elements;
|
// SimpleLogger().Write() << "inspected_elements: " << inspected_elements;
|
||||||
return !result_phantom_node_vector.empty();
|
return !result_phantom_node_vector.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,65 +71,30 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
|||||||
|
|
||||||
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
void HandleRequest(const RouteParameters &route_parameters, http::Reply &reply) final
|
||||||
{
|
{
|
||||||
SimpleLogger().Write() << "handling call";
|
|
||||||
|
|
||||||
if (!check_all_coordinates(route_parameters.coordinates))
|
if (!check_all_coordinates(route_parameters.coordinates))
|
||||||
{
|
{
|
||||||
SimpleLogger().Write() << "coordinates not ok";
|
|
||||||
reply = http::Reply::StockReply(http::Reply::badRequest);
|
reply = http::Reply::StockReply(http::Reply::badRequest);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
reply.status = http::Reply::ok;
|
reply.status = http::Reply::ok;
|
||||||
SimpleLogger().Write() << "coordinates ok";
|
|
||||||
|
|
||||||
std::vector<phantom_node_pair> phantom_node_pair_list(route_parameters.coordinates.size());
|
std::vector<phantom_node_pair> phantom_node_pair_list(route_parameters.coordinates.size());
|
||||||
// const bool checksum_OK = (route_parameters.check_sum == facade->GetCheckSum());
|
|
||||||
|
|
||||||
for (const auto i : osrm::irange<std::size_t>(0, route_parameters.coordinates.size()))
|
for (const auto i : osrm::irange<std::size_t>(0, route_parameters.coordinates.size()))
|
||||||
{
|
{
|
||||||
SimpleLogger().Write() << "[" << i << "] checking coordinate";
|
|
||||||
SimpleLogger().Write() << "route_parameters.hints.size() "
|
|
||||||
<< route_parameters.hints.size();
|
|
||||||
|
|
||||||
// TODO: Remove hinting mechanism
|
|
||||||
// if (checksum_OK && i < route_parameters.hints.size() &&
|
|
||||||
// !route_parameters.hints[i].empty())
|
|
||||||
// {
|
|
||||||
// SimpleLogger().Write() << "decoding hint " << i;
|
|
||||||
|
|
||||||
// ObjectEncoder::DecodeFromBase64(route_parameters.hints[i],
|
|
||||||
// phantom_node_pair_list[i]);
|
|
||||||
// if (phantom_node_pair_list[i].first.is_valid(facade->GetNumberOfNodes()))
|
|
||||||
// {
|
|
||||||
// SimpleLogger().Write() << "decoded PhantomNode";
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
std::vector<PhantomNode> phantom_node_vector;
|
std::vector<PhantomNode> phantom_node_vector;
|
||||||
SimpleLogger().Write() << "finding coordinate";
|
|
||||||
|
|
||||||
if (facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i],
|
if (facade->IncrementalFindPhantomNodeForCoordinate(route_parameters.coordinates[i],
|
||||||
phantom_node_vector, 1))
|
phantom_node_vector, 1))
|
||||||
{
|
{
|
||||||
SimpleLogger().Write() << "found first PhantomNode" << phantom_node_vector.front();
|
|
||||||
|
|
||||||
BOOST_ASSERT(!phantom_node_vector.empty());
|
BOOST_ASSERT(!phantom_node_vector.empty());
|
||||||
phantom_node_pair_list[i].first = phantom_node_vector.front();
|
phantom_node_pair_list[i].first = phantom_node_vector.front();
|
||||||
if (phantom_node_vector.size() > 1)
|
if (phantom_node_vector.size() > 1)
|
||||||
{
|
{
|
||||||
SimpleLogger().Write() << "found second PhantomNode"
|
|
||||||
<< phantom_node_vector.back();
|
|
||||||
phantom_node_pair_list[i].second = phantom_node_vector.back();
|
phantom_node_pair_list[i].second = phantom_node_vector.back();
|
||||||
}
|
}
|
||||||
// } else {
|
|
||||||
// SimpleLogger().Write() << "found no PhantomNode";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: - if all PhantomNodes are from same tiny cc then take those
|
|
||||||
// - otherwise take all from big component.
|
|
||||||
// - rotate results into phantom_node_pair.first
|
|
||||||
|
|
||||||
auto check_component_id_is_tiny = [](const phantom_node_pair &phantom_pair)
|
auto check_component_id_is_tiny = [](const phantom_node_pair &phantom_pair)
|
||||||
{
|
{
|
||||||
return phantom_pair.first.component_id != 0;
|
return phantom_pair.first.component_id != 0;
|
||||||
@ -138,8 +103,6 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
|||||||
const bool every_phantom_is_in_tiny_cc =
|
const bool every_phantom_is_in_tiny_cc =
|
||||||
std::all_of(std::begin(phantom_node_pair_list), std::end(phantom_node_pair_list),
|
std::all_of(std::begin(phantom_node_pair_list), std::end(phantom_node_pair_list),
|
||||||
check_component_id_is_tiny);
|
check_component_id_is_tiny);
|
||||||
SimpleLogger().Write() << "every_phantom_is_in_tiny_cc: "
|
|
||||||
<< (every_phantom_is_in_tiny_cc ? "y" : "n");
|
|
||||||
|
|
||||||
// are all phantoms from a tiny cc?
|
// are all phantoms from a tiny cc?
|
||||||
const auto component_id = phantom_node_pair_list.front().first.component_id;
|
const auto component_id = phantom_node_pair_list.front().first.component_id;
|
||||||
@ -153,9 +116,6 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
|||||||
std::all_of(std::begin(phantom_node_pair_list), std::end(phantom_node_pair_list),
|
std::all_of(std::begin(phantom_node_pair_list), std::end(phantom_node_pair_list),
|
||||||
check_component_id_is_equal);
|
check_component_id_is_equal);
|
||||||
|
|
||||||
SimpleLogger().Write() << "every_phantom_has_equal_id: "
|
|
||||||
<< (every_phantom_has_equal_id ? "y" : "n");
|
|
||||||
|
|
||||||
auto swap_phantom_from_big_cc_into_front = [](phantom_node_pair &phantom_pair)
|
auto swap_phantom_from_big_cc_into_front = [](phantom_node_pair &phantom_pair)
|
||||||
{
|
{
|
||||||
if (0 != phantom_pair.first.component_id)
|
if (0 != phantom_pair.first.component_id)
|
||||||
@ -178,10 +138,6 @@ template <class DataFacadeT> class ViaRoutePlugin final : public BasePlugin
|
|||||||
{
|
{
|
||||||
raw_route.segment_end_coordinates.emplace_back(
|
raw_route.segment_end_coordinates.emplace_back(
|
||||||
PhantomNodes{first_pair.first, second_pair.first});
|
PhantomNodes{first_pair.first, second_pair.first});
|
||||||
SimpleLogger().Write()
|
|
||||||
<< "emplaced: " << raw_route.segment_end_coordinates.back().source_phantom;
|
|
||||||
SimpleLogger().Write() << " "
|
|
||||||
<< raw_route.segment_end_coordinates.back().target_phantom;
|
|
||||||
};
|
};
|
||||||
osrm::for_each_pair(phantom_node_pair_list, build_phantom_pairs);
|
osrm::for_each_pair(phantom_node_pair_list, build_phantom_pairs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user