clang-format code
This commit is contained in:
		
							parent
							
								
									58316c608d
								
							
						
					
					
						commit
						73179641b1
					
				| @ -28,8 +28,8 @@ class MatchPlugin : public BasePlugin | |||||||
|     static const constexpr double RADIUS_MULTIPLIER = 3; |     static const constexpr double RADIUS_MULTIPLIER = 3; | ||||||
| 
 | 
 | ||||||
|     MatchPlugin(const int max_locations_map_matching) |     MatchPlugin(const int max_locations_map_matching) | ||||||
|         : map_matching(heaps, DEFAULT_GPS_PRECISION), |         : map_matching(heaps, DEFAULT_GPS_PRECISION), shortest_path(heaps), | ||||||
|           shortest_path(heaps), max_locations_map_matching(max_locations_map_matching) |           max_locations_map_matching(max_locations_map_matching) | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -26,7 +26,9 @@ namespace plugins | |||||||
| class TilePlugin final : public BasePlugin | class TilePlugin final : public BasePlugin | ||||||
| { | { | ||||||
|   public: |   public: | ||||||
|     Status HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade, const api::TileParameters ¶meters, std::string &pbf_buffer) const; |     Status HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade, | ||||||
|  |                          const api::TileParameters ¶meters, | ||||||
|  |                          std::string &pbf_buffer) const; | ||||||
| }; | }; | ||||||
| } | } | ||||||
| } | } | ||||||
|  | |||||||
| @ -40,8 +40,7 @@ class TripPlugin final : public BasePlugin | |||||||
| 
 | 
 | ||||||
|   public: |   public: | ||||||
|     explicit TripPlugin(const int max_locations_trip_) |     explicit TripPlugin(const int max_locations_trip_) | ||||||
|         : shortest_path(heaps), duration_table(heaps), |         : shortest_path(heaps), duration_table(heaps), max_locations_trip(max_locations_trip_) | ||||||
|           max_locations_trip(max_locations_trip_) |  | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -70,12 +70,9 @@ class AlternativeRouting final | |||||||
|         std::vector<SearchSpaceEdge> reverse_search_space; |         std::vector<SearchSpaceEdge> reverse_search_space; | ||||||
| 
 | 
 | ||||||
|         // Init queues, semi-expensive because access to TSS invokes a sys-call
 |         // Init queues, semi-expensive because access to TSS invokes a sys-call
 | ||||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( |         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( |         engine_working_data.InitializeOrClearThirdThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage( |  | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &forward_heap1 = *(engine_working_data.forward_heap_1); |         QueryHeap &forward_heap1 = *(engine_working_data.forward_heap_1); | ||||||
|         QueryHeap &reverse_heap1 = *(engine_working_data.reverse_heap_1); |         QueryHeap &reverse_heap1 = *(engine_working_data.reverse_heap_1); | ||||||
| @ -340,8 +337,7 @@ class AlternativeRouting final | |||||||
|                 (packed_shortest_path.back() != |                 (packed_shortest_path.back() != | ||||||
|                  phantom_node_pair.target_phantom.forward_segment_id.id)); |                  phantom_node_pair.target_phantom.forward_segment_id.id)); | ||||||
| 
 | 
 | ||||||
|             super::UnpackPath( |             super::UnpackPath(facade, | ||||||
|                 facade, |  | ||||||
|                               // -- packed input
 |                               // -- packed input
 | ||||||
|                               packed_shortest_path.begin(), |                               packed_shortest_path.begin(), | ||||||
|                               packed_shortest_path.end(), |                               packed_shortest_path.end(), | ||||||
| @ -419,8 +415,7 @@ class AlternativeRouting final | |||||||
|                                           const std::vector<NodeID> &packed_shortest_path, |                                           const std::vector<NodeID> &packed_shortest_path, | ||||||
|                                           const EdgeWeight min_edge_offset) |                                           const EdgeWeight min_edge_offset) | ||||||
|     { |     { | ||||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( |         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &existing_forward_heap = *engine_working_data.forward_heap_1; |         QueryHeap &existing_forward_heap = *engine_working_data.forward_heap_1; | ||||||
|         QueryHeap &existing_reverse_heap = *engine_working_data.reverse_heap_1; |         QueryHeap &existing_reverse_heap = *engine_working_data.reverse_heap_1; | ||||||
| @ -491,8 +486,8 @@ class AlternativeRouting final | |||||||
|             if (packed_s_v_path[current_node] == packed_shortest_path[current_node] && |             if (packed_s_v_path[current_node] == packed_shortest_path[current_node] && | ||||||
|                 packed_s_v_path[current_node + 1] == packed_shortest_path[current_node + 1]) |                 packed_s_v_path[current_node + 1] == packed_shortest_path[current_node + 1]) | ||||||
|             { |             { | ||||||
|                 EdgeID edgeID = facade.FindEdgeInEitherDirection( |                 EdgeID edgeID = facade.FindEdgeInEitherDirection(packed_s_v_path[current_node], | ||||||
|                     packed_s_v_path[current_node], packed_s_v_path[current_node + 1]); |                                                                  packed_s_v_path[current_node + 1]); | ||||||
|                 *sharing_of_via_path += facade.GetEdgeData(edgeID).distance; |                 *sharing_of_via_path += facade.GetEdgeData(edgeID).distance; | ||||||
|             } |             } | ||||||
|             else |             else | ||||||
| @ -848,8 +843,8 @@ class AlternativeRouting final | |||||||
|             if (current_edge_is_shortcut) |             if (current_edge_is_shortcut) | ||||||
|             { |             { | ||||||
|                 const NodeID via_path_middle_node_id = current_edge_data.id; |                 const NodeID via_path_middle_node_id = current_edge_data.id; | ||||||
|                 const EdgeID second_segment_edge_id = facade.FindEdgeInEitherDirection( |                 const EdgeID second_segment_edge_id = | ||||||
|                     via_path_middle_node_id, via_path_edge.second); |                     facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second); | ||||||
|                 const int second_segment_length = |                 const int second_segment_length = | ||||||
|                     facade.GetEdgeData(second_segment_edge_id).distance; |                     facade.GetEdgeData(second_segment_edge_id).distance; | ||||||
|                 // attention: !unpacking in reverse!
 |                 // attention: !unpacking in reverse!
 | ||||||
| @ -936,8 +931,7 @@ class AlternativeRouting final | |||||||
| 
 | 
 | ||||||
|         t_test_path_length += unpacked_until_distance; |         t_test_path_length += unpacked_until_distance; | ||||||
|         // Run actual T-Test query and compare if distances equal.
 |         // Run actual T-Test query and compare if distances equal.
 | ||||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage( |         engine_working_data.InitializeOrClearThirdThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &forward_heap3 = *engine_working_data.forward_heap_3; |         QueryHeap &forward_heap3 = *engine_working_data.forward_heap_3; | ||||||
|         QueryHeap &reverse_heap3 = *engine_working_data.reverse_heap_3; |         QueryHeap &reverse_heap3 = *engine_working_data.reverse_heap_3; | ||||||
|  | |||||||
| @ -51,8 +51,7 @@ class DirectShortestPathRouting final | |||||||
|         const auto &source_phantom = phantom_node_pair.source_phantom; |         const auto &source_phantom = phantom_node_pair.source_phantom; | ||||||
|         const auto &target_phantom = phantom_node_pair.target_phantom; |         const auto &target_phantom = phantom_node_pair.target_phantom; | ||||||
| 
 | 
 | ||||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( |         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); |         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); | ||||||
|         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); |         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); | ||||||
|         forward_heap.Clear(); |         forward_heap.Clear(); | ||||||
|  | |||||||
| @ -59,8 +59,7 @@ class ManyToManyRouting final | |||||||
|         std::vector<EdgeWeight> result_table(number_of_entries, |         std::vector<EdgeWeight> result_table(number_of_entries, | ||||||
|                                              std::numeric_limits<EdgeWeight>::max()); |                                              std::numeric_limits<EdgeWeight>::max()); | ||||||
| 
 | 
 | ||||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( |         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &query_heap = *(engine_working_data.forward_heap_1); |         QueryHeap &query_heap = *(engine_working_data.forward_heap_1); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -63,8 +63,7 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching< | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   public: |   public: | ||||||
|     MapMatching(SearchEngineData &engine_working_data, |     MapMatching(SearchEngineData &engine_working_data, const double default_gps_precision) | ||||||
|                 const double default_gps_precision) |  | ||||||
|         : engine_working_data(engine_working_data), |         : engine_working_data(engine_working_data), | ||||||
|           default_emission_log_probability(default_gps_precision), |           default_emission_log_probability(default_gps_precision), | ||||||
|           transition_log_probability(MATCHING_BETA) |           transition_log_probability(MATCHING_BETA) | ||||||
| @ -158,10 +157,8 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching< | |||||||
|             return sub_matchings; |             return sub_matchings; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( |         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( |  | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); |         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); | ||||||
|         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); |         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); | ||||||
|  | |||||||
| @ -290,10 +290,8 @@ class ShortestPathRouting final | |||||||
|             !(continue_straight_at_waypoint ? *continue_straight_at_waypoint |             !(continue_straight_at_waypoint ? *continue_straight_at_waypoint | ||||||
|                                             : facade.GetContinueStraightDefault()); |                                             : facade.GetContinueStraightDefault()); | ||||||
| 
 | 
 | ||||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( |         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|             facade.GetNumberOfNodes()); |         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( |  | ||||||
|             facade.GetNumberOfNodes()); |  | ||||||
| 
 | 
 | ||||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); |         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); | ||||||
|         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); |         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); | ||||||
|  | |||||||
| @ -104,12 +104,12 @@ EdgeWeight getNewWeight(IterType speed_iter, | |||||||
|         { |         { | ||||||
|             auto speed_file = segment_speed_filenames.at(speed_iter->speed_source.source - 1); |             auto speed_file = segment_speed_filenames.at(speed_iter->speed_source.source - 1); | ||||||
|             util::SimpleLogger().Write(logWARNING) |             util::SimpleLogger().Write(logWARNING) | ||||||
|                 << "[weight updates] Edge weight update from " << old_secs << "s to " << new_secs << "s" |                 << "[weight updates] Edge weight update from " << old_secs << "s to " << new_secs | ||||||
|                 << ". New speed: " << speed_iter->speed_source.speed << " kph" |                 << "s  New speed: " << speed_iter->speed_source.speed << " kph" | ||||||
|                 << ". Old speed: " << approx_original_speed << " kph" |                 << ". Old speed: " << approx_original_speed << " kph" | ||||||
|                 << ". Segment length: " << segment_length << " m" |                 << ". Segment length: " << segment_length << " m" | ||||||
|                 << ". Segment: " << speed_iter->segment.from << "," |                 << ". Segment: " << speed_iter->segment.from << "," << speed_iter->segment.to | ||||||
|                 << speed_iter->segment.to << " based on " << speed_file; |                 << " based on " << speed_file; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -593,12 +593,14 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
|                 extractor::QueryNode *u; |                 extractor::QueryNode *u; | ||||||
|                 extractor::QueryNode *v; |                 extractor::QueryNode *v; | ||||||
| 
 | 
 | ||||||
|                 // forward_packed_geometry_id is the index id for geometry, weight and duration of the segments
 |                 // forward_packed_geometry_id is the index id for geometry, weight and duration of
 | ||||||
|  |                 // the segments
 | ||||||
|                 if (leaf_object.forward_packed_geometry_id != SPECIAL_EDGEID) |                 if (leaf_object.forward_packed_geometry_id != SPECIAL_EDGEID) | ||||||
|                 { |                 { | ||||||
|                     const unsigned forward_begin = |                     const unsigned forward_begin = | ||||||
|                         m_geometry_indices.at(leaf_object.forward_packed_geometry_id); |                         m_geometry_indices.at(leaf_object.forward_packed_geometry_id); | ||||||
|                     const auto current_fwd_segment = &(m_geometry_list[forward_begin + leaf_object.fwd_segment_position]); |                     const auto current_fwd_segment = | ||||||
|  |                         &(m_geometry_list[forward_begin + leaf_object.fwd_segment_position]); | ||||||
| 
 | 
 | ||||||
|                     if (leaf_object.fwd_segment_position == 0) |                     if (leaf_object.fwd_segment_position == 0) | ||||||
|                     { |                     { | ||||||
| @ -612,8 +614,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
|                                   [m_geometry_list[forward_begin + |                                   [m_geometry_list[forward_begin + | ||||||
|                                                    leaf_object.fwd_segment_position - 1] |                                                    leaf_object.fwd_segment_position - 1] | ||||||
|                                        .node_id]); |                                        .node_id]); | ||||||
|                         v = &(internal_to_external_node_map |                         v = &(internal_to_external_node_map[current_fwd_segment->node_id]); | ||||||
|                                   [current_fwd_segment->node_id]); |  | ||||||
|                     } |                     } | ||||||
|                     const double segment_length = util::coordinate_calculation::greatCircleDistance( |                     const double segment_length = util::coordinate_calculation::greatCircleDistance( | ||||||
|                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); |                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); | ||||||
| @ -623,8 +624,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
| 
 | 
 | ||||||
|                     if (forward_speed_iter != segment_speed_lookup.end()) |                     if (forward_speed_iter != segment_speed_lookup.end()) | ||||||
|                     { |                     { | ||||||
|                         const auto new_segment_weight = getNewWeight( |                         const auto new_segment_weight = getNewWeight(forward_speed_iter, | ||||||
|                             forward_speed_iter, |  | ||||||
|                                                                      segment_length, |                                                                      segment_length, | ||||||
|                                                                      segment_speed_filenames, |                                                                      segment_speed_filenames, | ||||||
|                                                                      current_fwd_segment->weight, |                                                                      current_fwd_segment->weight, | ||||||
| @ -642,7 +642,8 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
|                         counters[LUA_SOURCE] += 1; |                         counters[LUA_SOURCE] += 1; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 // reverse_packed_geometry_id is the index id for geometry, weight and duration of the segment
 |                 // reverse_packed_geometry_id is the index id for geometry, weight and duration of
 | ||||||
|  |                 // the segment
 | ||||||
|                 if (leaf_object.reverse_packed_geometry_id != SPECIAL_EDGEID) |                 if (leaf_object.reverse_packed_geometry_id != SPECIAL_EDGEID) | ||||||
|                 { |                 { | ||||||
|                     const unsigned reverse_begin = |                     const unsigned reverse_begin = | ||||||
| @ -652,7 +653,8 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
| 
 | 
 | ||||||
|                     int rev_segment_position = |                     int rev_segment_position = | ||||||
|                         (reverse_end - reverse_begin) - leaf_object.fwd_segment_position - 1; |                         (reverse_end - reverse_begin) - leaf_object.fwd_segment_position - 1; | ||||||
|                     const auto current_rev_segment = &(m_geometry_list[reverse_begin + rev_segment_position]); |                     const auto current_rev_segment = | ||||||
|  |                         &(m_geometry_list[reverse_begin + rev_segment_position]); | ||||||
|                     if (rev_segment_position == 0) |                     if (rev_segment_position == 0) | ||||||
|                     { |                     { | ||||||
|                         u = &(internal_to_external_node_map[leaf_object.v]); |                         u = &(internal_to_external_node_map[leaf_object.v]); | ||||||
| @ -665,8 +667,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
|                             internal_to_external_node_map[m_geometry_list[reverse_begin + |                             internal_to_external_node_map[m_geometry_list[reverse_begin + | ||||||
|                                                                           rev_segment_position - 1] |                                                                           rev_segment_position - 1] | ||||||
|                                                               .node_id]); |                                                               .node_id]); | ||||||
|                         v = &(internal_to_external_node_map |                         v = &(internal_to_external_node_map[current_rev_segment->node_id]); | ||||||
|                                   [current_rev_segment->node_id]); |  | ||||||
|                     } |                     } | ||||||
|                     const double segment_length = util::coordinate_calculation::greatCircleDistance( |                     const double segment_length = util::coordinate_calculation::greatCircleDistance( | ||||||
|                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); |                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); | ||||||
| @ -675,8 +676,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | |||||||
|                         find(segment_speed_lookup, Segment{u->node_id, v->node_id}); |                         find(segment_speed_lookup, Segment{u->node_id, v->node_id}); | ||||||
|                     if (reverse_speed_iter != segment_speed_lookup.end()) |                     if (reverse_speed_iter != segment_speed_lookup.end()) | ||||||
|                     { |                     { | ||||||
|                         const auto new_segment_weight = getNewWeight( |                         const auto new_segment_weight = getNewWeight(reverse_speed_iter, | ||||||
|                             reverse_speed_iter, |  | ||||||
|                                                                      segment_length, |                                                                      segment_length, | ||||||
|                                                                      segment_speed_filenames, |                                                                      segment_speed_filenames, | ||||||
|                                                                      current_rev_segment->weight, |                                                                      current_rev_segment->weight, | ||||||
|  | |||||||
| @ -84,7 +84,8 @@ namespace | |||||||
| // Abstracted away the query locking into a template function
 | // Abstracted away the query locking into a template function
 | ||||||
| // Works the same for every plugin.
 | // Works the same for every plugin.
 | ||||||
| template <typename ParameterT, typename PluginT, typename ResultT> | template <typename ParameterT, typename PluginT, typename ResultT> | ||||||
| osrm::engine::Status RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock, | osrm::engine::Status | ||||||
|  | RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock, | ||||||
|          const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade, |          const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade, | ||||||
|          const ParameterT ¶meters, |          const ParameterT ¶meters, | ||||||
|          PluginT &plugin, |          PluginT &plugin, | ||||||
| @ -130,8 +131,7 @@ Engine::Engine(const EngineConfig &config) | |||||||
|         { |         { | ||||||
|             throw util::exception("Invalid file paths given!"); |             throw util::exception("Invalid file paths given!"); | ||||||
|         } |         } | ||||||
|         query_data_facade = |         query_data_facade = std::make_shared<datafacade::InternalDataFacade>(config.storage_config); | ||||||
|             std::make_shared<datafacade::InternalDataFacade>(config.storage_config); |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Register plugins
 |     // Register plugins
 | ||||||
|  | |||||||
| @ -167,7 +167,10 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca | |||||||
| 
 | 
 | ||||||
|     // call the actual map matching
 |     // call the actual map matching
 | ||||||
|     SubMatchingList sub_matchings = map_matching(*facade, |     SubMatchingList sub_matchings = map_matching(*facade, | ||||||
|         candidates_lists, parameters.coordinates, parameters.timestamps, parameters.radiuses); |                                                  candidates_lists, | ||||||
|  |                                                  parameters.coordinates, | ||||||
|  |                                                  parameters.timestamps, | ||||||
|  |                                                  parameters.radiuses); | ||||||
| 
 | 
 | ||||||
|     if (sub_matchings.size() == 0) |     if (sub_matchings.size() == 0) | ||||||
|     { |     { | ||||||
| @ -193,7 +196,8 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca | |||||||
|         // force uturns to be on, since we split the phantom nodes anyway and only have
 |         // force uturns to be on, since we split the phantom nodes anyway and only have
 | ||||||
|         // bi-directional
 |         // bi-directional
 | ||||||
|         // phantom nodes for possible uturns
 |         // phantom nodes for possible uturns
 | ||||||
|         shortest_path(*facade, sub_routes[index].segment_end_coordinates, {false}, sub_routes[index]); |         shortest_path( | ||||||
|  |             *facade, sub_routes[index].segment_end_coordinates, {false}, sub_routes[index]); | ||||||
|         BOOST_ASSERT(sub_routes[index].shortest_path_length != INVALID_EDGE_WEIGHT); |         BOOST_ASSERT(sub_routes[index].shortest_path_length != INVALID_EDGE_WEIGHT); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -17,10 +17,7 @@ namespace engine | |||||||
| namespace plugins | namespace plugins | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
| NearestPlugin::NearestPlugin(const int max_results_) | NearestPlugin::NearestPlugin(const int max_results_) : max_results{max_results_} {} | ||||||
|     : max_results{max_results_} |  | ||||||
| { |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| Status NearestPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade, | Status NearestPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade, | ||||||
|                                     const api::NearestParameters ¶ms, |                                     const api::NearestParameters ¶ms, | ||||||
|  | |||||||
| @ -24,8 +24,7 @@ namespace plugins | |||||||
| { | { | ||||||
| 
 | 
 | ||||||
| TablePlugin::TablePlugin(const int max_locations_distance_table) | TablePlugin::TablePlugin(const int max_locations_distance_table) | ||||||
|     : distance_table(heaps), |     : distance_table(heaps), max_locations_distance_table(max_locations_distance_table) | ||||||
|       max_locations_distance_table(max_locations_distance_table) |  | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -61,7 +60,8 @@ Status TablePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     auto snapped_phantoms = SnapPhantomNodes(GetPhantomNodes(*facade, params)); |     auto snapped_phantoms = SnapPhantomNodes(GetPhantomNodes(*facade, params)); | ||||||
|     auto result_table = distance_table(*facade, snapped_phantoms, params.sources, params.destinations); |     auto result_table = | ||||||
|  |         distance_table(*facade, snapped_phantoms, params.sources, params.destinations); | ||||||
| 
 | 
 | ||||||
|     if (result_table.empty()) |     if (result_table.empty()) | ||||||
|     { |     { | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
|  | #include "engine/plugins/tile.hpp" | ||||||
| #include "engine/edge_unpacker.hpp" | #include "engine/edge_unpacker.hpp" | ||||||
| #include "engine/plugins/plugin_base.hpp" | #include "engine/plugins/plugin_base.hpp" | ||||||
| #include "engine/plugins/tile.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "util/coordinate_calculation.hpp" | #include "util/coordinate_calculation.hpp" | ||||||
| #include "util/vector_tile.hpp" | #include "util/vector_tile.hpp" | ||||||
| @ -511,8 +511,12 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | |||||||
|                     // when exactly?  Anyway, unpack it and get the first "real" edgedata
 |                     // when exactly?  Anyway, unpack it and get the first "real" edgedata
 | ||||||
|                     // out of it, which should represent the first hop, which is the one
 |                     // out of it, which should represent the first hop, which is the one
 | ||||||
|                     // we want to find the turn.
 |                     // we want to find the turn.
 | ||||||
|                     const auto &data = |                     const auto &data = [this, | ||||||
|                         [this, &facade, smaller_edge_id, source_ebn, target_ebn, &unpacked_shortcut]() { |                                         &facade, | ||||||
|  |                                         smaller_edge_id, | ||||||
|  |                                         source_ebn, | ||||||
|  |                                         target_ebn, | ||||||
|  |                                         &unpacked_shortcut]() { | ||||||
|                         const auto inner_data = facade->GetEdgeData(smaller_edge_id); |                         const auto inner_data = facade->GetEdgeData(smaller_edge_id); | ||||||
|                         if (inner_data.shortcut) |                         if (inner_data.shortcut) | ||||||
|                         { |                         { | ||||||
|  | |||||||
| @ -98,7 +98,9 @@ Status ViaRoutePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataF | |||||||
|     else |     else | ||||||
|     { |     { | ||||||
|         shortest_path(*facade, |         shortest_path(*facade, | ||||||
|             raw_route.segment_end_coordinates, route_parameters.continue_straight, raw_route); |                       raw_route.segment_end_coordinates, | ||||||
|  |                       route_parameters.continue_straight, | ||||||
|  |                       raw_route); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // we can only know this after the fact, different SCC ids still
 |     // we can only know this after the fact, different SCC ids still
 | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| #include "extractor/guidance/constants.hpp" |  | ||||||
| #include "extractor/guidance/intersection_generator.hpp" | #include "extractor/guidance/intersection_generator.hpp" | ||||||
|  | #include "extractor/guidance/constants.hpp" | ||||||
| #include "extractor/guidance/toolkit.hpp" | #include "extractor/guidance/toolkit.hpp" | ||||||
| 
 | 
 | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
|  | |||||||
| @ -4,7 +4,6 @@ | |||||||
| 
 | 
 | ||||||
| #include "util/coordinate_calculation.hpp" | #include "util/coordinate_calculation.hpp" | ||||||
| #include "util/guidance/toolkit.hpp" | #include "util/guidance/toolkit.hpp" | ||||||
| #include "util/guidance/toolkit.hpp" |  | ||||||
| #include "util/simple_logger.hpp" | #include "util/simple_logger.hpp" | ||||||
| 
 | 
 | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
|  | #include "extractor/guidance/sliproad_handler.hpp" | ||||||
| #include "extractor/guidance/constants.hpp" | #include "extractor/guidance/constants.hpp" | ||||||
| #include "extractor/guidance/intersection_scenario_three_way.hpp" | #include "extractor/guidance/intersection_scenario_three_way.hpp" | ||||||
| #include "extractor/guidance/sliproad_handler.hpp" |  | ||||||
| #include "extractor/guidance/toolkit.hpp" | #include "extractor/guidance/toolkit.hpp" | ||||||
| 
 | 
 | ||||||
| #include "util/guidance/toolkit.hpp" | #include "util/guidance/toolkit.hpp" | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
|  | #include "extractor/guidance/turn_handler.hpp" | ||||||
| #include "extractor/guidance/constants.hpp" | #include "extractor/guidance/constants.hpp" | ||||||
| #include "extractor/guidance/intersection_scenario_three_way.hpp" | #include "extractor/guidance/intersection_scenario_three_way.hpp" | ||||||
| #include "extractor/guidance/toolkit.hpp" | #include "extractor/guidance/toolkit.hpp" | ||||||
| #include "extractor/guidance/turn_handler.hpp" |  | ||||||
| 
 | 
 | ||||||
| #include "util/guidance/toolkit.hpp" | #include "util/guidance/toolkit.hpp" | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,7 +21,8 @@ OSRM &OSRM::operator=(OSRM &&) noexcept = default; | |||||||
| 
 | 
 | ||||||
| // Forward to implementation
 | // Forward to implementation
 | ||||||
| 
 | 
 | ||||||
| engine::Status OSRM::Route(const engine::api::RouteParameters ¶ms, util::json::Object &result) const | engine::Status OSRM::Route(const engine::api::RouteParameters ¶ms, | ||||||
|  |                            util::json::Object &result) const | ||||||
| { | { | ||||||
|     return engine_->Route(params, result); |     return engine_->Route(params, result); | ||||||
| } | } | ||||||
| @ -31,7 +32,8 @@ engine::Status OSRM::Table(const engine::api::TableParameters ¶ms, json::Obj | |||||||
|     return engine_->Table(params, result); |     return engine_->Table(params, result); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| engine::Status OSRM::Nearest(const engine::api::NearestParameters ¶ms, json::Object &result) const | engine::Status OSRM::Nearest(const engine::api::NearestParameters ¶ms, | ||||||
|  |                              json::Object &result) const | ||||||
| { | { | ||||||
|     return engine_->Nearest(params, result); |     return engine_->Nearest(params, result); | ||||||
| } | } | ||||||
|  | |||||||
| @ -56,7 +56,8 @@ return_code parseArguments(int argc, char *argv[], contractor::ContractorConfig | |||||||
|         "edge-weight-updates-over-factor", |         "edge-weight-updates-over-factor", | ||||||
|         boost::program_options::value<double>(&contractor_config.log_edge_updates_factor) |         boost::program_options::value<double>(&contractor_config.log_edge_updates_factor) | ||||||
|             ->default_value(0.0), |             ->default_value(0.0), | ||||||
|         "Use with `--segment-speed-file`. Provide an `x` factor, by which Extractor will log edge weights updated by more than this factor"); |         "Use with `--segment-speed-file`. Provide an `x` factor, by which Extractor will log edge " | ||||||
|  |         "weights updated by more than this factor"); | ||||||
| 
 | 
 | ||||||
|     // hidden options, will be allowed on command line, but will not be shown to the user
 |     // hidden options, will be allowed on command line, but will not be shown to the user
 | ||||||
|     boost::program_options::options_description hidden_options("Hidden options"); |     boost::program_options::options_description hidden_options("Hidden options"); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user