diff --git a/examples/cpp/random_tsp.cc b/examples/cpp/random_tsp.cc index 9dae715f68b..d76e907c6bf 100644 --- a/examples/cpp/random_tsp.cc +++ b/examples/cpp/random_tsp.cc @@ -53,7 +53,7 @@ ABSL_FLAG(std::string, routing_search_parameters, "Text proto RoutingSearchParameters (possibly partial) that will " "override the DefaultRoutingSearchParameters()"); -namespace operations_research { +namespace operations_research::routing { // Random seed generator. int32_t GetSeed() { @@ -179,10 +179,10 @@ void Tsp() { LOG(INFO) << "Specify an instance size greater than 0."; } } -} // namespace operations_research +} // namespace operations_research::routing int main(int argc, char** argv) { absl::ParseCommandLine(argc, argv); - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } diff --git a/ortools/routing/ils.cc b/ortools/routing/ils.cc index 1de349c77c0..f51a66655b3 100644 --- a/ortools/routing/ils.cc +++ b/ortools/routing/ils.cc @@ -103,7 +103,7 @@ std::unique_ptr MakeRuinProcedure( std::vector> MakeRuinProcedures( RoutingModel* model, std::mt19937* rnd, const google::protobuf::RepeatedPtrField< - ::operations_research::RuinStrategy>& ruin_strategies, + ::operations_research::routing::RuinStrategy>& ruin_strategies, int num_neighbors_for_route_selection) { std::vector> ruin_procedures; for (const RuinStrategy& ruin : ruin_strategies) { diff --git a/ortools/routing/routing.h b/ortools/routing/routing.h index 53b6735539f..e0587cc614c 100644 --- a/ortools/routing/routing.h +++ b/ortools/routing/routing.h @@ -1970,7 +1970,7 @@ class RoutingModel { int64_t GetNumberOfRejectsInFirstSolution( const RoutingSearchParameters& search_parameters) const; /// Returns the automatic first solution strategy selected. - operations_research::FirstSolutionStrategy::Value + operations_research::routing::FirstSolutionStrategy::Value GetAutomaticFirstSolutionStrategy() const { return automatic_first_solution_strategy_; } diff --git a/ortools/routing/samples/simple_routing_program.cc b/ortools/routing/samples/simple_routing_program.cc index 169a54e2869..ec25f8b5dae 100644 --- a/ortools/routing/samples/simple_routing_program.cc +++ b/ortools/routing/samples/simple_routing_program.cc @@ -18,6 +18,8 @@ #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -91,7 +93,7 @@ void SimpleRoutingProgram() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::SimpleRoutingProgram(); + operations_research::routing::SimpleRoutingProgram(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/tsp.cc b/ortools/routing/samples/tsp.cc index cd0b6213ee6..6b1756cf96d 100644 --- a/ortools/routing/samples/tsp.cc +++ b/ortools/routing/samples/tsp.cc @@ -155,7 +155,7 @@ void Tsp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/tsp_circuit_board.cc b/ortools/routing/samples/tsp_circuit_board.cc index 638e8253fc8..67ce62d038c 100644 --- a/ortools/routing/samples/tsp_circuit_board.cc +++ b/ortools/routing/samples/tsp_circuit_board.cc @@ -15,9 +15,12 @@ // [START import] #include #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -181,7 +184,7 @@ void Tsp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/tsp_cities.cc b/ortools/routing/samples/tsp_cities.cc index 90f1a1ddce8..ee1d9425d1c 100644 --- a/ortools/routing/samples/tsp_cities.cc +++ b/ortools/routing/samples/tsp_cities.cc @@ -13,11 +13,13 @@ // [START program] // [START import] -#include #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -128,7 +130,7 @@ void Tsp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/tsp_cities_routes.cc b/ortools/routing/samples/tsp_cities_routes.cc index 005e2281de9..034a170a963 100644 --- a/ortools/routing/samples/tsp_cities_routes.cc +++ b/ortools/routing/samples/tsp_cities_routes.cc @@ -13,11 +13,13 @@ // [START program] // [START import] -#include #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -131,7 +133,7 @@ void Tsp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/tsp_distance_matrix.cc b/ortools/routing/samples/tsp_distance_matrix.cc index ecea62c640c..c432adc6958 100644 --- a/ortools/routing/samples/tsp_distance_matrix.cc +++ b/ortools/routing/samples/tsp_distance_matrix.cc @@ -14,9 +14,12 @@ // [START program] // [START import] #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -149,7 +152,7 @@ void Tsp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Tsp(); + operations_research::routing::Tsp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp.cc b/ortools/routing/samples/vrp.cc index a762ac07f65..7a44a94d83e 100644 --- a/ortools/routing/samples/vrp.cc +++ b/ortools/routing/samples/vrp.cc @@ -164,7 +164,7 @@ void Vrp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Vrp(); + operations_research::routing::Vrp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_breaks.cc b/ortools/routing/samples/vrp_breaks.cc index a5eabe80f6b..43df5a55c18 100644 --- a/ortools/routing/samples/vrp_breaks.cc +++ b/ortools/routing/samples/vrp_breaks.cc @@ -21,9 +21,12 @@ // [START program] // [START import] #include +#include #include #include +#include "absl/strings/str_cat.h" +#include "ortools/base/logging.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" @@ -200,7 +203,7 @@ void VrpBreaks() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpBreaks(); + operations_research::routing::VrpBreaks(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_capacity.cc b/ortools/routing/samples/vrp_capacity.cc index 86e512dc623..d903b7644bf 100644 --- a/ortools/routing/samples/vrp_capacity.cc +++ b/ortools/routing/samples/vrp_capacity.cc @@ -14,10 +14,13 @@ // [START program] // [START import] #include +#include #include #include #include "google/protobuf/duration.pb.h" +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -186,7 +189,7 @@ void VrpCapacity() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpCapacity(); + operations_research::routing::VrpCapacity(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_drop_nodes.cc b/ortools/routing/samples/vrp_drop_nodes.cc index 9d91aea6ce1..9ff16a6bba4 100644 --- a/ortools/routing/samples/vrp_drop_nodes.cc +++ b/ortools/routing/samples/vrp_drop_nodes.cc @@ -14,10 +14,13 @@ // [START program] // [START import] #include +#include #include #include #include "google/protobuf/duration.pb.h" +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -202,7 +205,7 @@ void VrpDropNodes() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpDropNodes(); + operations_research::routing::VrpDropNodes(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_global_span.cc b/ortools/routing/samples/vrp_global_span.cc index 502ef1ba6d5..cf4fa4e27a0 100644 --- a/ortools/routing/samples/vrp_global_span.cc +++ b/ortools/routing/samples/vrp_global_span.cc @@ -15,9 +15,12 @@ // [START import] #include #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -165,7 +168,7 @@ void VrpGlobalSpan() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpGlobalSpan(); + operations_research::routing::VrpGlobalSpan(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_initial_routes.cc b/ortools/routing/samples/vrp_initial_routes.cc index c15583b7cba..e6d2fb159c2 100644 --- a/ortools/routing/samples/vrp_initial_routes.cc +++ b/ortools/routing/samples/vrp_initial_routes.cc @@ -193,6 +193,6 @@ void VrpInitialRoutes() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpInitialRoutes(); + operations_research::routing::VrpInitialRoutes(); return EXIT_SUCCESS; } diff --git a/ortools/routing/samples/vrp_pickup_delivery.cc b/ortools/routing/samples/vrp_pickup_delivery.cc index 403bb43aeac..4fbb8d0fe5b 100644 --- a/ortools/routing/samples/vrp_pickup_delivery.cc +++ b/ortools/routing/samples/vrp_pickup_delivery.cc @@ -14,9 +14,12 @@ // [START program] // [START import] #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -197,7 +200,7 @@ void VrpGlobalSpan() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpGlobalSpan(); + operations_research::routing::VrpGlobalSpan(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_pickup_delivery_fifo.cc b/ortools/routing/samples/vrp_pickup_delivery_fifo.cc index 22c7a509bf4..c94fc6dc448 100644 --- a/ortools/routing/samples/vrp_pickup_delivery_fifo.cc +++ b/ortools/routing/samples/vrp_pickup_delivery_fifo.cc @@ -14,9 +14,12 @@ // [START program] // [START import] #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -199,7 +202,7 @@ void VrpGlobalSpan() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpGlobalSpan(); + operations_research::routing::VrpGlobalSpan(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_pickup_delivery_lifo.cc b/ortools/routing/samples/vrp_pickup_delivery_lifo.cc index a97c50a6249..791b934bccc 100644 --- a/ortools/routing/samples/vrp_pickup_delivery_lifo.cc +++ b/ortools/routing/samples/vrp_pickup_delivery_lifo.cc @@ -14,9 +14,12 @@ // [START program] // [START import] #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -199,7 +202,7 @@ void VrpGlobalSpan() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpGlobalSpan(); + operations_research::routing::VrpGlobalSpan(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_resources.cc b/ortools/routing/samples/vrp_resources.cc index 718adf7ad09..437107a5d51 100644 --- a/ortools/routing/samples/vrp_resources.cc +++ b/ortools/routing/samples/vrp_resources.cc @@ -14,11 +14,14 @@ // [START program] // [START import] #include +#include #include #include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -221,7 +224,7 @@ void VrpTimeWindows() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpTimeWindows(); + operations_research::routing::VrpTimeWindows(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_routes.cc b/ortools/routing/samples/vrp_routes.cc index a96726511a2..2e7d90f302a 100644 --- a/ortools/routing/samples/vrp_routes.cc +++ b/ortools/routing/samples/vrp_routes.cc @@ -14,9 +14,12 @@ // [START program] // [START import] #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -74,7 +77,7 @@ void PrintSolution( DataModel data; int64_t total_distance = 0; for (int i = 0; i < routes.size(); ++i) { - std::vector route = routes[i]; + const std::vector& route = routes[i]; int64_t route_distance{0}; std::stringstream route_text; LOG(INFO) << "Route for Vehicle " << i << ":"; @@ -154,7 +157,7 @@ void Vrp() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::Vrp(); + operations_research::routing::Vrp(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_solution_callback.cc b/ortools/routing/samples/vrp_solution_callback.cc index 2b5b949e0e8..37310b9b0eb 100644 --- a/ortools/routing/samples/vrp_solution_callback.cc +++ b/ortools/routing/samples/vrp_solution_callback.cc @@ -14,12 +14,15 @@ // [START program] // [START import] #include +#include #include #include #include #include #include "google/protobuf/duration.pb.h" +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -216,7 +219,7 @@ void VrpSolutionCallback() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpSolutionCallback(); + operations_research::routing::VrpSolutionCallback(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_starts_ends.cc b/ortools/routing/samples/vrp_starts_ends.cc index d0e4b441774..d533930c733 100644 --- a/ortools/routing/samples/vrp_starts_ends.cc +++ b/ortools/routing/samples/vrp_starts_ends.cc @@ -15,9 +15,12 @@ // [START import] #include #include +#include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -173,7 +176,7 @@ void VrpStartsEnds() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpStartsEnds(); + operations_research::routing::VrpStartsEnds(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrp_time_windows.cc b/ortools/routing/samples/vrp_time_windows.cc index ea4cb53554b..6501a2680de 100644 --- a/ortools/routing/samples/vrp_time_windows.cc +++ b/ortools/routing/samples/vrp_time_windows.cc @@ -14,11 +14,14 @@ // [START program] // [START import] #include +#include #include #include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -195,7 +198,7 @@ void VrpTimeWindows() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpTimeWindows(); + operations_research::routing::VrpTimeWindows(); return EXIT_SUCCESS; } // [END program_part1] diff --git a/ortools/routing/samples/vrp_with_time_limit.cc b/ortools/routing/samples/vrp_with_time_limit.cc index 6f73174c5ad..e067f54d1a1 100644 --- a/ortools/routing/samples/vrp_with_time_limit.cc +++ b/ortools/routing/samples/vrp_with_time_limit.cc @@ -15,10 +15,12 @@ // [START import] #include #include +#include #include -#include #include "google/protobuf/duration.pb.h" +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -125,7 +127,7 @@ void VrpGlobalSpan() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpGlobalSpan(); + operations_research::routing::VrpGlobalSpan(); return EXIT_SUCCESS; } // [END program] diff --git a/ortools/routing/samples/vrptw_store_solution_data.cc b/ortools/routing/samples/vrptw_store_solution_data.cc index de1b311cead..347ce732cd9 100644 --- a/ortools/routing/samples/vrptw_store_solution_data.cc +++ b/ortools/routing/samples/vrptw_store_solution_data.cc @@ -14,11 +14,14 @@ // [START program] // [START import] #include +#include #include #include #include #include +#include "ortools/base/logging.h" +#include "ortools/constraint_solver/constraint_solver.h" #include "ortools/routing/enums.pb.h" #include "ortools/routing/index_manager.h" #include "ortools/routing/parameters.h" @@ -235,7 +238,7 @@ void VrpTimeWindows() { } // namespace operations_research::routing int main(int /*argc*/, char* /*argv*/[]) { - operations_research::VrpTimeWindows(); + operations_research::routing::VrpTimeWindows(); return EXIT_SUCCESS; } // [END program_part1] diff --git a/ortools/routing/sat.cc b/ortools/routing/sat.cc index 50de8df0e43..f5d5ceb85bb 100644 --- a/ortools/routing/sat.cc +++ b/ortools/routing/sat.cc @@ -54,7 +54,7 @@ using operations_research::sat::CpSolverResponse; using operations_research::sat::CpSolverStatus; using operations_research::sat::IntegerVariableProto; using operations_research::sat::kMaxIntegerValue; -using operations_research::sat::kMinxIntegerValue; +using operations_research::sat::kMinIntegerValue; using operations_research::sat::LinearConstraintProto; using operations_research::sat::Model; using operations_research::sat::NewSatParameters; diff --git a/ortools/routing/search.h b/ortools/routing/search.h index 957285d44d6..a38dfb5539b 100644 --- a/ortools/routing/search.h +++ b/ortools/routing/search.h @@ -125,7 +125,7 @@ class VehicleTypeCurator { /// Returns the best value for the automatic first solution strategy, based on /// the given model parameters. -operations_research::FirstSolutionStrategy::Value +operations_research::routing::FirstSolutionStrategy::Value AutomaticFirstSolutionStrategy(bool has_pickup_deliveries, bool has_node_precedences, bool has_single_vehicle_node);