clang-format code
This commit is contained in:
		
							parent
							
								
									58316c608d
								
							
						
					
					
						commit
						73179641b1
					
				| @ -44,12 +44,12 @@ inline void UnpackCHPath(const DataFacadeT &facade, | ||||
|                          Callback &&callback) | ||||
| { | ||||
|     // make sure we have at least something to unpack
 | ||||
|     if( packed_path_begin == packed_path_end ) | ||||
|     if (packed_path_begin == packed_path_end) | ||||
|         return; | ||||
| 
 | ||||
|     using EdgeData = typename DataFacadeT::EdgeData; | ||||
| 
 | ||||
|     std::stack<std::pair<NodeID,NodeID>> recursion_stack; | ||||
|     std::stack<std::pair<NodeID, NodeID>> recursion_stack; | ||||
| 
 | ||||
|     // We have to push the path in reverse order onto the stack because it's LIFO.
 | ||||
|     for (auto current = std::prev(packed_path_end); current != packed_path_begin; | ||||
|  | ||||
| @ -28,8 +28,8 @@ class MatchPlugin : public BasePlugin | ||||
|     static const constexpr double RADIUS_MULTIPLIER = 3; | ||||
| 
 | ||||
|     MatchPlugin(const int max_locations_map_matching) | ||||
|         : map_matching(heaps, DEFAULT_GPS_PRECISION), | ||||
|           shortest_path(heaps), max_locations_map_matching(max_locations_map_matching) | ||||
|         : map_matching(heaps, DEFAULT_GPS_PRECISION), shortest_path(heaps), | ||||
|           max_locations_map_matching(max_locations_map_matching) | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -26,7 +26,9 @@ namespace plugins | ||||
| class TilePlugin final : public BasePlugin | ||||
| { | ||||
|   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: | ||||
|     explicit TripPlugin(const int max_locations_trip_) | ||||
|         : shortest_path(heaps), duration_table(heaps), | ||||
|           max_locations_trip(max_locations_trip_) | ||||
|         : shortest_path(heaps), duration_table(heaps), max_locations_trip(max_locations_trip_) | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -70,12 +70,9 @@ class AlternativeRouting final | ||||
|         std::vector<SearchSpaceEdge> reverse_search_space; | ||||
| 
 | ||||
|         // Init queues, semi-expensive because access to TSS invokes a sys-call
 | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &forward_heap1 = *(engine_working_data.forward_heap_1); | ||||
|         QueryHeap &reverse_heap1 = *(engine_working_data.reverse_heap_1); | ||||
| @ -340,15 +337,14 @@ class AlternativeRouting final | ||||
|                 (packed_shortest_path.back() != | ||||
|                  phantom_node_pair.target_phantom.forward_segment_id.id)); | ||||
| 
 | ||||
|             super::UnpackPath( | ||||
|                 facade, | ||||
|                 // -- packed input
 | ||||
|                 packed_shortest_path.begin(), | ||||
|                 packed_shortest_path.end(), | ||||
|                 // -- start of route
 | ||||
|                 phantom_node_pair, | ||||
|                 // -- unpacked output
 | ||||
|                 raw_route_data.unpacked_path_segments.front()); | ||||
|             super::UnpackPath(facade, | ||||
|                               // -- packed input
 | ||||
|                               packed_shortest_path.begin(), | ||||
|                               packed_shortest_path.end(), | ||||
|                               // -- start of route
 | ||||
|                               phantom_node_pair, | ||||
|                               // -- unpacked output
 | ||||
|                               raw_route_data.unpacked_path_segments.front()); | ||||
|             raw_route_data.shortest_path_length = upper_bound_to_shortest_path_distance; | ||||
|         } | ||||
| 
 | ||||
| @ -412,15 +408,14 @@ class AlternativeRouting final | ||||
|     // compute and unpack <s,..,v> and <v,..,t> by exploring search spaces
 | ||||
|     // from v and intersecting against queues. only half-searches have to be
 | ||||
|     // done at this stage
 | ||||
|     void ComputeLengthAndSharingOfViaPath(const DataFacadeT& facade, | ||||
|     void ComputeLengthAndSharingOfViaPath(const DataFacadeT &facade, | ||||
|                                           const NodeID via_node, | ||||
|                                           int *real_length_of_via_path, | ||||
|                                           int *sharing_of_via_path, | ||||
|                                           const std::vector<NodeID> &packed_shortest_path, | ||||
|                                           const EdgeWeight min_edge_offset) | ||||
|     { | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &existing_forward_heap = *engine_working_data.forward_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] && | ||||
|                 packed_s_v_path[current_node + 1] == packed_shortest_path[current_node + 1]) | ||||
|             { | ||||
|                 EdgeID edgeID = facade.FindEdgeInEitherDirection( | ||||
|                     packed_s_v_path[current_node], packed_s_v_path[current_node + 1]); | ||||
|                 EdgeID edgeID = facade.FindEdgeInEitherDirection(packed_s_v_path[current_node], | ||||
|                                                                  packed_s_v_path[current_node + 1]); | ||||
|                 *sharing_of_via_path += facade.GetEdgeData(edgeID).distance; | ||||
|             } | ||||
|             else | ||||
| @ -525,7 +520,7 @@ class AlternativeRouting final | ||||
|         { | ||||
|             EdgeID selected_edge = | ||||
|                 facade.FindEdgeInEitherDirection(partially_unpacked_via_path[current_node], | ||||
|                                                   partially_unpacked_via_path[current_node + 1]); | ||||
|                                                  partially_unpacked_via_path[current_node + 1]); | ||||
|             *sharing_of_via_path += facade.GetEdgeData(selected_edge).distance; | ||||
|         } | ||||
| 
 | ||||
| @ -848,8 +843,8 @@ class AlternativeRouting final | ||||
|             if (current_edge_is_shortcut) | ||||
|             { | ||||
|                 const NodeID via_path_middle_node_id = current_edge_data.id; | ||||
|                 const EdgeID second_segment_edge_id = facade.FindEdgeInEitherDirection( | ||||
|                     via_path_middle_node_id, via_path_edge.second); | ||||
|                 const EdgeID second_segment_edge_id = | ||||
|                     facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second); | ||||
|                 const int second_segment_length = | ||||
|                     facade.GetEdgeData(second_segment_edge_id).distance; | ||||
|                 // attention: !unpacking in reverse!
 | ||||
| @ -936,8 +931,7 @@ class AlternativeRouting final | ||||
| 
 | ||||
|         t_test_path_length += unpacked_until_distance; | ||||
|         // Run actual T-Test query and compare if distances equal.
 | ||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearThirdThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &forward_heap3 = *engine_working_data.forward_heap_3; | ||||
|         QueryHeap &reverse_heap3 = *engine_working_data.reverse_heap_3; | ||||
|  | ||||
| @ -39,7 +39,7 @@ class DirectShortestPathRouting final | ||||
| 
 | ||||
|     ~DirectShortestPathRouting() {} | ||||
| 
 | ||||
|     void operator()(const DataFacadeT& facade, | ||||
|     void operator()(const DataFacadeT &facade, | ||||
|                     const std::vector<PhantomNodes> &phantom_nodes_vector, | ||||
|                     InternalRouteResult &raw_route_data) const | ||||
|     { | ||||
| @ -51,8 +51,7 @@ class DirectShortestPathRouting final | ||||
|         const auto &source_phantom = phantom_node_pair.source_phantom; | ||||
|         const auto &target_phantom = phantom_node_pair.target_phantom; | ||||
| 
 | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); | ||||
|         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); | ||||
|         forward_heap.Clear(); | ||||
|  | ||||
| @ -46,7 +46,7 @@ class ManyToManyRouting final | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|     std::vector<EdgeWeight> operator()(const DataFacadeT& facade, | ||||
|     std::vector<EdgeWeight> operator()(const DataFacadeT &facade, | ||||
|                                        const std::vector<PhantomNode> &phantom_nodes, | ||||
|                                        const std::vector<std::size_t> &source_indices, | ||||
|                                        const std::vector<std::size_t> &target_indices) const | ||||
| @ -59,8 +59,7 @@ class ManyToManyRouting final | ||||
|         std::vector<EdgeWeight> result_table(number_of_entries, | ||||
|                                              std::numeric_limits<EdgeWeight>::max()); | ||||
| 
 | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &query_heap = *(engine_working_data.forward_heap_1); | ||||
| 
 | ||||
|  | ||||
| @ -63,8 +63,7 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching< | ||||
|     } | ||||
| 
 | ||||
|   public: | ||||
|     MapMatching(SearchEngineData &engine_working_data, | ||||
|                 const double default_gps_precision) | ||||
|     MapMatching(SearchEngineData &engine_working_data, const double default_gps_precision) | ||||
|         : engine_working_data(engine_working_data), | ||||
|           default_emission_log_probability(default_gps_precision), | ||||
|           transition_log_probability(MATCHING_BETA) | ||||
| @ -158,10 +157,8 @@ class MapMatching final : public BasicRoutingInterface<DataFacadeT, MapMatching< | ||||
|             return sub_matchings; | ||||
|         } | ||||
| 
 | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_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 | ||||
|                                             : facade.GetContinueStraightDefault()); | ||||
| 
 | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage( | ||||
|             facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
|         engine_working_data.InitializeOrClearSecondThreadLocalStorage(facade.GetNumberOfNodes()); | ||||
| 
 | ||||
|         QueryHeap &forward_heap = *(engine_working_data.forward_heap_1); | ||||
|         QueryHeap &reverse_heap = *(engine_working_data.reverse_heap_1); | ||||
|  | ||||
| @ -251,7 +251,7 @@ inline bool requiresNameAnnounced(const std::string &from_name, | ||||
|     // (Guidance Post-Processing does not keep the suffix table around at the moment)
 | ||||
|     struct NopSuffixTable final | ||||
|     { | ||||
|         NopSuffixTable(){} | ||||
|         NopSuffixTable() {} | ||||
|         bool isSuffix(const std::string &) const { return false; } | ||||
|     } static const table; | ||||
| 
 | ||||
|  | ||||
| @ -104,12 +104,12 @@ EdgeWeight getNewWeight(IterType speed_iter, | ||||
|         { | ||||
|             auto speed_file = segment_speed_filenames.at(speed_iter->speed_source.source - 1); | ||||
|             util::SimpleLogger().Write(logWARNING) | ||||
|                 << "[weight updates] Edge weight update from " << old_secs << "s to " << new_secs << "s" | ||||
|                 << ". New speed: " << speed_iter->speed_source.speed << " kph" | ||||
|                 << "[weight updates] Edge weight update from " << old_secs << "s to " << new_secs | ||||
|                 << "s  New speed: " << speed_iter->speed_source.speed << " kph" | ||||
|                 << ". Old speed: " << approx_original_speed << " kph" | ||||
|                 << ". Segment length: " << segment_length << " m" | ||||
|                 << ". Segment: " << speed_iter->segment.from << "," | ||||
|                 << speed_iter->segment.to << " based on " << speed_file; | ||||
|                 << ". Segment: " << speed_iter->segment.from << "," << speed_iter->segment.to | ||||
|                 << " based on " << speed_file; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| @ -593,12 +593,14 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
|                 extractor::QueryNode *u; | ||||
|                 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) | ||||
|                 { | ||||
|                     const unsigned forward_begin = | ||||
|                         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) | ||||
|                     { | ||||
| @ -612,8 +614,7 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
|                                   [m_geometry_list[forward_begin + | ||||
|                                                    leaf_object.fwd_segment_position - 1] | ||||
|                                        .node_id]); | ||||
|                         v = &(internal_to_external_node_map | ||||
|                                   [current_fwd_segment->node_id]); | ||||
|                         v = &(internal_to_external_node_map[current_fwd_segment->node_id]); | ||||
|                     } | ||||
|                     const double segment_length = util::coordinate_calculation::greatCircleDistance( | ||||
|                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); | ||||
| @ -623,12 +624,11 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
| 
 | ||||
|                     if (forward_speed_iter != segment_speed_lookup.end()) | ||||
|                     { | ||||
|                         const auto new_segment_weight = getNewWeight( | ||||
|                             forward_speed_iter, | ||||
|                             segment_length, | ||||
|                             segment_speed_filenames, | ||||
|                             current_fwd_segment->weight, | ||||
|                             log_edge_updates_factor); | ||||
|                         const auto new_segment_weight = getNewWeight(forward_speed_iter, | ||||
|                                                                      segment_length, | ||||
|                                                                      segment_speed_filenames, | ||||
|                                                                      current_fwd_segment->weight, | ||||
|                                                                      log_edge_updates_factor); | ||||
|                         current_fwd_segment->weight = new_segment_weight; | ||||
|                         m_geometry_datasource[forward_begin + leaf_object.fwd_segment_position] = | ||||
|                             forward_speed_iter->speed_source.source; | ||||
| @ -642,7 +642,8 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
|                         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) | ||||
|                 { | ||||
|                     const unsigned reverse_begin = | ||||
| @ -652,7 +653,8 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
| 
 | ||||
|                     int rev_segment_position = | ||||
|                         (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) | ||||
|                     { | ||||
|                         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 + | ||||
|                                                                           rev_segment_position - 1] | ||||
|                                                               .node_id]); | ||||
|                         v = &(internal_to_external_node_map | ||||
|                                   [current_rev_segment->node_id]); | ||||
|                         v = &(internal_to_external_node_map[current_rev_segment->node_id]); | ||||
|                     } | ||||
|                     const double segment_length = util::coordinate_calculation::greatCircleDistance( | ||||
|                         util::Coordinate{u->lon, u->lat}, util::Coordinate{v->lon, v->lat}); | ||||
| @ -675,12 +676,11 @@ EdgeID Contractor::LoadEdgeExpandedGraph( | ||||
|                         find(segment_speed_lookup, Segment{u->node_id, v->node_id}); | ||||
|                     if (reverse_speed_iter != segment_speed_lookup.end()) | ||||
|                     { | ||||
|                         const auto new_segment_weight = getNewWeight( | ||||
|                             reverse_speed_iter, | ||||
|                             segment_length, | ||||
|                             segment_speed_filenames, | ||||
|                             current_rev_segment->weight, | ||||
|                             log_edge_updates_factor); | ||||
|                         const auto new_segment_weight = getNewWeight(reverse_speed_iter, | ||||
|                                                                      segment_length, | ||||
|                                                                      segment_speed_filenames, | ||||
|                                                                      current_rev_segment->weight, | ||||
|                                                                      log_edge_updates_factor); | ||||
|                         current_rev_segment->weight = new_segment_weight; | ||||
|                         m_geometry_datasource[reverse_begin + rev_segment_position] = | ||||
|                             reverse_speed_iter->speed_source.source; | ||||
|  | ||||
| @ -84,11 +84,12 @@ namespace | ||||
| // Abstracted away the query locking into a template function
 | ||||
| // Works the same for every plugin.
 | ||||
| template <typename ParameterT, typename PluginT, typename ResultT> | ||||
| osrm::engine::Status RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock, | ||||
|                               const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade, | ||||
|                               const ParameterT ¶meters, | ||||
|                               PluginT &plugin, | ||||
|                               ResultT &result) | ||||
| osrm::engine::Status | ||||
| RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock, | ||||
|          const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade, | ||||
|          const ParameterT ¶meters, | ||||
|          PluginT &plugin, | ||||
|          ResultT &result) | ||||
| { | ||||
|     if (!lock) | ||||
|     { | ||||
| @ -130,8 +131,7 @@ Engine::Engine(const EngineConfig &config) | ||||
|         { | ||||
|             throw util::exception("Invalid file paths given!"); | ||||
|         } | ||||
|         query_data_facade = | ||||
|             std::make_shared<datafacade::InternalDataFacade>(config.storage_config); | ||||
|         query_data_facade = std::make_shared<datafacade::InternalDataFacade>(config.storage_config); | ||||
|     } | ||||
| 
 | ||||
|     // Register plugins
 | ||||
|  | ||||
| @ -167,7 +167,10 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca | ||||
| 
 | ||||
|     // call the actual map matching
 | ||||
|     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) | ||||
|     { | ||||
| @ -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
 | ||||
|         // bi-directional
 | ||||
|         // 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); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -17,10 +17,7 @@ namespace engine | ||||
| namespace plugins | ||||
| { | ||||
| 
 | ||||
| NearestPlugin::NearestPlugin(const int max_results_) | ||||
|     : max_results{max_results_} | ||||
| { | ||||
| } | ||||
| NearestPlugin::NearestPlugin(const int max_results_) : max_results{max_results_} {} | ||||
| 
 | ||||
| Status NearestPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade, | ||||
|                                     const api::NearestParameters ¶ms, | ||||
|  | ||||
| @ -24,8 +24,7 @@ namespace plugins | ||||
| { | ||||
| 
 | ||||
| TablePlugin::TablePlugin(const int max_locations_distance_table) | ||||
|     : distance_table(heaps), | ||||
|       max_locations_distance_table(max_locations_distance_table) | ||||
|     : distance_table(heaps), 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 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()) | ||||
|     { | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| #include "engine/plugins/tile.hpp" | ||||
| #include "engine/edge_unpacker.hpp" | ||||
| #include "engine/plugins/plugin_base.hpp" | ||||
| #include "engine/plugins/tile.hpp" | ||||
| 
 | ||||
| #include "util/coordinate_calculation.hpp" | ||||
| #include "util/vector_tile.hpp" | ||||
| @ -511,19 +511,23 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
|                     // when exactly?  Anyway, unpack it and get the first "real" edgedata
 | ||||
|                     // out of it, which should represent the first hop, which is the one
 | ||||
|                     // we want to find the turn.
 | ||||
|                     const auto &data = | ||||
|                         [this, &facade, smaller_edge_id, source_ebn, target_ebn, &unpacked_shortcut]() { | ||||
|                             const auto inner_data = facade->GetEdgeData(smaller_edge_id); | ||||
|                             if (inner_data.shortcut) | ||||
|                             { | ||||
|                                 unpacked_shortcut.clear(); | ||||
|                                 UnpackEdgeToEdges( | ||||
|                                     *facade, source_ebn.first, target_ebn, unpacked_shortcut); | ||||
|                                 return unpacked_shortcut.front(); | ||||
|                             } | ||||
|                             else | ||||
|                                 return inner_data; | ||||
|                         }(); | ||||
|                     const auto &data = [this, | ||||
|                                         &facade, | ||||
|                                         smaller_edge_id, | ||||
|                                         source_ebn, | ||||
|                                         target_ebn, | ||||
|                                         &unpacked_shortcut]() { | ||||
|                         const auto inner_data = facade->GetEdgeData(smaller_edge_id); | ||||
|                         if (inner_data.shortcut) | ||||
|                         { | ||||
|                             unpacked_shortcut.clear(); | ||||
|                             UnpackEdgeToEdges( | ||||
|                                 *facade, source_ebn.first, target_ebn, unpacked_shortcut); | ||||
|                             return unpacked_shortcut.front(); | ||||
|                         } | ||||
|                         else | ||||
|                             return inner_data; | ||||
|                     }(); | ||||
|                     BOOST_ASSERT_MSG(!data.shortcut, "Connecting edge must not be a shortcut"); | ||||
| 
 | ||||
|                     // This is the geometry leading away from the intersection
 | ||||
| @ -535,7 +539,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
|                     // Now, calculate the sum of the weight of all the segments.
 | ||||
|                     forward_weight_vector.clear(); | ||||
|                     facade->GetUncompressedWeights(source_ebn.second.packed_geometry_id, | ||||
|                                                   forward_weight_vector); | ||||
|                                                    forward_weight_vector); | ||||
|                     const auto sum_node_weight = std::accumulate( | ||||
|                         forward_weight_vector.begin(), forward_weight_vector.end(), EdgeWeight{0}); | ||||
| 
 | ||||
| @ -620,7 +624,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
| 
 | ||||
|             forward_datasource_vector.clear(); | ||||
|             facade->GetUncompressedDatasources(edge.forward_packed_geometry_id, | ||||
|                                               forward_datasource_vector); | ||||
|                                                forward_datasource_vector); | ||||
|             forward_datasource = forward_datasource_vector[edge.fwd_segment_position]; | ||||
| 
 | ||||
|             use_line_value(forward_weight); | ||||
| @ -638,7 +642,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
| 
 | ||||
|             reverse_datasource_vector.clear(); | ||||
|             facade->GetUncompressedDatasources(edge.reverse_packed_geometry_id, | ||||
|                                               reverse_datasource_vector); | ||||
|                                                reverse_datasource_vector); | ||||
|             reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() - | ||||
|                                                            edge.fwd_segment_position - 1]; | ||||
| 
 | ||||
| @ -707,12 +711,12 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
|                     { | ||||
|                         forward_weight_vector.clear(); | ||||
|                         facade->GetUncompressedWeights(edge.forward_packed_geometry_id, | ||||
|                                                       forward_weight_vector); | ||||
|                                                        forward_weight_vector); | ||||
|                         forward_weight = forward_weight_vector[edge.fwd_segment_position]; | ||||
| 
 | ||||
|                         forward_datasource_vector.clear(); | ||||
|                         facade->GetUncompressedDatasources(edge.forward_packed_geometry_id, | ||||
|                                                           forward_datasource_vector); | ||||
|                                                            forward_datasource_vector); | ||||
|                         forward_datasource = forward_datasource_vector[edge.fwd_segment_position]; | ||||
|                     } | ||||
| 
 | ||||
| @ -720,7 +724,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
|                     { | ||||
|                         reverse_weight_vector.clear(); | ||||
|                         facade->GetUncompressedWeights(edge.reverse_packed_geometry_id, | ||||
|                                                       reverse_weight_vector); | ||||
|                                                        reverse_weight_vector); | ||||
| 
 | ||||
|                         BOOST_ASSERT(edge.fwd_segment_position < reverse_weight_vector.size()); | ||||
| 
 | ||||
| @ -729,7 +733,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad | ||||
| 
 | ||||
|                         reverse_datasource_vector.clear(); | ||||
|                         facade->GetUncompressedDatasources(edge.reverse_packed_geometry_id, | ||||
|                                                           reverse_datasource_vector); | ||||
|                                                            reverse_datasource_vector); | ||||
|                         reverse_datasource = | ||||
|                             reverse_datasource_vector[reverse_datasource_vector.size() - | ||||
|                                                       edge.fwd_segment_position - 1]; | ||||
|  | ||||
| @ -114,7 +114,7 @@ SCC_Component SplitUnaccessibleLocations(const std::size_t number_of_locations, | ||||
|     return SCC_Component(std::move(components), std::move(range)); | ||||
| } | ||||
| 
 | ||||
| InternalRouteResult TripPlugin::ComputeRoute(const datafacade::BaseDataFacade& facade, | ||||
| InternalRouteResult TripPlugin::ComputeRoute(const datafacade::BaseDataFacade &facade, | ||||
|                                              const std::vector<PhantomNode> &snapped_phantoms, | ||||
|                                              const std::vector<NodeID> &trip) | ||||
| { | ||||
|  | ||||
| @ -98,7 +98,9 @@ Status ViaRoutePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataF | ||||
|     else | ||||
|     { | ||||
|         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
 | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| #include "extractor/guidance/constants.hpp" | ||||
| #include "extractor/guidance/intersection_generator.hpp" | ||||
| #include "extractor/guidance/constants.hpp" | ||||
| #include "extractor/guidance/toolkit.hpp" | ||||
| 
 | ||||
| #include <algorithm> | ||||
|  | ||||
| @ -4,7 +4,6 @@ | ||||
| 
 | ||||
| #include "util/coordinate_calculation.hpp" | ||||
| #include "util/guidance/toolkit.hpp" | ||||
| #include "util/guidance/toolkit.hpp" | ||||
| #include "util/simple_logger.hpp" | ||||
| 
 | ||||
| #include <algorithm> | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| #include "extractor/guidance/sliproad_handler.hpp" | ||||
| #include "extractor/guidance/constants.hpp" | ||||
| #include "extractor/guidance/intersection_scenario_three_way.hpp" | ||||
| #include "extractor/guidance/sliproad_handler.hpp" | ||||
| #include "extractor/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/intersection_scenario_three_way.hpp" | ||||
| #include "extractor/guidance/toolkit.hpp" | ||||
| #include "extractor/guidance/turn_handler.hpp" | ||||
| 
 | ||||
| #include "util/guidance/toolkit.hpp" | ||||
| 
 | ||||
|  | ||||
| @ -21,7 +21,8 @@ OSRM &OSRM::operator=(OSRM &&) noexcept = default; | ||||
| 
 | ||||
| // 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); | ||||
| } | ||||
| @ -31,7 +32,8 @@ engine::Status OSRM::Table(const engine::api::TableParameters ¶ms, json::Obj | ||||
|     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); | ||||
| } | ||||
|  | ||||
| @ -56,7 +56,8 @@ return_code parseArguments(int argc, char *argv[], contractor::ContractorConfig | ||||
|         "edge-weight-updates-over-factor", | ||||
|         boost::program_options::value<double>(&contractor_config.log_edge_updates_factor) | ||||
|             ->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
 | ||||
|     boost::program_options::options_description hidden_options("Hidden options"); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user