diff options
author | Добрый Ээх <bukharaev@gmail.com> | 2017-04-07 12:48:45 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2017-04-07 22:28:28 +0300 |
commit | ebaa757bcbb4b6e3dd449d017cebf1508b06c533 (patch) | |
tree | 4f3f428f827876f54e92a610b389fe91209644b2 /generator | |
parent | 7c5cd060642be3e710a0ae1200b1c0ba7e844bee (diff) |
[routing] Flag for disabling cross mwm progress logs
Diffstat (limited to 'generator')
-rw-r--r-- | generator/generator_tool/generator_tool.cpp | 6 | ||||
-rw-r--r-- | generator/routing_index_generator.cpp | 10 | ||||
-rw-r--r-- | generator/routing_index_generator.hpp | 5 |
3 files changed, 15 insertions, 6 deletions
diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index 0cb1d27912..8b454e25cf 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -73,6 +73,9 @@ DEFINE_bool(make_routing, false, "Make routing info based on osrm file."); DEFINE_bool(make_cross_section, false, "Make cross section in routing file for cross mwm routing (for OSRM routing)."); DEFINE_bool(make_routing_index, false, "Make sections with the routing information."); DEFINE_bool(make_cross_mwm, false, "Make section for cross mwm routing (for dynamic indexed routing)."); +DEFINE_uint64( + cross_mwm_progress_peroid, 10, + "The smaller the period, the more often progress logs are printed. Set 0 to disable logs."); DEFINE_string(srtm_path, "", "Path to srtm directory. If set, generates a section with altitude information " "about roads."); @@ -265,7 +268,8 @@ int main(int argc, char ** argv) if (FLAGS_make_cross_mwm) { - if (!routing::BuildCrossMwmSection(path, datFile, country, osmToFeatureFilename)) + if (!routing::BuildCrossMwmSection(path, datFile, country, osmToFeatureFilename, + FLAGS_cross_mwm_progress_peroid)) LOG(LCRITICAL, ("Error generating cross mwm section.")); } diff --git a/generator/routing_index_generator.cpp b/generator/routing_index_generator.cpp index e4c17bee32..78a248f085 100644 --- a/generator/routing_index_generator.cpp +++ b/generator/routing_index_generator.cpp @@ -276,7 +276,7 @@ void CalcCrossMwmTransitions(string const & path, string const & mwmFile, string } void FillWeights(string const & path, string const & mwmFile, string const & country, - CrossMwmConnector & connector) + uint64_t crossMwmProgressPeroid, CrossMwmConnector & connector) { my::Timer timer; @@ -295,7 +295,7 @@ void FillWeights(string const & path, string const & mwmFile, string const & cou size_t notFoundCount = 0; for (size_t i = 0; i < numEnters; ++i) { - if ((i % 10 == 0) && (i != 0)) + if (crossMwmProgressPeroid != 0 && (i % crossMwmProgressPeroid == 0) && (i != 0)) LOG(LINFO, ("Building leaps:", i, "/", numEnters, "waves passed")); Segment const & enter = connector.GetEnter(i); @@ -377,7 +377,8 @@ bool BuildRoutingIndex(string const & filename, string const & country) } } -bool BuildCrossMwmSection(string const & path, string const & mwmFile, string const & country, string const & osmToFeatureFile) +bool BuildCrossMwmSection(string const & path, string const & mwmFile, string const & country, + string const & osmToFeatureFile, uint64_t crossMwmProgressPeroid) { LOG(LINFO, ("Building cross mwm section for", country)); @@ -398,7 +399,8 @@ bool BuildCrossMwmSection(string const & path, string const & mwmFile, string co connector.GetExits().size())); } - FillWeights(path, mwmFile, country, connectors[static_cast<size_t>(VehicleType::Car)]); + FillWeights(path, mwmFile, country, crossMwmProgressPeroid, + connectors[static_cast<size_t>(VehicleType::Car)]); serial::CodingParams const codingParams = LoadCodingParams(mwmFile); FilesContainerW cont(mwmFile, FileWriter::OP_WRITE_EXISTING); diff --git a/generator/routing_index_generator.hpp b/generator/routing_index_generator.hpp index 37f30c9f38..af7d8ab658 100644 --- a/generator/routing_index_generator.hpp +++ b/generator/routing_index_generator.hpp @@ -1,9 +1,12 @@ #pragma once +#include <cstdint> #include <string> namespace routing { bool BuildRoutingIndex(std::string const & filename, std::string const & country); -bool BuildCrossMwmSection(std::string const & path, std::string const & mwmFile, std::string const & country, std::string const & osmToFeatureFile); +bool BuildCrossMwmSection(std::string const & path, std::string const & mwmFile, + std::string const & country, std::string const & osmToFeatureFile, + uint64_t crossMwmProgressPeroid); } // namespace routing |