diff --git a/cmake/cpp.cmake b/cmake/cpp.cmake index 1280d28978..2f7d51aaab 100644 --- a/cmake/cpp.cmake +++ b/cmake/cpp.cmake @@ -219,6 +219,7 @@ file(GLOB_RECURSE OR_TOOLS_PROTO_FILES RELATIVE ${PROJECT_SOURCE_DIR} "ortools/linear_solver/*.proto" "ortools/linear_solver/*.proto" "ortools/packing/*.proto" + "ortools/routing/*.proto" "ortools/sat/*.proto" "ortools/scheduling/*.proto" "ortools/util/*.proto" diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake index 3b967abc1f..d24596ee5a 100644 --- a/cmake/dotnet.cmake +++ b/cmake/dotnet.cmake @@ -129,6 +129,7 @@ file(GLOB_RECURSE proto_dotnet_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/glop/*.proto" "ortools/graph/*.proto" "ortools/linear_solver/*.proto" + "ortools/routing/*.proto" "ortools/sat/*.proto" "ortools/util/*.proto" ) diff --git a/cmake/java.cmake b/cmake/java.cmake index dafc950ef4..bbc7ffc83b 100644 --- a/cmake/java.cmake +++ b/cmake/java.cmake @@ -96,6 +96,7 @@ file(GLOB_RECURSE proto_java_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/glop/*.proto" "ortools/graph/*.proto" "ortools/linear_solver/*.proto" + "ortools/routing/*.proto" "ortools/sat/*.proto" "ortools/util/*.proto" ) diff --git a/cmake/python.cmake b/cmake/python.cmake index 8f4820ca9b..858d3d1560 100644 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -147,6 +147,7 @@ file(GLOB_RECURSE OR_TOOLS_PROTO_PY_FILES RELATIVE ${PROJECT_SOURCE_DIR} "ortools/graph/*.proto" "ortools/linear_solver/*.proto" "ortools/packing/*.proto" + "ortools/routing/*.proto" "ortools/sat/*.proto" "ortools/scheduling/*.proto" "ortools/util/*.proto" @@ -340,6 +341,8 @@ if(USE_PDLP OR BUILD_MATH_OPT) file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/pdlp/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/pdlp/python/__init__.py CONTENT "") endif() +file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/routing/__init__.py CONTENT "") + file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/sat/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/sat/python/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/sat/colab/__init__.py CONTENT "") diff --git a/examples/cpp/random_tsp.cc b/examples/cpp/random_tsp.cc index 5269804944..5412243325 100644 --- a/examples/cpp/random_tsp.cc +++ b/examples/cpp/random_tsp.cc @@ -36,7 +36,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools//routing/parameters.pb.h" #include "ortools/util/random_engine.h" ABSL_FLAG(int, tsp_size, 10, "Size of Traveling Salesman Problem instance."); diff --git a/ortools/constraint_solver/BUILD.bazel b/ortools/constraint_solver/BUILD.bazel index 3c38343a86..f9852061d8 100644 --- a/ortools/constraint_solver/BUILD.bazel +++ b/ortools/constraint_solver/BUILD.bazel @@ -68,17 +68,6 @@ cc_proto_library( deps = [":demon_profiler_proto"], ) -proto_library( - name = "routing_ils_proto", - srcs = ["routing_ils.proto"], - deps = [":routing_enums_proto"], -) - -cc_proto_library( - name = "routing_ils_cc_proto", - deps = ["routing_ils_proto"], -) - proto_library( name = "search_stats_proto", srcs = ["search_stats.proto"], @@ -175,7 +164,6 @@ cc_library( ":search_limit_cc_proto", ":search_stats_cc_proto", ":solver_parameters_cc_proto", - ":routing_parameters_cc_proto", "//ortools/base", "//ortools/base:file", "//ortools/base:recordio", @@ -220,61 +208,18 @@ cc_library( # ----- Routing and ArcRouting ----- -proto_library( - name = "routing_enums_proto", - srcs = ["routing_enums.proto"], -) - -cc_proto_library( - name = "routing_enums_cc_proto", - deps = [":routing_enums_proto"], -) - -# java_proto_library( -# name = "routing_enums_java_proto", -# deps = [":routing_enums_proto"], -# ) - -proto_library( - name = "routing_parameters_proto", - srcs = ["routing_parameters.proto"], - deps = [ - ":routing_enums_proto", - ":routing_ils_proto", - ":solver_parameters_proto", - "//ortools/sat:sat_parameters_proto", - "//ortools/util:optional_boolean_proto", - "@com_google_protobuf//:duration_proto", - ], -) - -cc_proto_library( - name = "routing_parameters_cc_proto", - deps = [":routing_parameters_proto"], -) - -# java_proto_library( -# name = "routing_parameters_java_proto", -# deps = [":routing_parameters_proto"], -# ) - -#py_proto_library( -# name = "routing_parameters_py_pb2", -# deps = [":routing_parameters_proto"], -#) - cc_library( name = "routing_parameters", srcs = ["routing_parameters.cc"], hdrs = ["routing_parameters.h"], deps = [ ":cp", - ":routing_enums_cc_proto", - ":routing_parameters_cc_proto", ":solver_parameters_cc_proto", "//ortools/base", "//ortools/base:protoutil", "//ortools/port:proto_utils", + "//ortools/routing:enums_cc_proto", + "//ortools/routing:parameters_cc_proto", "//ortools/util:optional_boolean_cc_proto", "//ortools/util:testing_utils", "@com_google_absl//absl/status:statusor", @@ -363,11 +308,9 @@ cc_library( }), deps = [ ":cp", - ":routing_enums_cc_proto", ":routing_index_manager", ":routing_neighborhoods", ":routing_parameters", - ":routing_parameters_cc_proto", ":routing_types", ":routing_utils", "//ortools/base", @@ -389,6 +332,8 @@ cc_library( "//ortools/graph:topologicalsorter", "//ortools/lp_data", "//ortools/lp_data:base", + "//ortools/routing:enums_cc_proto", + "//ortools/routing:parameters_cc_proto", "//ortools/sat:boolean_problem", "//ortools/sat:cp_constraints", "//ortools/sat:cp_model", diff --git a/ortools/constraint_solver/csharp/RoutingSolverTests.cs b/ortools/constraint_solver/csharp/RoutingSolverTests.cs index fc4e34602a..1d34101fab 100644 --- a/ortools/constraint_solver/csharp/RoutingSolverTests.cs +++ b/ortools/constraint_solver/csharp/RoutingSolverTests.cs @@ -15,6 +15,7 @@ using System; using System.Linq; using Xunit; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; namespace Google.OrTools.Tests { diff --git a/ortools/constraint_solver/csharp/routing.i b/ortools/constraint_solver/csharp/routing.i index 0b94a53b12..02b7063e5a 100644 --- a/ortools/constraint_solver/csharp/routing.i +++ b/ortools/constraint_solver/csharp/routing.i @@ -39,12 +39,12 @@ class RoutingSearchStatus; // Include the file we want to wrap a first time. %{ -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_types.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" %} %module(directors="1") operations_research; @@ -186,17 +186,17 @@ using System.Collections.Generic; // Protobuf support PROTO_INPUT(operations_research::RoutingSearchParameters, - Google.OrTools.ConstraintSolver.RoutingSearchParameters, + Google.OrTools.Routing.RoutingSearchParameters, search_parameters) PROTO_INPUT(operations_research::RoutingModelParameters, - Google.OrTools.ConstraintSolver.RoutingModelParameters, + Google.OrTools.Routing.RoutingModelParameters, parameters) PROTO2_RETURN(operations_research::RoutingSearchParameters, - Google.OrTools.ConstraintSolver.RoutingSearchParameters) + Google.OrTools.Routing.RoutingSearchParameters) PROTO2_RETURN(operations_research::RoutingModelParameters, - Google.OrTools.ConstraintSolver.RoutingModelParameters) + Google.OrTools.Routing.RoutingModelParameters) PROTO_ENUM_RETURN(operations_research::RoutingSearchStatus::Value, - Google.OrTools.ConstraintSolver.RoutingSearchStatus.Types.Value) + Google.OrTools.Routing.RoutingSearchStatus.Types.Value) // TODO(user): Replace with %ignoreall/%unignoreall //swiglint: disable include-h-allglobals diff --git a/ortools/constraint_solver/docs/ROUTING.md b/ortools/constraint_solver/docs/ROUTING.md index 3517b169f1..770b5425a4 100644 --- a/ortools/constraint_solver/docs/ROUTING.md +++ b/ortools/constraint_solver/docs/ROUTING.md @@ -25,9 +25,9 @@ and .Net. Each language have different requirements for the code samples. #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" namespace operations_research { @@ -93,8 +93,8 @@ int main(int /*argc*/, char* /*argv*/[]) { #!/usr/bin/env python3 """Vehicle Routing example.""" -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 def main(): @@ -126,7 +126,7 @@ def main(): # Setting first solution heuristic. search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # pylint: disable=no-member # Solve the problem. @@ -154,16 +154,16 @@ if __name__ == "__main__": ### Java code samples ```java -package com.google.ortools.constraintsolver.samples; +package com.google.ortools.routing.samples; import static java.lang.Math.abs; import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.RoutingIndexManager; -import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; -import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.Globals; +import com.google.ortools.routing.RoutingIndexManager; +import com.google.ortools.routing.RoutingModel; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; /** Minimal Routing example to showcase calling the solver.*/ @@ -197,7 +197,7 @@ public class SimpleRoutingProgram { // Setting first solution heuristic. RoutingSearchParameters searchParameters = - main.defaultRoutingSearchParameters() + Globals.defaultRoutingSearchParameters() .toBuilder() .setFirstSolutionStrategy(FirstSolutionStrategy.Value.PATH_CHEAPEST_ARC) .build(); diff --git a/ortools/constraint_solver/docs/TSP.md b/ortools/constraint_solver/docs/TSP.md index 81314c8621..98bbbea6aa 100644 --- a/ortools/constraint_solver/docs/TSP.md +++ b/ortools/constraint_solver/docs/TSP.md @@ -32,4 +32,3 @@ Samples: * [tsp_distance_matrix.py](../samples/tsp_distance_matrix.py) * [TspDistanceMatrix.java](../samples/TspDistanceMatrix.java) * [TspDistanceMatrix.cs](../samples/TspDistanceMatrix.cs) - diff --git a/ortools/constraint_solver/docs/VRP.md b/ortools/constraint_solver/docs/VRP.md index a5151cf7c2..40835f22e0 100644 --- a/ortools/constraint_solver/docs/VRP.md +++ b/ortools/constraint_solver/docs/VRP.md @@ -101,4 +101,3 @@ Samples: * [vrp_resources.py](../samples/vrp_resources.py) * [VrpResources.java](../samples/VrpResources.java) * [VrpResources.cs](../samples/VrpResources.cs) - diff --git a/ortools/constraint_solver/docs/routing_svg.py b/ortools/constraint_solver/docs/routing_svg.py index 20f56141ee..f4ef5cb6d1 100755 --- a/ortools/constraint_solver/docs/routing_svg.py +++ b/ortools/constraint_solver/docs/routing_svg.py @@ -16,7 +16,7 @@ # [START import] import argparse from ortools.constraint_solver import pywrapcp -from ortools.constraint_solver import routing_enums_pb2 +from ortools.routing import enums_pb2 # [END import] @@ -1195,15 +1195,15 @@ def main(): # pylint: disable=too-many-locals,too-many-branches # pylint: disable=no-member if not args["pickup_delivery"]: search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) else: search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION + enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(2) diff --git a/ortools/constraint_solver/java/RoutingSolverTest.java b/ortools/constraint_solver/java/RoutingSolverTest.java index 717c49e8f4..467ee2a8cd 100644 --- a/ortools/constraint_solver/java/RoutingSolverTest.java +++ b/ortools/constraint_solver/java/RoutingSolverTest.java @@ -21,9 +21,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.auto.value.AutoValue; import com.google.ortools.Loader; -import com.google.ortools.constraintsolver.RoutingModelParameters; -import com.google.ortools.constraintsolver.RoutingSearchParameters; -import com.google.ortools.constraintsolver.RoutingSearchStatus; +import com.google.ortools.routing.Enums.RoutingSearchStatus; +import com.google.ortools.routing.Parameters.RoutingModelParameters; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import com.google.protobuf.Duration; import java.util.ArrayList; import java.util.function.LongBinaryOperator; diff --git a/ortools/constraint_solver/java/routing.i b/ortools/constraint_solver/java/routing.i index ac5ad6dc5c..7315e11581 100644 --- a/ortools/constraint_solver/java/routing.i +++ b/ortools/constraint_solver/java/routing.i @@ -29,16 +29,19 @@ namespace operations_research { class RoutingModelParameters; class RoutingSearchParameters; -class RoutingSearchStatus; +struct RoutingSearchStatus { + enum Value {}; +}; + } // namespace operations_research // Include the files we want to wrap a first time. %{ -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_types.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_parameters.h" #include "ortools/constraint_solver/routing.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" #include %} @@ -365,17 +368,17 @@ import java.lang.Runnable; // Protobuf support PROTO_INPUT(operations_research::RoutingSearchParameters, - com.google.ortools.constraintsolver.RoutingSearchParameters, + com.google.ortools.routing.Parameters.RoutingSearchParameters, search_parameters) PROTO_INPUT(operations_research::RoutingModelParameters, - com.google.ortools.constraintsolver.RoutingModelParameters, + com.google.ortools.routing.Parameters.RoutingModelParameters, parameters) PROTO2_RETURN(operations_research::RoutingSearchParameters, - com.google.ortools.constraintsolver.RoutingSearchParameters) + com.google.ortools.routing.Parameters.RoutingSearchParameters) PROTO2_RETURN(operations_research::RoutingModelParameters, - com.google.ortools.constraintsolver.RoutingModelParameters) + com.google.ortools.routing.Parameters.RoutingModelParameters) PROTO_ENUM_RETURN(operations_research::RoutingSearchStatus::Value, - com.google.ortools.constraintsolver.RoutingSearchStatus.Value) + com.google.ortools.routing.Enums.RoutingSearchStatus.Value) // Wrap routing_types.h, routing_parameters.h according to the SWIG styleguide. %ignoreall diff --git a/ortools/constraint_solver/java/routing_index_manager.i b/ortools/constraint_solver/java/routing_index_manager.i index 7a9ca61ae8..b15b9ad9da 100644 --- a/ortools/constraint_solver/java/routing_index_manager.i +++ b/ortools/constraint_solver/java/routing_index_manager.i @@ -14,7 +14,7 @@ // Wrapper for RoutingIndexManager. %include "ortools/base/base.i" -%include "ortools/util/java/vector.i" +%import "ortools/util/java/vector.i" %{ #include "ortools/constraint_solver/routing_index_manager.h" diff --git a/ortools/constraint_solver/python/constraint_solver.cc b/ortools/constraint_solver/python/constraint_solver.cc new file mode 100644 index 0000000000..467d3bc649 --- /dev/null +++ b/ortools/constraint_solver/python/constraint_solver.cc @@ -0,0 +1,295 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "ortools/constraint_solver/constraint_solver.h" + +#include // For FailureProtect. See below. + +#include +#include +#include +#include + +#include "absl/strings/string_view.h" +#include "ortools/constraint_solver/assignment.pb.h" +#include "ortools/constraint_solver/python/constraint_solver_doc.h" +#include "pybind11/cast.h" +#include "pybind11/functional.h" +#include "pybind11/gil.h" +#include "pybind11/pybind11.h" +#include "pybind11/stl.h" +#include "pybind11_protobuf/native_proto_caster.h" + +using ::operations_research::Assignment; +using ::operations_research::AssignmentProto; +using ::operations_research::BaseObject; +using ::operations_research::Constraint; +using ::operations_research::ConstraintSolverParameters; +using ::operations_research::IntervalVar; +using ::operations_research::IntExpr; +using ::operations_research::IntVar; +using ::operations_research::PropagationBaseObject; +using ::operations_research::Solver; +using ::pybind11::arg; + +// Used in the PROTECT_FROM_FAILURE macro. See below. +namespace { + +struct FailureProtect { + jmp_buf exception_buffer; + void JumpBack() { longjmp(exception_buffer, 1); } +}; + +} // namespace + +#define PROTECT_FROM_FAILURE(this_, action) \ + Solver* solver = this_->solver(); \ + FailureProtect protect; \ + solver->set_fail_intercept([&protect]() { protect.JumpBack(); }); \ + if (setjmp(protect.exception_buffer) == 0) { \ + this_->action; \ + solver->clear_fail_intercept(); \ + } else { \ + solver->clear_fail_intercept(); \ + throw pybind11::value_error("Solver fails outside of solve()"); \ + } + +class BaseObjectPythonHelper { + public: + static std::string DebugString(BaseObject* this_) { + return this_->DebugString(); + } +}; + +class PropagationBaseObjectPythonHelper : BaseObjectPythonHelper { + public: + static std::string DebugString(PropagationBaseObject* this_) { + return this_->DebugString(); + } + static Solver* solver(PropagationBaseObject* this_) { + return this_->solver(); + } + + static std::string name(PropagationBaseObject* this_) { + return this_->name(); + } + + static void SetName(PropagationBaseObject* this_, absl::string_view name) { + this_->set_name(name); + } +}; + +class IntExprPythonHelper : PropagationBaseObjectPythonHelper { + public: + static int64_t Min(IntExpr* this_) { return this_->Min(); } + static int64_t Max(IntExpr* this_) { return this_->Max(); } + static void SetMin(IntExpr* this_, int64_t m) { + PROTECT_FROM_FAILURE(this_, SetMin(m)); + } + static void SetMax(IntExpr* this_, int64_t m) { + PROTECT_FROM_FAILURE(this_, SetMax(m)); + } + static void SetRange(IntExpr* this_, int64_t mi, int64_t ma) { + PROTECT_FROM_FAILURE(this_, SetRange(mi, ma)); + } + static void SetValue(IntExpr* this_, int64_t v) { + PROTECT_FROM_FAILURE(this_, SetValue(v)); + } + static bool Bound(IntExpr* this_) { return this_->Bound(); } +}; + +class IntVarPythonHelper : IntExprPythonHelper { + public: + static std::string name(IntVar* this_) { return this_->name(); } + static int64_t Value(IntVar* this_) { return this_->Value(); } + static void RemoveValue(IntVar* this_, int64_t v) { + PROTECT_FROM_FAILURE(this_, RemoveValue(v)); + } + static int64_t Size(IntVar* this_) { return this_->Size(); } +}; + +PYBIND11_MODULE(constraint_solver, m) { + pybind11_protobuf::ImportNativeProtoCasters(); + + pybind11::class_(m, "Solver", DOC(operations_research, Solver)) + .def(pybind11::init()) + .def(pybind11::init()) + .def("__str__", &Solver::DebugString) + .def("new_int_var", + pybind11::overload_cast( + &Solver::MakeIntVar), + DOC(operations_research, Solver, MakeIntVar), + pybind11::return_value_policy::reference_internal) + .def("new_int_var", + pybind11::overload_cast(&Solver::MakeIntVar), + DOC(operations_research, Solver, MakeIntVar), + pybind11::return_value_policy::reference_internal) + .def("new_int_var", + pybind11::overload_cast&, + const std::string&>(&Solver::MakeIntVar), + DOC(operations_research, Solver, MakeIntVar_2), + pybind11::return_value_policy::reference_internal) + .def("new_int_var", + pybind11::overload_cast&>( + &Solver::MakeIntVar), + DOC(operations_research, Solver, MakeIntVar_2), + pybind11::return_value_policy::reference_internal); + + pybind11::class_(m, "BaseObject", + DOC(operations_research, BaseObject)) + .def("__str__", &BaseObjectPythonHelper::DebugString); + + pybind11::class_( + m, "PropagationBaseObject", + DOC(operations_research, PropagationBaseObject)) + .def_property("name", &PropagationBaseObjectPythonHelper::name, + &PropagationBaseObjectPythonHelper::SetName); + + // Note: no ctor. + pybind11::class_( + m, "IntExpr", DOC(operations_research, IntExpr)) + .def_property_readonly("min", &IntExprPythonHelper::Min, + DOC(operations_research, IntExpr, Min)) + .def_property_readonly("max", &IntExprPythonHelper::Max, + DOC(operations_research, IntExpr, Max)) + .def("set_min", &IntExprPythonHelper::SetMin, + DOC(operations_research, IntExpr, SetMin), arg("m")) + .def("set_max", &IntExprPythonHelper::SetMax, + DOC(operations_research, IntExpr, SetMax), arg("m")) + .def("set_range", &IntExprPythonHelper::SetRange, + DOC(operations_research, IntExpr, SetRange), arg("mi"), arg("ma")) + .def("set_value", &IntExprPythonHelper::SetValue, + DOC(operations_research, IntExpr, SetValue), arg("v")) + .def("bound", &IntExprPythonHelper::Bound, + DOC(operations_research, IntExpr, Bound)) + .def( + "__add__", + [](IntExpr* e, int64_t arg) { return e->solver()->MakeSum(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__add__", + [](IntExpr* e, IntExpr* arg) { return e->solver()->MakeSum(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__radd__", + [](IntExpr* e, int64_t arg) { return e->solver()->MakeSum(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__radd__", + [](IntExpr* e, IntExpr* arg) { return e->solver()->MakeSum(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__mul__", + [](IntExpr* e, int64_t arg) { return e->solver()->MakeProd(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__mul__", + [](IntExpr* e, IntExpr* arg) { + return e->solver()->MakeProd(e, arg); + }, + pybind11::return_value_policy::reference_internal) + .def( + "__rmul__", + [](IntExpr* e, int64_t arg) { return e->solver()->MakeProd(e, arg); }, + pybind11::return_value_policy::reference_internal) + .def( + "__rmul__", + [](IntExpr* e, IntExpr* arg) { + return e->solver()->MakeProd(e, arg); + }, + pybind11::return_value_policy::reference_internal); + + // Note: no ctor. + pybind11::class_(m, "IntVar", + DOC(operations_research, IntVar)) + .def("value", &IntVarPythonHelper::Value, + DOC(operations_research, IntVar, Value)) + .def("remove_value", &IntVarPythonHelper::RemoveValue, + DOC(operations_research, IntVar, RemoveValue), arg("v")) + .def("size", &IntVarPythonHelper::Size, + DOC(operations_research, IntVar, Size)); + + pybind11::class_( + m, "Assignment", DOC(operations_research, Assignment)) + .def(pybind11::init()) + .def("clear", &Assignment::Clear) + .def("empty", &Assignment::Empty) + .def("size", &Assignment::Size) + .def("num_int_vars", &Assignment::NumIntVars) + .def("num_interval_vars", &Assignment::NumIntervalVars) + .def("num_sequence_vars", &Assignment::NumSequenceVars) + .def("store", &Assignment::Store) + .def("restore", &Assignment::Restore) + .def("load", + pybind11::overload_cast(&Assignment::Load), + arg("filename")) + .def("load", + pybind11::overload_cast(&Assignment::Load), + arg("assignment_proto")) + .def("add_objective", &Assignment::AddObjective, arg("v")) + .def("add_objectives", &Assignment::AddObjectives, arg("vars")) + .def("clear_objective", &Assignment::ClearObjective) + .def("num_objectives", &Assignment::NumObjectives) + .def("objective", &Assignment::Objective) + .def("objective_from_index", &Assignment::ObjectiveFromIndex, + arg("index")) + .def("has_objective", &Assignment::HasObjective) + .def("has_objective_from_index", &Assignment::HasObjectiveFromIndex, + arg("index")) + .def("objective_min", &Assignment::ObjectiveMin) + .def("objective_max", &Assignment::ObjectiveMax) + .def("objective_value", &Assignment::ObjectiveValue) + .def("objective_bound", &Assignment::ObjectiveBound) + .def("set_objective_min", &Assignment::SetObjectiveMin, arg("m")) + .def("set_objective_max", &Assignment::SetObjectiveMax, arg("m")) + .def("set_objective_value", &Assignment::SetObjectiveValue, arg("value")) + .def("set_objective_range", &Assignment::SetObjectiveRange, arg("l"), + arg("u")) + .def("objective_min_from_index", &Assignment::ObjectiveMinFromIndex, + arg("index")) + .def("objective_max_from_index", &Assignment::ObjectiveMaxFromIndex, + arg("index")) + .def("objective_value_from_index", &Assignment::ObjectiveValueFromIndex, + arg("index")) + .def("objective_bound_from_index", &Assignment::ObjectiveBoundFromIndex, + arg("index")) + .def("set_objective_min_from_index", + &Assignment::SetObjectiveMinFromIndex, arg("index"), arg("m")) + .def("set_objective_max_from_index", + &Assignment::SetObjectiveMaxFromIndex, arg("index"), arg("m")) + .def("set_objective_range_from_index", + &Assignment::SetObjectiveRangeFromIndex, arg("index"), arg("l"), + arg("u")) + .def("add", pybind11::overload_cast(&Assignment::Add), + arg("var")) + .def("add", + pybind11::overload_cast&>( + &Assignment::Add), + arg("var")) + .def("min", &Assignment::Min, arg("var")) + .def("max", &Assignment::Max, arg("var")) + .def("value", &Assignment::Value, arg("var")) + .def("bound", &Assignment::Bound, arg("var")) + .def("set_min", &Assignment::SetMin, arg("var"), arg("m")) + .def("set_max", &Assignment::SetMax, arg("var"), arg("m")) + .def("set_range", &Assignment::SetRange, arg("var"), arg("l"), arg("u")) + .def("set_value", &Assignment::SetValue, arg("var"), arg("value")) + .def("add", pybind11::overload_cast(&Assignment::Add), + arg("var")) + .def("add", + pybind11::overload_cast&>( + &Assignment::Add), + arg("var")); + // missing IntervalVar, SequenceVar, active/deactivate, contains, copy +} diff --git a/ortools/constraint_solver/python/constraint_solver_doc.h b/ortools/constraint_solver/python/constraint_solver_doc.h new file mode 100644 index 0000000000..a4dd6eab19 --- /dev/null +++ b/ortools/constraint_solver/python/constraint_solver_doc.h @@ -0,0 +1,6158 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + This file contains docstrings for use in the Python bindings. + Do not edit! They were automatically extracted by pybind11_mkdoc. + */ + +#define __EXPAND(x) x +#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT +#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) +#define __CAT1(a, b) a##b +#define __CAT2(a, b) __CAT1(a, b) +#define __DOC1(n1) __doc_##n1 +#define __DOC2(n1, n2) __doc_##n1##_##n2 +#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 +#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 +#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 +#define __DOC6(n1, n2, n3, n4, n5, n6) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 +#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 +#define DOC(...) \ + __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) + +#if defined(__GNUG__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +static const char* __doc_ABSL_DECLARE_FLAG = R"doc()doc"; + +static const char* __doc_File = R"doc()doc"; + +static const char* __doc_operations_research_Assignment = + R"doc(An Assignment is a variable -> domains mapping, used to report +solutions to the user.)doc"; + +static const char* __doc_operations_research_Assignment_2 = + R"doc(An Assignment is a variable -> domains mapping, used to report +solutions to the user.)doc"; + +static const char* __doc_operations_research_AssignmentContainer = R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Add = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_AddAtPosition = + R"doc(Advanced usage: Adds element at a given position; position has to have +been allocated with AssignmentContainer::Resize() beforehand.)doc"; + +static const char* + __doc_operations_research_AssignmentContainer_AreAllElementsBound = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_AssignmentContainer = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Clear = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Contains = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Copy = + R"doc(Copies all the elements of 'container' to this container, clearing its +previous content.)doc"; + +static const char* + __doc_operations_research_AssignmentContainer_CopyIntersection = + R"doc(Copies the elements of 'container' which are already in the calling +container.)doc"; + +static const char* __doc_operations_research_AssignmentContainer_Element = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Element_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_ElementPtrOrNull = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Empty = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_EnsureMapIsUpToDate = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_FastAdd = + R"doc(Adds element without checking its presence in the container.)doc"; + +static const char* __doc_operations_research_AssignmentContainer_Find = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_MutableElement = R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_MutableElement_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentContainer_MutableElementOrNull = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Resize = + R"doc(Advanced usage: Resizes the container, potentially adding elements +with null variables.)doc"; + +static const char* __doc_operations_research_AssignmentContainer_Restore = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Size = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_Store = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_elements = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_elements_2 = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_elements_map = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentContainer_operator_eq = + R"doc(Returns true if this and 'container' both represent the same V* -> E +map. Runs in linear time; requires that the == operator on the type E +is well defined.)doc"; + +static const char* __doc_operations_research_AssignmentContainer_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentElement = R"doc()doc"; + +static const char* __doc_operations_research_AssignmentElement_Activate = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentElement_Activated = + R"doc()doc"; + +static const char* + __doc_operations_research_AssignmentElement_AssignmentElement = R"doc()doc"; + +static const char* __doc_operations_research_AssignmentElement_Deactivate = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentElement_activated = + R"doc()doc"; + +static const char* __doc_operations_research_AssignmentProto = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activate = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activate_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activate_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ActivateObjective = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_ActivateObjectiveFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activated = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activated_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Activated_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ActivatedObjective = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_ActivatedObjectiveFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add_2 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add_3 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add_4 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add_5 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Add_6 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_AddObjective = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_AddObjectives = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_AreAllElementsBound = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Assignment = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Assignment_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Assignment_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_BackwardSequence = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Bound = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Clear = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ClearObjective = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Contains = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Contains_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Contains_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Copy = + R"doc(Copies 'assignment' to the current assignment, clearing its previous +content.)doc"; + +static const char* __doc_operations_research_Assignment_CopyIntersection = + R"doc(Copies the intersection of the two assignments to the current +assignment.)doc"; + +static const char* __doc_operations_research_Assignment_Deactivate = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Deactivate_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Deactivate_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_DeactivateObjective = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_DeactivateObjectiveFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_DurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_DurationMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_DurationValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Empty = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_EndMax = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_EndMin = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_EndValue = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_FastAdd = + R"doc(Adds without checking if variable has been previously added.)doc"; + +static const char* __doc_operations_research_Assignment_FastAdd_2 = + R"doc(Adds without checking if variable has been previously added.)doc"; + +static const char* __doc_operations_research_Assignment_FastAdd_3 = + R"doc(Adds without checking if the variable had been previously added.)doc"; + +static const char* __doc_operations_research_Assignment_ForwardSequence = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_HasObjective = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_HasObjectiveFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_IntVarContainer = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_IntervalVarContainer = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Load = + R"doc(Loads an assignment from a file; does not add variables to the +assignment (only the variables contained in the assignment are +modified).)doc"; + +static const char* __doc_operations_research_Assignment_Load_2 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Load_3 = + R"doc(#if !defined(SWIG))doc"; + +static const char* __doc_operations_research_Assignment_Max = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Min = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_MutableIntVarContainer = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_MutableIntervalVarContainer = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_MutableSequenceVarContainer = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_NumIntVars = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_NumIntervalVars = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_NumObjectives = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_NumSequenceVars = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Objective = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveBound = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_ObjectiveBoundFromIndex = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveMaxFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveMinFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_ObjectiveValue = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_ObjectiveValueFromIndex = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_PerformedMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_PerformedMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_PerformedValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Restore = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Save = + R"doc(Saves the assignment to a file.)doc"; + +static const char* __doc_operations_research_Assignment_Save_2 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Save_3 = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SequenceVarContainer = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetBackwardSequence = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetDurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetDurationMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetDurationRange = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetDurationValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetEndMax = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetEndMin = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetEndRange = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetEndValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetForwardSequence = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetMax = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetMin = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetObjectiveMax = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_SetObjectiveMaxFromIndex = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetObjectiveMin = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_SetObjectiveMinFromIndex = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetObjectiveRange = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_SetObjectiveRangeFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetObjectiveValue = + R"doc()doc"; + +static const char* + __doc_operations_research_Assignment_SetObjectiveValueFromIndex = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetPerformedMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetPerformedMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetPerformedRange = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetPerformedValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetRange = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetSequence = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetStartMax = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetStartMin = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetStartRange = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetStartValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetUnperformed = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_SetValue = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Size = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_StartMax = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_StartMin = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_StartValue = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Store = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Unperformed = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_Value = R"doc()doc"; + +static const char* __doc_operations_research_Assignment_int_var_container = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_interval_var_container = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_objective_elements = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_operator_eq = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_Assignment_sequence_var_container = + R"doc()doc"; + +static const char* __doc_operations_research_BaseObject = + R"doc(A BaseObject is the root of all reversibly allocated objects. A +DebugString method and the associated << operator are implemented as a +convenience.)doc"; + +static const char* __doc_operations_research_BaseObject_2 = + R"doc(A BaseObject is the root of all reversibly allocated objects. A +DebugString method and the associated << operator are implemented as a +convenience.)doc"; + +static const char* __doc_operations_research_BaseObject_BaseObject = + R"doc()doc"; + +static const char* __doc_operations_research_BaseObject_BaseObject_2 = + R"doc()doc"; + +static const char* __doc_operations_research_BaseObject_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_BaseObject_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_CastConstraint = + R"doc(Cast constraints are special channeling constraints designed to keep a +variable in sync with an expression. They are created internally when +Var() is called on a subclass of IntExpr.)doc"; + +static const char* __doc_operations_research_CastConstraint_2 = + R"doc(Cast constraints are special channeling constraints designed to keep a +variable in sync with an expression. They are created internally when +Var() is called on a subclass of IntExpr.)doc"; + +static const char* __doc_operations_research_CastConstraint_CastConstraint = + R"doc()doc"; + +static const char* __doc_operations_research_CastConstraint_target_var = + R"doc()doc"; + +static const char* __doc_operations_research_CastConstraint_target_var_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ClockTimer = R"doc()doc"; + +static const char* __doc_operations_research_Constraint = + R"doc(A constraint is the main modeling object. It provides two methods: - +Post() is responsible for creating the demons and attaching them to +immediate demons(). - InitialPropagate() is called once just after +Post and performs the initial propagation. The subsequent propagations +will be performed by the demons Posted during the post() method.)doc"; + +static const char* __doc_operations_research_Constraint_2 = + R"doc(A constraint is the main modeling object. It provides two methods: - +Post() is responsible for creating the demons and attaching them to +immediate demons(). - InitialPropagate() is called once just after +Post and performs the initial propagation. The subsequent propagations +will be performed by the demons Posted during the post() method.)doc"; + +static const char* __doc_operations_research_Constraint_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_Constraint_Constraint = + R"doc()doc"; + +static const char* __doc_operations_research_Constraint_Constraint_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Constraint_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_Constraint_InitialPropagate = + R"doc(This method performs the initial propagation of the constraint. It is +called just after the post.)doc"; + +static const char* __doc_operations_research_Constraint_IsCastConstraint = + R"doc(Is the constraint created by a cast from expression to integer +variable?)doc"; + +static const char* __doc_operations_research_Constraint_Post = + R"doc(This method is called when the constraint is processed by the solver. +Its main usage is to attach demons to variables.)doc"; + +static const char* __doc_operations_research_Constraint_PostAndPropagate = + R"doc(Calls Post and then Propagate to initialize the constraints. This is +usually done in the root node.)doc"; + +static const char* __doc_operations_research_Constraint_Var = + R"doc(Creates a Boolean variable representing the status of the constraint +(false = constraint is violated, true = constraint is satisfied). It +returns nullptr if the constraint does not support this API.)doc"; + +static const char* __doc_operations_research_Constraint_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_CpRandomSeed = R"doc()doc"; + +static const char* __doc_operations_research_Decision = + R"doc(A Decision represents a choice point in the search tree. The two main +methods are Apply() to go left, or Refute() to go right.)doc"; + +static const char* __doc_operations_research_Decision_2 = + R"doc(A Decision represents a choice point in the search tree. The two main +methods are Apply() to go left, or Refute() to go right.)doc"; + +static const char* __doc_operations_research_DecisionBuilder = + R"doc(A DecisionBuilder is responsible for creating the search tree. The +important method is Next(), which returns the next decision to +execute.)doc"; + +static const char* __doc_operations_research_DecisionBuilder_2 = + R"doc(A DecisionBuilder is responsible for creating the search tree. The +important method is Next(), which returns the next decision to +execute.)doc"; + +static const char* __doc_operations_research_DecisionBuilder_Accept = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_AppendMonitors = + R"doc(This method will be called at the start of the search. It asks the +decision builder if it wants to append search monitors to the list of +active monitors for this search. Please note there are no checks at +this point for duplication.)doc"; + +static const char* __doc_operations_research_DecisionBuilder_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_DecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_DecisionBuilder_2 = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_GetName = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_Next = + R"doc(This is the main method of the decision builder class. It must return +a decision (an instance of the class Decision). If it returns nullptr, +this means that the decision builder has finished its work.)doc"; + +static const char* __doc_operations_research_DecisionBuilder_name = R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionBuilder_set_name = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionVisitor = + R"doc(A DecisionVisitor is used to inspect a decision. It contains virtual +methods for all type of 'declared' decisions.)doc"; + +static const char* __doc_operations_research_DecisionVisitor_2 = + R"doc(A DecisionVisitor is used to inspect a decision. It contains virtual +methods for all type of 'declared' decisions.)doc"; + +static const char* __doc_operations_research_DecisionVisitor_DecisionVisitor = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionVisitor_DecisionVisitor_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitRankFirstInterval = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitRankLastInterval = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitScheduleOrExpedite = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitScheduleOrPostpone = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitSetVariableValue = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitSplitVariableDomain = + R"doc()doc"; + +static const char* + __doc_operations_research_DecisionVisitor_VisitUnknownDecision = + R"doc()doc"; + +static const char* __doc_operations_research_DecisionVisitor_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_Decision_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_Decision_Apply = + R"doc(Apply will be called first when the decision is executed.)doc"; + +static const char* __doc_operations_research_Decision_DebugString = R"doc()doc"; + +static const char* __doc_operations_research_Decision_Decision = R"doc()doc"; + +static const char* __doc_operations_research_Decision_Decision_2 = R"doc()doc"; + +static const char* __doc_operations_research_Decision_Refute = + R"doc(Refute will be called after a backtrack.)doc"; + +static const char* __doc_operations_research_Decision_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_DefaultPhaseParameters = + R"doc(This struct holds all parameters for the default search. +DefaultPhaseParameters is only used by Solver::MakeDefaultPhase +methods. Note this is for advanced users only.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_DefaultPhaseParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_DisplayLevel = R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_DisplayLevel_NONE = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_DisplayLevel_NORMAL = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_DisplayLevel_VERBOSE = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_ValueSelection = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_ValueSelection_SELECT_MAX_IMPACT = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_ValueSelection_SELECT_MIN_IMPACT = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_VariableSelection = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_VariableSelection_CHOOSE_MAX_AVERAGE_IMPACT = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_VariableSelection_CHOOSE_MAX_SUM_IMPACT = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_VariableSelection_CHOOSE_MAX_VALUE_IMPACT = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_decision_builder = + R"doc(When defined, this overrides the default impact based decision +builder.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_display_level = + R"doc(This represents the amount of information displayed by the default +search. NONE means no display, VERBOSE means extra information.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_heuristic_num_failures_limit = + R"doc(The failure limit for each heuristic that we run.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_heuristic_period = + R"doc(The distance in nodes between each run of the heuristics. A negative +or null value will mean that we will not run heuristics at all.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_initialization_splits = + R"doc(Maximum number of intervals that the initialization of impacts will +scan per variable.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_persistent_impact = + R"doc(Whether to keep the impact from the first search for other searches, +or to recompute the impact for each new search.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_random_seed = + R"doc(Seed used to initialize the random part in some heuristics.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_run_all_heuristics = + R"doc(The default phase will run heuristics periodically. This parameter +indicates if we should run all heuristics, or a randomly selected one.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_use_last_conflict = + R"doc(Should we use last conflict method. The default is false.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_value_selection_schema = + R"doc(This parameter describes which value to select for a given var.)doc"; + +static const char* + __doc_operations_research_DefaultPhaseParameters_var_selection_schema = + R"doc(This parameter describes how the next variable to instantiate will be +chosen.)doc"; + +static const char* __doc_operations_research_Demon = + R"doc(A Demon is the base element of a propagation queue. It is the main +object responsible for implementing the actual propagation of the +constraint and pruning the inconsistent values in the domains of the +variables. The main concept is that demons are listeners that are +attached to the variables and listen to their modifications. There are +two methods: - Run() is the actual method called when the demon is +processed. - priority() returns its priority. Standard priorities are +slow, normal or fast. "immediate" is reserved for variables and is +treated separately.)doc"; + +static const char* __doc_operations_research_Demon_2 = + R"doc(A Demon is the base element of a propagation queue. It is the main +object responsible for implementing the actual propagation of the +constraint and pruning the inconsistent values in the domains of the +variables. The main concept is that demons are listeners that are +attached to the variables and listen to their modifications. There are +two methods: - Run() is the actual method called when the demon is +processed. - priority() returns its priority. Standard priorities are +slow, normal or fast. "immediate" is reserved for variables and is +treated separately.)doc"; + +static const char* __doc_operations_research_DemonProfiler = R"doc()doc"; + +static const char* __doc_operations_research_Demon_DebugString = R"doc()doc"; + +static const char* __doc_operations_research_Demon_Demon = + R"doc(This indicates the priority of a demon. Immediate demons are treated +separately and corresponds to variables.)doc"; + +static const char* __doc_operations_research_Demon_Demon_2 = R"doc()doc"; + +static const char* __doc_operations_research_Demon_Run = + R"doc(This is the main callback of the demon.)doc"; + +static const char* __doc_operations_research_Demon_desinhibit = + R"doc(This method un-inhibits the demon that was previously inhibited.)doc"; + +static const char* __doc_operations_research_Demon_inhibit = + R"doc(This method inhibits the demon in the search tree below the current +position.)doc"; + +static const char* __doc_operations_research_Demon_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_Demon_priority = + R"doc(This method returns the priority of the demon. Usually a demon is +fast, slow or normal. Immediate demons are reserved for internal use +to maintain variables.)doc"; + +static const char* __doc_operations_research_Demon_set_stamp = R"doc()doc"; + +static const char* __doc_operations_research_Demon_stamp = R"doc()doc"; + +static const char* __doc_operations_research_Demon_stamp_2 = R"doc()doc"; + +static const char* __doc_operations_research_Dimension = R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_DisjunctiveConstraint = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_DisjunctiveConstraint_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_MakeSequenceVar = + R"doc(Creates a sequence variable from the constraint.)doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_SetTransitionTime = + R"doc(Add a transition time between intervals. It forces the distance +between the end of interval a and start of interval b that follows it +to be at least transition_time(a, b). This function must always return +a positive or null value.)doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_TransitionTime = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_actives = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_intervals = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_nexts = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_time_cumuls = + R"doc()doc"; + +static const char* __doc_operations_research_DisjunctiveConstraint_time_slacks = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctiveConstraint_transition_time = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_AtSolution = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_CheckWithOffset = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_Copy = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_ImprovementSearchLimit = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_ImprovementSearchLimit_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_Init = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_Install = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_MakeClone = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_best_objectives = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_gradient_stage = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_improvement_rate_coefficient = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_improvement_rate_solutions_distance = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_improvements = R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_maximize = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_objective_offsets = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_objective_scaling_factors = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_objective_updated = + R"doc()doc"; + +static const char* + __doc_operations_research_ImprovementSearchLimit_objective_vars = + R"doc()doc"; + +static const char* __doc_operations_research_ImprovementSearchLimit_thresholds = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues = + R"doc(Utility class to encapsulate an IntVarIterator and use it in a range- +based loop. See the code snippet above IntVarIterator. + +It contains DEBUG_MODE-enabled code that DCHECKs that the same +iterator instance isn't being iterated on in multiple places +simultaneously.)doc"; + +static const char* __doc_operations_research_InitAndGetValues_InitAndGetValues = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator_2 = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator_Begin = + R"doc(These are the only way to construct an Iterator.)doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator_End = + R"doc()doc"; + +static const char* + __doc_operations_research_InitAndGetValues_Iterator_Iterator = R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator_is_end = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_Iterator_it = + R"doc()doc"; + +static const char* + __doc_operations_research_InitAndGetValues_Iterator_operator_inc = + R"doc()doc"; + +static const char* + __doc_operations_research_InitAndGetValues_Iterator_operator_mul = + R"doc()doc"; + +static const char* + __doc_operations_research_InitAndGetValues_Iterator_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_begin = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_begin_was_called = + R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_end = R"doc()doc"; + +static const char* __doc_operations_research_InitAndGetValues_it = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr = + R"doc(The class IntExpr is the base of all integer expressions in constraint +programming. It contains the basic protocol for an expression: - +setting and modifying its bound - querying if it is bound - listening +to events modifying its bounds - casting it into a variable (instance +of IntVar))doc"; + +static const char* __doc_operations_research_IntExpr_2 = + R"doc(The class IntExpr is the base of all integer expressions in constraint +programming. It contains the basic protocol for an expression: - +setting and modifying its bound - querying if it is bound - listening +to events modifying its bounds - casting it into a variable (instance +of IntVar))doc"; + +static const char* __doc_operations_research_IntExpr_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_IntExpr_Bound = + R"doc(Returns true if the min and the max of the expression are equal.)doc"; + +static const char* __doc_operations_research_IntExpr_IntExpr = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_IntExpr_2 = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_IsVar = + R"doc(Returns true if the expression is indeed a variable.)doc"; + +static const char* __doc_operations_research_IntExpr_Max = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_Min = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_Range = + R"doc(By default calls Min() and Max(), but can be redefined when Min and +Max code can be factorized.)doc"; + +static const char* __doc_operations_research_IntExpr_SetMax = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_SetMin = R"doc()doc"; + +static const char* __doc_operations_research_IntExpr_SetRange = + R"doc(This method sets both the min and the max of the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_SetValue = + R"doc(This method sets the value of the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_Var = + R"doc(Creates a variable from the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_VarWithName = + R"doc(Creates a variable from the expression and set the name of the +resulting var. If the expression is already a variable, then it will +set the name of the expression, possibly overwriting it. This is just +a shortcut to Var() followed by set_name().)doc"; + +static const char* __doc_operations_research_IntExpr_WhenRange = + R"doc(Attach a demon that will watch the min or the max of the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_WhenRange_2 = + R"doc(Attach a demon that will watch the min or the max of the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_WhenRange_3 = + R"doc(Attach a demon that will watch the min or the max of the expression.)doc"; + +static const char* __doc_operations_research_IntExpr_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_IntVar = + R"doc(The class IntVar is a subset of IntExpr. In addition to the IntExpr +protocol, it offers persistence, removing values from the domains, and +a finer model for events.)doc"; + +static const char* __doc_operations_research_IntVar_2 = + R"doc(The class IntVar is a subset of IntExpr. In addition to the IntExpr +protocol, it offers persistence, removing values from the domains, and +a finer model for events.)doc"; + +static const char* __doc_operations_research_IntVarAssignment = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Bound = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Clone = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Copy = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_IntVarElement = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_IntVarElement_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_LoadFromProto = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Max = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Min = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Reset = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Restore = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_SetMax = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_SetMin = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_SetRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_SetValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Store = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Value = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_Var = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_WriteToProto = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_max = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_min = R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_operator_eq = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarElement_var = R"doc()doc"; + +static const char* __doc_operations_research_IntVarIterator = + R"doc(IntVar* current_var; std::unique_ptr +it(current_var->MakeHoleIterator(false)); for (const int64_t hole : +InitAndGetValues(it)) { /// use the hole })doc"; + +static const char* __doc_operations_research_IntVarIterator_DebugString = + R"doc(Pretty Print.)doc"; + +static const char* __doc_operations_research_IntVarIterator_Init = + R"doc(This method must be called before each loop.)doc"; + +static const char* __doc_operations_research_IntVarIterator_Next = + R"doc(This method moves the iterator to the next value.)doc"; + +static const char* __doc_operations_research_IntVarIterator_Ok = + R"doc(This method indicates if we can call Value() or not.)doc"; + +static const char* __doc_operations_research_IntVarIterator_Value = + R"doc(This method returns the current value of the iterator.)doc"; + +static const char* __doc_operations_research_IntVarLocalSearchFilter = + R"doc()doc"; + +static const char* __doc_operations_research_IntVar_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_IntVar_Contains = + R"doc(This method returns whether the value 'v' is in the domain of the +variable.)doc"; + +static const char* __doc_operations_research_IntVar_IntVar = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IntVar_2 = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IntVar_3 = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IsDifferent = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IsEqual = + R"doc(IsEqual)doc"; + +static const char* __doc_operations_research_IntVar_IsGreaterOrEqual = + R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IsLessOrEqual = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_IsVar = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_MakeDomainIterator = + R"doc(Creates a domain iterator. When 'reversible' is false, the returned +object is created on the normal C++ heap and the solver does NOT take +ownership of the object.)doc"; + +static const char* __doc_operations_research_IntVar_MakeHoleIterator = + R"doc(Creates a hole iterator. When 'reversible' is false, the returned +object is created on the normal C++ heap and the solver does NOT take +ownership of the object.)doc"; + +static const char* __doc_operations_research_IntVar_OldMax = + R"doc(Returns the previous max.)doc"; + +static const char* __doc_operations_research_IntVar_OldMin = + R"doc(Returns the previous min.)doc"; + +static const char* __doc_operations_research_IntVar_RemoveInterval = + R"doc(This method removes the interval 'l' .. 'u' from the domain of the +variable. It assumes that 'l' <= 'u'.)doc"; + +static const char* __doc_operations_research_IntVar_RemoveValue = + R"doc(This method removes the value 'v' from the domain of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_RemoveValues = + R"doc(This method remove the values from the domain of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_SetValues = + R"doc(This method intersects the current domain with the values in the +array.)doc"; + +static const char* __doc_operations_research_IntVar_Size = + R"doc(This method returns the number of values in the domain of the +variable.)doc"; + +static const char* __doc_operations_research_IntVar_Value = + R"doc(This method returns the value of the variable. This method checks +before that the variable is bound.)doc"; + +static const char* __doc_operations_research_IntVar_Var = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_VarType = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_WhenBound = + R"doc(This method attaches a demon that will be awakened when the variable +is bound.)doc"; + +static const char* __doc_operations_research_IntVar_WhenBound_2 = + R"doc(This method attaches a closure that will be awakened when the variable +is bound.)doc"; + +static const char* __doc_operations_research_IntVar_WhenBound_3 = + R"doc(This method attaches an action that will be awakened when the variable +is bound.)doc"; + +static const char* __doc_operations_research_IntVar_WhenDomain = + R"doc(This method attaches a demon that will watch any domain modification +of the domain of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_WhenDomain_2 = + R"doc(This method attaches a closure that will watch any domain modification +of the domain of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_WhenDomain_3 = + R"doc(This method attaches an action that will watch any domain modification +of the domain of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_index = + R"doc(Returns the index of the variable.)doc"; + +static const char* __doc_operations_research_IntVar_index_2 = R"doc()doc"; + +static const char* __doc_operations_research_IntVar_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar = + R"doc(Interval variables are often used in scheduling. The main +characteristics of an IntervalVar are the start position, duration, +and end date. All these characteristics can be queried and set, and +demons can be posted on their modifications. + +An important aspect is optionality: an IntervalVar can be performed or +not. If unperformed, then it simply does not exist, and its +characteristics cannot be accessed any more. An interval var is +automatically marked as unperformed when it is not consistent anymore +(start greater than end, duration < 0...))doc"; + +static const char* __doc_operations_research_IntervalVar_2 = + R"doc(Interval variables are often used in scheduling. The main +characteristics of an IntervalVar are the start position, duration, +and end date. All these characteristics can be queried and set, and +demons can be posted on their modifications. + +An important aspect is optionality: an IntervalVar can be performed or +not. If unperformed, then it simply does not exist, and its +characteristics cannot be accessed any more. An interval var is +automatically marked as unperformed when it is not consistent anymore +(start greater than end, duration < 0...))doc"; + +static const char* __doc_operations_research_IntervalVarAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement = R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Bound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Clone = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Copy = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_DurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_DurationMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_DurationValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_EndMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_EndMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_EndValue = + R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_IntervalVarElement = + R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_IntervalVarElement_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_LoadFromProto = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_PerformedMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_PerformedMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_PerformedValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Reset = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Restore = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetDurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetDurationMin = + R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetDurationRange = R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetDurationValue = R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetEndMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetEndMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetEndRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetEndValue = + R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetPerformedMax = R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetPerformedMin = R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetPerformedRange = + R"doc()doc"; + +static const char* + __doc_operations_research_IntervalVarElement_SetPerformedValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetStartMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetStartMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetStartRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_SetStartValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_StartMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_StartMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_StartValue = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Store = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_Var = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_WriteToProto = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_duration_max = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_duration_min = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_end_max = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_end_min = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_operator_eq = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_performed_max = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_performed_min = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_start_max = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_start_min = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVarElement_var = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_IntervalVar_CannotBePerformed = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_DurationExpr = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_DurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_DurationMin = + R"doc(These methods query, set, and watch the duration of the interval var.)doc"; + +static const char* __doc_operations_research_IntervalVar_EndExpr = R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_EndMax = R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_EndMin = + R"doc(These methods query, set, and watch the end position of the interval +var.)doc"; + +static const char* __doc_operations_research_IntervalVar_IntervalVar = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_IntervalVar_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_IsPerformedBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_MayBePerformed = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_MustBePerformed = + R"doc(These methods query, set, and watch the performed status of the +interval var.)doc"; + +static const char* __doc_operations_research_IntervalVar_OldDurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_OldDurationMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_OldEndMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_OldEndMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_OldStartMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_OldStartMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_PerformedExpr = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SafeDurationExpr = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SafeEndExpr = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SafeStartExpr = + R"doc(These methods create expressions encapsulating the start, end and +duration of the interval var. If the interval var is unperformed, they +will return the unperformed_value.)doc"; + +static const char* __doc_operations_research_IntervalVar_SetDurationMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetDurationMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetDurationRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetEndMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetEndMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetEndRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetPerformed = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetStartMax = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetStartMin = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_SetStartRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_StartExpr = + R"doc(These methods create expressions encapsulating the start, end and +duration of the interval var. Please note that these must not be used +if the interval var is unperformed.)doc"; + +static const char* __doc_operations_research_IntervalVar_StartMax = R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_StartMin = + R"doc(These methods query, set, and watch the start position of the interval +var.)doc"; + +static const char* __doc_operations_research_IntervalVar_WasPerformedBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenAnything = + R"doc(Attaches a demon awakened when anything about this interval changes.)doc"; + +static const char* __doc_operations_research_IntervalVar_WhenAnything_2 = + R"doc(Attaches a closure awakened when anything about this interval changes.)doc"; + +static const char* __doc_operations_research_IntervalVar_WhenAnything_3 = + R"doc(Attaches an action awakened when anything about this interval changes.)doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationBound_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationBound_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationRange_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenDurationRange_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndBound_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndBound_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndRange_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenEndRange_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenPerformedBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenPerformedBound_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenPerformedBound_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartBound = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartBound_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartBound_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartRange = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartRange_2 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_WhenStartRange_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IntervalVar_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_LightIntFunctionElementCt = + R"doc()doc"; + +static const char* __doc_operations_research_LightIntIntFunctionElementCt = + R"doc()doc"; + +static const char* __doc_operations_research_LocalSearch = R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchFilter = R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchFilterManager = + R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchMonitor = R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchOperator = R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchPhaseParameters = + R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchProfiler = R"doc()doc"; + +static const char* __doc_operations_research_ModelCache = R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor = + R"doc(Model visitor.)doc"; + +static const char* __doc_operations_research_ModelVisitor_2 = + R"doc(Model visitor.)doc"; + +static const char* __doc_operations_research_ModelVisitor_BeginVisitConstraint = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_BeginVisitExtension = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_BeginVisitIntegerExpression = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_BeginVisitModel = + R"doc(Begin/End visit element.)doc"; + +static const char* __doc_operations_research_ModelVisitor_EndVisitConstraint = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_EndVisitExtension = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_EndVisitIntegerExpression = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_EndVisitModel = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitInt64ToBoolExtension = + R"doc(Using SWIG on callbacks is troublesome, so we hide these methods +during the wrapping.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitInt64ToInt64AsArray = + R"doc(Expands function as array when index min is 0.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitInt64ToInt64Extension = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_VisitIntegerArgument = + R"doc(Visit integer arguments.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerArrayArgument = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerExpressionArgument = + R"doc(Visit integer expression argument.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerMatrixArgument = + R"doc()doc"; + +static const char* __doc_operations_research_ModelVisitor_VisitIntegerVariable = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerVariable_2 = R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerVariableArrayArgument = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntegerVariableEvaluatorArgument = + R"doc(Helpers.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntervalArgument = + R"doc(Visit interval argument.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntervalArrayArgument = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitIntervalVariable = R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitSequenceArgument = + R"doc(Visit sequence argument.)doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitSequenceArrayArgument = + R"doc()doc"; + +static const char* + __doc_operations_research_ModelVisitor_VisitSequenceVariable = R"doc()doc"; + +static const char* __doc_operations_research_NumericalRev = + R"doc(Subclass of Rev which adds numerical operations.)doc"; + +static const char* __doc_operations_research_NumericalRevArray = + R"doc(Subclass of RevArray which adds numerical operations.)doc"; + +static const char* __doc_operations_research_NumericalRevArray_Add = + R"doc()doc"; + +static const char* __doc_operations_research_NumericalRevArray_Decr = + R"doc()doc"; + +static const char* __doc_operations_research_NumericalRevArray_Incr = + R"doc()doc"; + +static const char* + __doc_operations_research_NumericalRevArray_NumericalRevArray = R"doc()doc"; + +static const char* __doc_operations_research_NumericalRev_Add = R"doc()doc"; + +static const char* __doc_operations_research_NumericalRev_Decr = R"doc()doc"; + +static const char* __doc_operations_research_NumericalRev_Incr = R"doc()doc"; + +static const char* __doc_operations_research_NumericalRev_NumericalRev = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor = R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_2 = R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_Accept = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_AcceptDelta = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_AtSolution = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_BestInternalValue = R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_BestValue = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_CurrentInternalValue = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_CurrentInternalValuesAreConstraining = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_EnterSearch = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_MakeMinimizationVarsLessOrEqualWithSteps = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_MakeMinimizationVarsLessOrEqualWithStepsStatus = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_Maximize = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_MinimizationVar = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_ObjectiveMonitor = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_ObjectiveMonitor_2 = R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_ObjectiveVar = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_SetCurrentInternalValue = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_Size = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_Step = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_best_values = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_current_values = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_found_initial_solution = + R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_minimization_vars = R"doc()doc"; + +static const char* + __doc_operations_research_ObjectiveMonitor_minimization_vars_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_objective_vars = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_objective_vars_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_steps = + R"doc()doc"; + +static const char* __doc_operations_research_ObjectiveMonitor_upper_bounds = + R"doc()doc"; + +static const char* __doc_operations_research_One = + R"doc(This method returns 1)doc"; + +static const char* __doc_operations_research_OptimizeVar = + R"doc(This class encapsulates an objective. It requires the direction +(minimize or maximize), the variable to optimize, and the improvement +step.)doc"; + +static const char* __doc_operations_research_OptimizeVar_2 = + R"doc(This class encapsulates an objective. It requires the direction +(minimize or maximize), the variable to optimize, and the improvement +step.)doc"; + +static const char* __doc_operations_research_OptimizeVar_AcceptSolution = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_ApplyBound = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_AtSolution = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_BeginNextDecision = + R"doc(Internal methods.)doc"; + +static const char* __doc_operations_research_OptimizeVar_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_Name = R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_OptimizeVar = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_OptimizeVar_2 = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_RefuteDecision = + R"doc()doc"; + +static const char* __doc_operations_research_OptimizeVar_best = + R"doc(Returns the best value found during search.)doc"; + +static const char* __doc_operations_research_OptimizeVar_var = + R"doc(Returns the variable that is optimized.)doc"; + +static const char* __doc_operations_research_Pack = R"doc()doc"; + +static const char* __doc_operations_research_Pack_2 = R"doc()doc"; + +static const char* __doc_operations_research_Pack_Accept = R"doc()doc"; + +static const char* + __doc_operations_research_Pack_AddCountAssignedItemsDimension = + R"doc(This dimension links 'count_var' to the actual number of items +assigned to a bin in the pack.)doc"; + +static const char* __doc_operations_research_Pack_AddCountUsedBinDimension = + R"doc(This dimension links 'count_var' to the actual number of bins used in +the pack.)doc"; + +static const char* + __doc_operations_research_Pack_AddSumVariableWeightsLessOrEqualConstantDimension = + R"doc(This dimension imposes: forall b in bins, sum (i in items: usage[i] * +is_assigned(i, b)) <= capacity[b] where is_assigned(i, b) is true if +and only if item i is assigned to the bin b. + +This can be used to model shapes of items by linking variables of the +same item on parallel dimensions with an allowed assignment +constraint.)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumEqualVarDimension = + R"doc(This dimension imposes that for all bins b, the weighted sum +(weights[i]) of all objects i assigned to 'b' is equal to loads[b].)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumEqualVarDimension_2 = + R"doc(This dimension imposes that for all bins b, the weighted sum +(weights->Run(i, b)) of all objects i assigned to 'b' is equal to +loads[b].)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumLessOrEqualConstantDimension = + R"doc(This dimension imposes that for all bins b, the weighted sum +(weights[i]) of all objects i assigned to 'b' is less or equal +'bounds[b]'.)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumLessOrEqualConstantDimension_2 = + R"doc(This dimension imposes that for all bins b, the weighted sum +(weights->Run(i)) of all objects i assigned to 'b' is less or equal to +'bounds[b]'. Ownership of the callback is transferred to the pack +constraint.)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumLessOrEqualConstantDimension_3 = + R"doc(This dimension imposes that for all bins b, the weighted sum +(weights->Run(i, b) of all objects i assigned to 'b' is less or equal +to 'bounds[b]'. Ownership of the callback is transferred to the pack +constraint.)doc"; + +static const char* + __doc_operations_research_Pack_AddWeightedSumOfAssignedDimension = + R"doc(This dimension enforces that cost_var == sum of weights[i] for all +objects 'i' assigned to a bin.)doc"; + +static const char* __doc_operations_research_Pack_Assign = R"doc()doc"; + +static const char* __doc_operations_research_Pack_AssignAllPossibleToBin = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_AssignAllRemainingItems = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_AssignFirstPossibleToBin = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_AssignVar = R"doc()doc"; + +static const char* __doc_operations_research_Pack_ClearAll = R"doc()doc"; + +static const char* __doc_operations_research_Pack_DebugString = R"doc()doc"; + +static const char* __doc_operations_research_Pack_InitialPropagate = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_IsAssignedStatusKnown = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_IsInProcess = R"doc()doc"; + +static const char* __doc_operations_research_Pack_IsPossible = R"doc()doc"; + +static const char* __doc_operations_research_Pack_IsUndecided = R"doc()doc"; + +static const char* __doc_operations_research_Pack_OneDomain = R"doc()doc"; + +static const char* __doc_operations_research_Pack_Pack = R"doc()doc"; + +static const char* __doc_operations_research_Pack_Post = R"doc()doc"; + +static const char* __doc_operations_research_Pack_Propagate = R"doc()doc"; + +static const char* __doc_operations_research_Pack_PropagateDelayed = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_RemoveAllPossibleFromBin = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_SetAssigned = R"doc()doc"; + +static const char* __doc_operations_research_Pack_SetImpossible = R"doc()doc"; + +static const char* __doc_operations_research_Pack_SetUnassigned = R"doc()doc"; + +static const char* __doc_operations_research_Pack_UnassignAllRemainingItems = + R"doc()doc"; + +static const char* __doc_operations_research_Pack_bins = R"doc()doc"; + +static const char* __doc_operations_research_Pack_demon = R"doc()doc"; + +static const char* __doc_operations_research_Pack_dims = R"doc()doc"; + +static const char* __doc_operations_research_Pack_forced = R"doc()doc"; + +static const char* __doc_operations_research_Pack_holes = R"doc()doc"; + +static const char* __doc_operations_research_Pack_in_process = R"doc()doc"; + +static const char* __doc_operations_research_Pack_removed = R"doc()doc"; + +static const char* __doc_operations_research_Pack_stamp = R"doc()doc"; + +static const char* __doc_operations_research_Pack_to_set = R"doc()doc"; + +static const char* __doc_operations_research_Pack_to_unset = R"doc()doc"; + +static const char* __doc_operations_research_Pack_unprocessed = R"doc()doc"; + +static const char* __doc_operations_research_Pack_vars = R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_Accept = + R"doc()doc"; + +static const char* + __doc_operations_research_ProfiledDecisionBuilder_AppendMonitors = + R"doc()doc"; + +static const char* + __doc_operations_research_ProfiledDecisionBuilder_DebugString = R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_Next = + R"doc()doc"; + +static const char* + __doc_operations_research_ProfiledDecisionBuilder_ProfiledDecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_db = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_name = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_name_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_seconds = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_seconds_2 = + R"doc()doc"; + +static const char* __doc_operations_research_ProfiledDecisionBuilder_timer = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject = + R"doc(The PropagationBaseObject is a subclass of BaseObject that is also +friend to the Solver class. It allows accessing methods useful when +writing new constraints or new expressions.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_2 = + R"doc(The PropagationBaseObject is a subclass of BaseObject that is also +friend to the Solver class. It allows accessing methods useful when +writing new constraints or new expressions.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_BaseName = + R"doc(Returns a base name for automatic naming.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject_EnqueueAll = + R"doc()doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_EnqueueDelayedDemon = + R"doc(This method pushes the demon onto the propagation queue. It will be +processed directly if the queue is empty. It will be enqueued +according to its priority otherwise.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_EnqueueVar = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject_ExecuteAll = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject_FreezeQueue = + R"doc(This method freezes the propagation queue. It is useful when you need +to apply multiple modifications at once.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_HasName = + R"doc(Returns whether the object has been named or not.)doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_PropagationBaseObject = + R"doc()doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_PropagationBaseObject_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_UnfreezeQueue = + R"doc(This method unfreezes the propagation queue. All modifications that +happened when the queue was frozen will be processed.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_name = + R"doc(Object naming.)doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_operator_assign = + R"doc()doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_reset_action_on_fail = + R"doc(This method clears the failure callback.)doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_set_action_on_fail = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject_set_name = + R"doc()doc"; + +static const char* + __doc_operations_research_PropagationBaseObject_set_variable_to_clean_on_fail = + R"doc(Shortcut for variable cleaner.)doc"; + +static const char* __doc_operations_research_PropagationBaseObject_solver = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationBaseObject_solver_2 = + R"doc()doc"; + +static const char* __doc_operations_research_PropagationMonitor = R"doc()doc"; + +static const char* __doc_operations_research_Queue = R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit = + R"doc(Usual limit based on wall_time, number of explored branches and number +of failures in the search tree)doc"; + +static const char* __doc_operations_research_RegularLimit_2 = + R"doc(Usual limit based on wall_time, number of explored branches and number +of failures in the search tree)doc"; + +static const char* __doc_operations_research_RegularLimitParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_RegularLimit_AbsoluteSolverDeadline = R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_Accept = R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_CheckTime = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_CheckWithOffset = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_Copy = R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_ExitSearch = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_GetPercent = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_Init = R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_Install = R"doc()doc"; + +static const char* + __doc_operations_research_RegularLimit_IsUncheckedSolutionLimitReached = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_MakeClone = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_MakeIdenticalClone = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_ProgressPercent = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_RegularLimit = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_TimeElapsed = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_UpdateLimits = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_branches = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_branches_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_branches_offset = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_check_count = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_cumulative = + R"doc(If cumulative if false, then the limit applies to each search +independently. If it's true, the limit applies globally to all search +for which this monitor is used. When cumulative is true, the offset +fields have two different meanings depending on context: - within a +search, it's an offset to be subtracted from the current value - +outside of search, it's the amount consumed in previous searches)doc"; + +static const char* __doc_operations_research_RegularLimit_duration_limit = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_duration_limit_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_failures = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_failures_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_failures_offset = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_last_time_elapsed = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_next_check = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_smart_time_check = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_solutions = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_solutions_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_solutions_offset = + R"doc()doc"; + +static const char* + __doc_operations_research_RegularLimit_solver_time_at_limit_start = + R"doc()doc"; + +static const char* __doc_operations_research_RegularLimit_wall_time = + R"doc()doc"; + +static const char* __doc_operations_research_Rev = + R"doc(This class adds reversibility to a POD type. It contains the stamp +optimization. i.e. the SaveValue call is done only once per node of +the search tree. Please note that actual stamps always starts at 1, +thus an initial value of 0 will always trigger the first SaveValue.)doc"; + +static const char* __doc_operations_research_RevArray = + R"doc(Reversible array of POD types. It contains the stamp optimization. +I.e., the SaveValue call is done only once per node of the search +tree. Please note that actual stamp always starts at 1, thus an +initial value of 0 always triggers the first SaveValue.)doc"; + +static const char* __doc_operations_research_RevArray_RevArray = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_SetValue = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_Value = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_operator_array = + R"doc()doc"; + +static const char* __doc_operations_research_RevArray_size = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_size_2 = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_stamps = R"doc()doc"; + +static const char* __doc_operations_research_RevArray_values = R"doc()doc"; + +static const char* __doc_operations_research_RevBitMatrix = R"doc()doc"; + +static const char* __doc_operations_research_Rev_Rev = R"doc()doc"; + +static const char* __doc_operations_research_Rev_SetValue = R"doc()doc"; + +static const char* __doc_operations_research_Rev_Value = R"doc()doc"; + +static const char* __doc_operations_research_Rev_stamp = R"doc()doc"; + +static const char* __doc_operations_research_Rev_value = R"doc()doc"; + +static const char* __doc_operations_research_Search = R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit = + R"doc(Base class of all search limits.)doc"; + +static const char* __doc_operations_research_SearchLimit_2 = + R"doc(Base class of all search limits.)doc"; + +static const char* __doc_operations_research_SearchLimit_BeginNextDecision = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_Check = + R"doc(This method is called to check the status of the limit. A return value +of true indicates that we have indeed crossed the limit. In that case, +this method will not be called again and the remaining search will be +discarded.)doc"; + +static const char* __doc_operations_research_SearchLimit_CheckWithOffset = + R"doc(Same as Check() but adds the 'offset' value to the current time when +time is considered in the limit.)doc"; + +static const char* __doc_operations_research_SearchLimit_Copy = + R"doc(Copy a limit. Warning: leads to a direct (no check) downcasting of +'limit' so one needs to be sure both SearchLimits are of the same +type.)doc"; + +static const char* __doc_operations_research_SearchLimit_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_EnterSearch = + R"doc(Internal methods.)doc"; + +static const char* __doc_operations_research_SearchLimit_Init = + R"doc(This method is called when the search limit is initialized.)doc"; + +static const char* __doc_operations_research_SearchLimit_Install = R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_MakeClone = + R"doc(Allocates a clone of the limit.)doc"; + +static const char* __doc_operations_research_SearchLimit_PeriodicCheck = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_RefuteDecision = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_SearchLimit = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_SearchLimit_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_TopPeriodicCheck = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_crossed = + R"doc(Returns true if the limit has been crossed.)doc"; + +static const char* __doc_operations_research_SearchLimit_crossed_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SearchLimit_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor = + R"doc(A search monitor is a simple set of callbacks to monitor all search +events)doc"; + +static const char* __doc_operations_research_SearchMonitor_2 = + R"doc(A search monitor is a simple set of callbacks to monitor all search +events)doc"; + +static const char* __doc_operations_research_SearchMonitor_Accept = + R"doc(Accepts the given model visitor.)doc"; + +static const char* __doc_operations_research_SearchMonitor_AcceptDelta = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_AcceptNeighbor = + R"doc(After accepting a neighbor during local search.)doc"; + +static const char* __doc_operations_research_SearchMonitor_AcceptSolution = + R"doc(This method is called when a solution is found. It asserts whether the +solution is valid. A value of false indicates that the solution should +be discarded.)doc"; + +static const char* + __doc_operations_research_SearchMonitor_AcceptUncheckedNeighbor = + R"doc(After accepting an unchecked neighbor during local search.)doc"; + +static const char* __doc_operations_research_SearchMonitor_AfterDecision = + R"doc(Just after refuting or applying the decision, apply is true after +Apply. This is called only if the Apply() or Refute() methods have not +failed.)doc"; + +static const char* __doc_operations_research_SearchMonitor_ApplyDecision = + R"doc(Before applying the decision.)doc"; + +static const char* __doc_operations_research_SearchMonitor_AtSolution = + R"doc(This method is called when a valid solution is found. If the return +value is true, then search will resume after. If the result is false, +then search will stop there.)doc"; + +static const char* __doc_operations_research_SearchMonitor_BeginFail = + R"doc(Just when the failure occurs.)doc"; + +static const char* + __doc_operations_research_SearchMonitor_BeginInitialPropagation = + R"doc(Before the initial propagation.)doc"; + +static const char* __doc_operations_research_SearchMonitor_BeginNextDecision = + R"doc(Before calling DecisionBuilder::Next.)doc"; + +static const char* __doc_operations_research_SearchMonitor_EndFail = + R"doc(After completing the backtrack.)doc"; + +static const char* + __doc_operations_research_SearchMonitor_EndInitialPropagation = + R"doc(After the initial propagation.)doc"; + +static const char* __doc_operations_research_SearchMonitor_EndNextDecision = + R"doc(After calling DecisionBuilder::Next, along with the returned decision.)doc"; + +static const char* __doc_operations_research_SearchMonitor_EnterSearch = + R"doc(Beginning of the search.)doc"; + +static const char* __doc_operations_research_SearchMonitor_ExitSearch = + R"doc(End of the search.)doc"; + +static const char* __doc_operations_research_SearchMonitor_Install = + R"doc(Registers itself on the solver such that it gets notified of the +search and propagation events. Override to incrementally install +listeners for specific events.)doc"; + +static const char* + __doc_operations_research_SearchMonitor_IsUncheckedSolutionLimitReached = + R"doc(Returns true if the limit of solutions has been reached including +unchecked solutions.)doc"; + +static const char* __doc_operations_research_SearchMonitor_ListenToEvent = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_LocalOptimum = + R"doc(When a local optimum is reached. If 'true' is returned, the last +solution is discarded and the search proceeds with the next one.)doc"; + +static const char* __doc_operations_research_SearchMonitor_NoMoreSolutions = + R"doc(When the search tree is finished.)doc"; + +static const char* __doc_operations_research_SearchMonitor_PeriodicCheck = + R"doc(Periodic call to check limits in long running methods.)doc"; + +static const char* __doc_operations_research_SearchMonitor_ProgressPercent = + R"doc(Returns a percentage representing the propress of the search before +reaching limits.)doc"; + +static const char* __doc_operations_research_SearchMonitor_RefuteDecision = + R"doc(Before refuting the decision.)doc"; + +static const char* __doc_operations_research_SearchMonitor_RestartSearch = + R"doc(Restart the search.)doc"; + +static const char* __doc_operations_research_SearchMonitor_SearchMonitor = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_SearchMonitor_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_solver = R"doc()doc"; + +static const char* __doc_operations_research_SearchMonitor_solver_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar = + R"doc(A sequence variable is a variable whose domain is a set of possible +orderings of the interval variables. It allows ordering of tasks. It +has two sets of methods: ComputePossibleFirstsAndLasts(), which +returns the list of interval variables that can be ranked first or +last; and RankFirst/RankNotFirst/RankLast/RankNotLast, which can be +used to create the search decision.)doc"; + +static const char* __doc_operations_research_SequenceVar_2 = + R"doc(A sequence variable is a variable whose domain is a set of possible +orderings of the interval variables. It allows ordering of tasks. It +has two sets of methods: ComputePossibleFirstsAndLasts(), which +returns the list of interval variables that can be ranked first or +last; and RankFirst/RankNotFirst/RankLast/RankNotLast, which can be +used to create the search decision.)doc"; + +static const char* __doc_operations_research_SequenceVarAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement = + R"doc(The SequenceVarElement stores a partial representation of ranked +interval variables in the underlying sequence variable. This +representation consists of three vectors: - the forward sequence. That +is the list of interval variables ranked first in the sequence. The +first element of the backward sequence is the first interval in the +sequence variable. - the backward sequence. That is the list of +interval variables ranked last in the sequence. The first element of +the backward sequence is the last interval in the sequence variable. - +The list of unperformed interval variables. Furthermore, if all +performed variables are ranked, then by convention, the +forward_sequence will contain all such variables and the +backward_sequence will be empty.)doc"; + +static const char* + __doc_operations_research_SequenceVarElement_BackwardSequence = R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Bound = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_CheckClassInvariants = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Clone = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Copy = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_DebugString = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_ForwardSequence = R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_LoadFromProto = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Reset = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Restore = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_SequenceVarElement = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_SequenceVarElement_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_SetBackwardSequence = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_SetForwardSequence = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_SetSequence = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_SetUnperformed = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Store = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Unperformed = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_Var = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_WriteToProto = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_backward_sequence = + R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVarElement_forward_sequence = R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_operator_eq = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_operator_ne = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_unperformed = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVarElement_var = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_Accept = + R"doc(Accepts the given visitor.)doc"; + +static const char* __doc_operations_research_SequenceVar_ActiveHorizonRange = + R"doc(Returns the minimum start min and the maximum end max of all unranked +interval vars in the sequence.)doc"; + +static const char* + __doc_operations_research_SequenceVar_ComputeBackwardFrontier = R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVar_ComputeForwardFrontier = R"doc()doc"; + +static const char* + __doc_operations_research_SequenceVar_ComputePossibleFirstsAndLasts = + R"doc(Computes the set of indices of interval variables that can be ranked +first in the set of unranked activities.)doc"; + +static const char* __doc_operations_research_SequenceVar_ComputeStatistics = + R"doc(Compute statistics on the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_DurationRange = + R"doc(Returns the minimum and maximum duration of combined interval vars in +the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_FillSequence = + R"doc(Clears 'rank_first' and 'rank_last', and fills them with the intervals +in the order of the ranks. If all variables are ranked, 'rank_first' +will contain all variables, and 'rank_last' will contain none. +'unperformed' will contains all such interval variables. rank_first +and rank_last represents different directions. rank_first[0] +corresponds to the first interval of the sequence. rank_last[0] +corresponds to the last interval of the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_HorizonRange = + R"doc(Returns the minimum start min and the maximum end max of all interval +vars in the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_Interval = + R"doc(Returns the index_th interval of the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_Next = + R"doc(Returns the next of the index_th interval of the sequence.)doc"; + +static const char* __doc_operations_research_SequenceVar_RankFirst = + R"doc(Ranks the index_th interval var first of all unranked interval vars. +After that, it will no longer be considered ranked.)doc"; + +static const char* __doc_operations_research_SequenceVar_RankLast = + R"doc(Ranks the index_th interval var first of all unranked interval vars. +After that, it will no longer be considered ranked.)doc"; + +static const char* __doc_operations_research_SequenceVar_RankNotFirst = + R"doc(Indicates that the index_th interval var will not be ranked first of +all currently unranked interval vars.)doc"; + +static const char* __doc_operations_research_SequenceVar_RankNotLast = + R"doc(Indicates that the index_th interval var will not be ranked first of +all currently unranked interval vars.)doc"; + +static const char* __doc_operations_research_SequenceVar_RankSequence = + R"doc(Applies the following sequence of ranks, ranks first, then rank last. +rank_first and rank_last represents different directions. +rank_first[0] corresponds to the first interval of the sequence. +rank_last[0] corresponds to the last interval of the sequence. All +intervals in the unperformed vector will be marked as such.)doc"; + +static const char* __doc_operations_research_SequenceVar_SequenceVar = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_UpdatePrevious = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_intervals = + R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_nexts = R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_previous = R"doc()doc"; + +static const char* __doc_operations_research_SequenceVar_size = + R"doc(Returns the number of interval vars in the sequence.)doc"; + +static const char* __doc_operations_research_SetAssignmentFromAssignment = + R"doc(Given a "source_assignment", clears the "target_assignment" and adds +all IntVars in "target_vars", with the values of the variables set +according to the corresponding values of "source_vars" in +"source_assignment". source_vars and target_vars must have the same +number of elements. The source and target assignments can belong to +different Solvers.)doc"; + +static const char* __doc_operations_research_SimpleRevFIFO = R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector = + R"doc(This class is the root class of all solution collectors. It implements +a basic query API to be used independently of the collector used.)doc"; + +static const char* __doc_operations_research_SolutionCollector_2 = + R"doc(This class is the root class of all solution collectors. It implements +a basic query API to be used independently of the collector used.)doc"; + +static const char* __doc_operations_research_SolutionCollector_Add = + R"doc(Add API.)doc"; + +static const char* __doc_operations_research_SolutionCollector_Add_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_Add_3 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_Add_4 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_Add_5 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_Add_6 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_AddObjective = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_AddObjectives = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_BackwardSequence = + R"doc(This is a shortcut to get the BackwardSequence of 'var' in the nth +solution. The backward sequence is the list of ranked interval +variables starting from the end of the sequence.)doc"; + +static const char* + __doc_operations_research_SolutionCollector_BuildSolutionDataForCurrentState = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_DebugString = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_DurationValue = + R"doc(This is a shortcut to get the DurationValue of 'var' in the nth +solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_EndValue = + R"doc(This is a shortcut to get the EndValue of 'var' in the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_EnterSearch = + R"doc(Beginning of the search.)doc"; + +static const char* __doc_operations_research_SolutionCollector_ForwardSequence = + R"doc(This is a shortcut to get the ForwardSequence of 'var' in the nth +solution. The forward sequence is the list of ranked interval +variables starting from the start of the sequence.)doc"; + +static const char* __doc_operations_research_SolutionCollector_FreeSolution = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_Install = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_ObjectiveValueFromIndex = + R"doc(Returns the value of the index-th objective of the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_PerformedValue = + R"doc(This is a shortcut to get the PerformedValue of 'var' in the nth +solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_PopSolution = + R"doc(Remove and delete the last popped solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_Push = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_PushSolution = + R"doc(Push the current state as a new solution.)doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionCollector = R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionCollector_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionCollector_3 = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_SolutionData = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_ObjectiveValue = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_ObjectiveValueFromIndex = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_branches = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_failures = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_operator_lt = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_solution = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_SolutionData_time = R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_StartValue = + R"doc(This is a shortcut to get the StartValue of 'var' in the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_Unperformed = + R"doc(This is a shortcut to get the list of unperformed of 'var' in the nth +solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_Value = + R"doc(This is a shortcut to get the Value of 'var' in the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_branches = + R"doc(Returns the number of branches when the nth solution was found.)doc"; + +static const char* __doc_operations_research_SolutionCollector_check_index = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_failures = + R"doc(Returns the number of failures encountered at the time of the nth +solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_has_solution = + R"doc(Returns whether any solutions were stored during the search.)doc"; + +static const char* + __doc_operations_research_SolutionCollector_last_solution_or_null = + R"doc(Returns the last solution if there are any, nullptr otherwise.)doc"; + +static const char* __doc_operations_research_SolutionCollector_objective_value = + R"doc(Returns the objective value of the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_prototype = + R"doc()doc"; + +static const char* + __doc_operations_research_SolutionCollector_recycle_solutions = R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_solution = + R"doc(Returns the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionCollector_solution_count = + R"doc(Returns how many solutions were stored during the search.)doc"; + +static const char* __doc_operations_research_SolutionCollector_solution_data = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_solution_pool = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionCollector_wall_time = + R"doc(Returns the wall time in ms for the nth solution.)doc"; + +static const char* __doc_operations_research_SolutionPool = + R"doc(This class is used to manage a pool of solutions. It can transform a +single point local search into a multipoint local search.)doc"; + +static const char* __doc_operations_research_SolutionPool_2 = + R"doc(This class is used to manage a pool of solutions. It can transform a +single point local search into a multipoint local search.)doc"; + +static const char* __doc_operations_research_SolutionPool_GetNextSolution = + R"doc(This method is called when the local search starts a new neighborhood +to initialize the default assignment.)doc"; + +static const char* __doc_operations_research_SolutionPool_Initialize = + R"doc(This method is called to initialize the solution pool with the +assignment from the local search.)doc"; + +static const char* __doc_operations_research_SolutionPool_RegisterNewSolution = + R"doc(This method is called when a new solution has been accepted by the +local search.)doc"; + +static const char* __doc_operations_research_SolutionPool_SolutionPool = + R"doc()doc"; + +static const char* __doc_operations_research_SolutionPool_SyncNeeded = + R"doc(This method checks if the local solution needs to be updated with an +external one.)doc"; + +static const char* __doc_operations_research_Solver = + R"doc(Solver Class + +A solver represents the main computation engine. It implements the +entire range of Constraint Programming protocols: - Reversibility - +Propagation - Search + +Usually, Constraint Programming code consists of - the creation of the +Solver, - the creation of the decision variables of the model, - the +creation of the constraints of the model and their addition to the +solver() through the AddConstraint() method, - the creation of the +main DecisionBuilder class, - the launch of the solve() method with +the decision builder. + +For the time being, Solver is neither MT_SAFE nor MT_HOT.)doc"; + +static const char* __doc_operations_research_Solver_ABSL_DEPRECATED = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_ABSL_DEPRECATED_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_Accept = + R"doc(Accepts the given model visitor.)doc"; + +static const char* __doc_operations_research_Solver_ActiveSearch = + R"doc(Returns the active search, nullptr outside search.)doc"; + +static const char* __doc_operations_research_Solver_AddBacktrackAction = + R"doc(When SaveValue() is not the best way to go, one can create a +reversible action that will be called upon backtrack. The "fast" +parameter indicates whether we need restore all values saved through +SaveValue() before calling this method.)doc"; + +static const char* __doc_operations_research_Solver_AddCastConstraint = + R"doc(Adds 'constraint' to the solver and marks it as a cast constraint, +that is, a constraint created calling Var() on an expression. This is +used internally.)doc"; + +static const char* __doc_operations_research_Solver_AddConstraint = + R"doc(Adds the constraint 'c' to the model. + +After calling this method, and until there is a backtrack that undoes +the addition, any assignment of variables to values must satisfy the +given constraint in order to be considered feasible. There are two +fairly different use cases: + +- the most common use case is modeling: the given constraint is really +part of the problem that the user is trying to solve. In this use +case, AddConstraint is called outside of search (i.e., with ``state() +== OUTSIDE_SEARCH``). Most users should only use AddConstraint in this +way. In this case, the constraint will belong to the model forever: it +cannot be removed by backtracking. + +- a rarer use case is that 'c' is not a real constraint of the model. +It may be a constraint generated by a branching decision (a constraint +whose goal is to restrict the search space), a symmetry breaking +constraint (a constraint that does restrict the search space, but in a +way that cannot have an impact on the quality of the solutions in the +subtree), or an inferred constraint that, while having no semantic +value to the model (it does not restrict the set of solutions), is +worth having because we believe it may strengthen the propagation. In +these cases, it happens that the constraint is added during the search +(i.e., with state() == IN_SEARCH or state() == IN_ROOT_NODE). When a +constraint is added during a search, it applies only to the subtree of +the search tree rooted at the current node, and will be automatically +removed by backtracking. + +This method does not take ownership of the constraint. If the +constraint has been created by any factory method (Solver::MakeXXX), +it will automatically be deleted. However, power users who implement +their own constraints should do: +solver.AddConstraint(solver.RevAlloc(new MyConstraint(...));)doc"; + +static const char* __doc_operations_research_Solver_AddLocalSearchMonitor = + R"doc(Adds the local search monitor to the solver. This is called internally +when a propagation monitor is passed to the Solve() or NewSearch() +method.)doc"; + +static const char* __doc_operations_research_Solver_AddPropagationMonitor = + R"doc(Adds the propagation monitor to the solver. This is called internally +when a propagation monitor is passed to the Solve() or NewSearch() +method.)doc"; + +static const char* __doc_operations_research_Solver_BacktrackOneLevel = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_BacktrackToSentinel = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_BinaryIntervalRelation = + R"doc(This enum is used in Solver::MakeIntervalVarRelation to specify the +temporal relation between the two intervals t1 and t2.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_ENDS_AFTER_END = + R"doc(t1 ends after t2 end, i.e. End(t1) >= End(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_ENDS_AFTER_START = + R"doc(t1 ends after t2 start, i.e. End(t1) >= Start(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_ENDS_AT_END = + R"doc(t1 ends at t2 end, i.e. End(t1) == End(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_ENDS_AT_START = + R"doc(t1 ends at t2 start, i.e. End(t1) == Start(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_STARTS_AFTER_END = + R"doc(t1 starts after t2 end, i.e. Start(t1) >= End(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_STARTS_AFTER_START = + R"doc(t1 starts after t2 start, i.e. Start(t1) >= Start(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_STARTS_AT_END = + R"doc(t1 starts at t2 end, i.e. Start(t1) == End(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_STARTS_AT_START = + R"doc(t1 starts at t2 start, i.e. Start(t1) == Start(t2) + delay.)doc"; + +static const char* + __doc_operations_research_Solver_BinaryIntervalRelation_STAYS_IN_SYNC = + R"doc(STARTS_AT_START and ENDS_AT_END at the same time. t1 starts at t2 +start, i.e. Start(t1) == Start(t2) + delay. t1 ends at t2 end, i.e. +End(t1) == End(t2).)doc"; + +static const char* __doc_operations_research_Solver_Cache = + R"doc(Returns the cache of the model.)doc"; + +static const char* __doc_operations_research_Solver_CastExpression = + R"doc(Internal. If the variables is the result of expr->Var(), this method +returns expr, nullptr otherwise.)doc"; + +static const char* __doc_operations_research_Solver_CheckAssignment = + R"doc(Checks whether the given assignment satisfies all relevant +constraints.)doc"; + +static const char* __doc_operations_research_Solver_CheckConstraint = + R"doc(Checks whether adding this constraint will lead to an immediate +failure. It will return false if the model is already inconsistent, or +if adding the constraint makes it inconsistent.)doc"; + +static const char* __doc_operations_research_Solver_CheckFail = R"doc()doc"; + +static const char* __doc_operations_research_Solver_ClearLocalSearchState = + R"doc(Clears the local search state.)doc"; + +static const char* __doc_operations_research_Solver_ClearNeighbors = + R"doc(Manipulate neighbors count; to be used for testing purposes only. +TODO(user): Find a workaround to avoid exposing this.)doc"; + +static const char* __doc_operations_research_Solver_Compose = + R"doc(Creates a decision builder which sequentially composes decision +builders. At each leaf of a decision builder, the next decision +builder is therefore called. For instance, Compose(db1, db2) will +result in the following tree: d1 tree | / | \ | db1 leaves | / | \ | +db2 tree db2 tree db2 tree |)doc"; + +static const char* __doc_operations_research_Solver_Compose_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Compose_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Compose_4 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_ConcatenateOperators = + R"doc(Creates a local search operator which concatenates a vector of +operators. Each operator from the vector is called sequentially. By +default, when a neighbor is found the neighborhood exploration +restarts from the last active operator (the one which produced the +neighbor). This can be overridden by setting restart to true to force +the exploration to start from the first operator in the vector. + +The default behavior can also be overridden using an evaluation +callback to set the order in which the operators are explored (the +callback is called in LocalSearchOperator::Start()). The first +argument of the callback is the index of the operator which produced +the last move, the second argument is the index of the operator to be +evaluated. Ownership of the callback is taken by ConcatenateOperators. + +Example: + +const int kPriorities = {10, 100, 10, 0}; int64_t Evaluate(int +active_operator, int current_operator) { return +kPriorities[current_operator]; } + +LocalSearchOperator* concat = solver.ConcatenateOperators(operators, +NewPermanentCallback(&Evaluate)); + +The elements of the vector operators will be sorted by increasing +priority and explored in that order (tie-breaks are handled by keeping +the relative operator order in the vector). This would result in the +following order: operators[3], operators[0], operators[2], +operators[1].)doc"; + +static const char* __doc_operations_research_Solver_ConcatenateOperators_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_ConcatenateOperators_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_CurrentlyInSolve = + R"doc(Returns true whether the current search has been created using a +Solve() call instead of a NewSearch one. It returns false if the +solver is not in search at all.)doc"; + +static const char* __doc_operations_research_Solver_DebugString = + R"doc(misc debug string.)doc"; + +static const char* __doc_operations_research_Solver_DecisionModification = + R"doc(The Solver is responsible for creating the search tree. Thanks to the +DecisionBuilder, it creates a new decision with two branches at each +node: left and right. The DecisionModification enum is used to specify +how the branch selector should behave.)doc"; + +static const char* + __doc_operations_research_Solver_DecisionModification_KEEP_LEFT = + R"doc(Right branches are ignored. This is used to make the code faster when +backtrack makes no sense or is not useful. This is faster as there is +no need to create one new node per decision.)doc"; + +static const char* + __doc_operations_research_Solver_DecisionModification_KEEP_RIGHT = + R"doc(Left branches are ignored. This is used to make the code faster when +backtrack makes no sense or is not useful. This is faster as there is +no need to create one new node per decision.)doc"; + +static const char* + __doc_operations_research_Solver_DecisionModification_KILL_BOTH = + R"doc(Backtracks to the previous decisions, i.e. left and right branches are +not applied.)doc"; + +static const char* + __doc_operations_research_Solver_DecisionModification_NO_CHANGE = + R"doc(Keeps the default behavior, i.e. apply left branch first, and then +right branch in case of backtracking.)doc"; + +static const char* + __doc_operations_research_Solver_DecisionModification_SWITCH_BRANCHES = + R"doc(Applies right branch first. Left branch will be applied in case of +backtracking.)doc"; + +static const char* __doc_operations_research_Solver_DefaultSolverParameters = + R"doc(Create a ConstraintSolverParameters proto with all the default values.)doc"; + +static const char* __doc_operations_research_Solver_DemonPriority = + R"doc(This enum represents the three possible priorities for a demon in the +Solver queue. Note: this is for advanced users only.)doc"; + +static const char* + __doc_operations_research_Solver_DemonPriority_DELAYED_PRIORITY = + R"doc(DELAYED_PRIORITY is the lowest priority: Demons will be processed +after VAR_PRIORITY and NORMAL_PRIORITY demons.)doc"; + +static const char* + __doc_operations_research_Solver_DemonPriority_NORMAL_PRIORITY = + R"doc(NORMAL_PRIORITY is the highest priority: Demons will be processed +first.)doc"; + +static const char* __doc_operations_research_Solver_DemonPriority_VAR_PRIORITY = + R"doc(VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY.)doc"; + +static const char* __doc_operations_research_Solver_EndSearch = R"doc()doc"; + +static const char* __doc_operations_research_Solver_EnqueueAll = R"doc()doc"; + +static const char* __doc_operations_research_Solver_EnqueueDelayedDemon = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_EnqueueVar = R"doc()doc"; + +static const char* __doc_operations_research_Solver_EvaluatorLocalSearchOperators = + R"doc(This enum is used in Solver::MakeOperator associated with an evaluator +to specify the neighborhood to create.)doc"; + +static const char* + __doc_operations_research_Solver_EvaluatorLocalSearchOperators_LK = + R"doc(Lin-Kernighan local search. While the accumulated local gain is +positive, perform a 2opt or a 3opt move followed by a series of 2opt +moves. Return a neighbor for which the global gain is positive.)doc"; + +static const char* + __doc_operations_research_Solver_EvaluatorLocalSearchOperators_TSPLNS = + R"doc(TSP-base LNS. Randomly merge consecutive nodes until n "meta"-nodes +remain and solve the corresponding TSP. This is an "unlimited" +neighborhood which must be stopped by search limits. To force +diversification, the operator iteratively forces each node to serve as +base of a meta-node.)doc"; + +static const char* + __doc_operations_research_Solver_EvaluatorLocalSearchOperators_TSPOPT = + R"doc(Sliding TSP operator. Uses an exact dynamic programming algorithm to +solve the TSP corresponding to path sub-chains. For a subchain 1 -> 2 +-> 3 -> 4 -> 5 -> 6, solves the TSP on nodes A, 2, 3, 4, 5, where A is +a merger of nodes 1 and 6 such that cost(A,i) = cost(1,i) and +cost(i,A) = cost(i,6).)doc"; + +static const char* __doc_operations_research_Solver_EvaluatorStrategy = + R"doc(This enum is used by Solver::MakePhase to specify how to select +variables and values during the search. In Solver::MakePhase(const +std::vector&, IntVarStrategy, IntValueStrategy), variables +are selected first, and then the associated value. In +Solver::MakePhase(const std::vector& vars, IndexEvaluator2, +EvaluatorStrategy), the selection is done scanning every pair +. The next selected pair is then the best +among all possibilities, i.e. the pair with the smallest evaluation. +As this is costly, two options are offered: static or dynamic +evaluation.)doc"; + +static const char* + __doc_operations_research_Solver_EvaluatorStrategy_CHOOSE_DYNAMIC_GLOBAL_BEST = + R"doc(Pairs are compared each time a variable is selected. That way all +pairs are relevant and evaluation is accurate. This strategy runs in +O(number-of-pairs) at each variable selection, versus O(1) in the +static version.)doc"; + +static const char* + __doc_operations_research_Solver_EvaluatorStrategy_CHOOSE_STATIC_GLOBAL_BEST = + R"doc(Pairs are compared at the first call of the selector, and results are +cached. Next calls to the selector use the previous computation, and +so are not up-to-date, e.g. some pairs may not be +possible anymore due to propagation since the first to call.)doc"; + +static const char* __doc_operations_research_Solver_ExecuteAll = R"doc()doc"; + +static const char* __doc_operations_research_Solver_ExportProfilingOverview = + R"doc(Exports the profiling information in a human readable overview. The +parameter profile_level used to create the solver must be set to true.)doc"; + +static const char* __doc_operations_research_Solver_Fail = + R"doc(Abandon the current branch in the search tree. A backtrack will +follow.)doc"; + +static const char* __doc_operations_research_Solver_FinishCurrentSearch = + R"doc(Tells the solver to kill or restart the current search.)doc"; + +static const char* __doc_operations_research_Solver_FreezeQueue = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_GetConstraintSolverStatistics = + R"doc(Returns detailed cp search statistics.)doc"; + +static const char* __doc_operations_research_Solver_GetLocalSearchMonitor = + R"doc(Returns the local search monitor.)doc"; + +static const char* __doc_operations_research_Solver_GetLocalSearchStatistics = + R"doc(Returns detailed local search statistics.)doc"; + +static const char* __doc_operations_research_Solver_GetName = R"doc(Naming)doc"; + +static const char* __doc_operations_research_Solver_GetNewIntVarIndex = + R"doc(Variable indexing (note that indexing is not reversible). Returns a +new index for an IntVar.)doc"; + +static const char* + __doc_operations_research_Solver_GetOrCreateLocalSearchState = + R"doc(Returns (or creates) an assignment representing the state of local +search.)doc"; + +static const char* __doc_operations_research_Solver_GetPropagationMonitor = + R"doc(Returns the propagation monitor.)doc"; + +static const char* __doc_operations_research_Solver_HasName = + R"doc(Returns whether the object has been named or not.)doc"; + +static const char* __doc_operations_research_Solver_ImprovementSearchLimit = + R"doc(Limits the search based on the improvements of 'objective_var'. Stops +the search when the improvement rate gets lower than a threshold +value. This threshold value is computed based on the improvement rate +during the first phase of the search.)doc"; + +static const char* __doc_operations_research_Solver_IncrementNeighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_IncrementUncheckedSolutionCounter = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_Init = R"doc()doc"; + +static const char* __doc_operations_research_Solver_InitCachedConstraint = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InitCachedIntConstants = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InstrumentsDemons = + R"doc(Returns whether we are instrumenting demons.)doc"; + +static const char* __doc_operations_research_Solver_InstrumentsVariables = + R"doc(Returns whether we are tracing variables.)doc"; + +static const char* __doc_operations_research_Solver_IntValueStrategy = + R"doc(This enum describes the strategy used to select the next variable +value to set.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_ASSIGN_CENTER_VALUE = + R"doc(Selects the first possible value which is the closest to the center of +the domain of the selected variable. The center is defined as (min + +max) / 2.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_ASSIGN_MAX_VALUE = + R"doc(Selects the max value of the selected variable.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_ASSIGN_MIN_VALUE = + R"doc(Selects the min value of the selected variable.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_ASSIGN_RANDOM_VALUE = + R"doc(Selects randomly one of the possible values of the selected variable.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_INT_VALUE_DEFAULT = + R"doc(The default behavior is ASSIGN_MIN_VALUE.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_INT_VALUE_SIMPLE = + R"doc(The simple selection is ASSIGN_MIN_VALUE.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_SPLIT_LOWER_HALF = + R"doc(Split the domain in two around the center, and choose the lower part +first.)doc"; + +static const char* + __doc_operations_research_Solver_IntValueStrategy_SPLIT_UPPER_HALF = + R"doc(Split the domain in two around the center, and choose the lower part +first.)doc"; + +static const char* __doc_operations_research_Solver_IntVarStrategy = + R"doc(This enum describes the strategy used to select the next branching +variable at each node during the search.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_FIRST_UNBOUND = + R"doc(Select the first unbound variable. Variables are considered in the +order of the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_HIGHEST_MAX = + R"doc(Among unbound variables, select the variable with the highest maximal +value. In case of a tie, the first one is selected, first being +defined by the order in the vector of IntVars used to create the +selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_LOWEST_MIN = + R"doc(Among unbound variables, select the variable with the smallest minimal +value. In case of a tie, the first one is selected, "first" defined by +the order in the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MAX_REGRET_ON_MIN = + R"doc(Among unbound variables, select the variable with the largest gap +between the first and the second values of the domain.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MAX_SIZE = + R"doc(Among unbound variables, select the variable with the highest size. In +case of a tie, the first one is selected, first being defined by the +order in the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MIN_SIZE = + R"doc(Among unbound variables, select the variable with the smallest size. +In case of a tie, the first one is selected, first being defined by +the order in the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MIN_SIZE_HIGHEST_MAX = + R"doc(Among unbound variables, select the variable with the smallest size, +i.e., the smallest number of possible values. In case of a tie, the +selected variable is the one with the highest max value. In case of a +tie, the first one is selected, first being defined by the order in +the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MIN_SIZE_HIGHEST_MIN = + R"doc(Among unbound variables, select the variable with the smallest size, +i.e., the smallest number of possible values. In case of a tie, the +selected variable is the one with the highest min value. In case of a +tie, the first one is selected, first being defined by the order in +the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MIN_SIZE_LOWEST_MAX = + R"doc(Among unbound variables, select the variable with the smallest size, +i.e., the smallest number of possible values. In case of a tie, the +selected variables is the one with the lowest max value. In case of a +tie, the first one is selected, first being defined by the order in +the vector of IntVars used to create the selector.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_MIN_SIZE_LOWEST_MIN = + R"doc(Among unbound variables, select the variable with the smallest size, +i.e., the smallest number of possible values. In case of a tie, the +selected variables is the one with the lowest min value. In case of a +tie, the first one is selected, first being defined by the order in +the vector of IntVars used to create the selector.)doc"; + +static const char* __doc_operations_research_Solver_IntVarStrategy_CHOOSE_PATH = + R"doc(Selects the next unbound variable on a path, the path being defined by +the variables: var[i] corresponds to the index of the next of i.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_CHOOSE_RANDOM = + R"doc(Randomly select one of the remaining unbound variables.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_INT_VAR_DEFAULT = + R"doc(The default behavior is CHOOSE_FIRST_UNBOUND.)doc"; + +static const char* + __doc_operations_research_Solver_IntVarStrategy_INT_VAR_SIMPLE = + R"doc(The simple selection is CHOOSE_FIRST_UNBOUND.)doc"; + +static const char* __doc_operations_research_Solver_IntegerCastInfo = + R"doc(Holds semantic information stating that the 'expression' has been cast +into 'variable' using the Var() method, and that 'maintainer' is +responsible for maintaining the equality between 'variable' and +'expression'.)doc"; + +static const char* + __doc_operations_research_Solver_IntegerCastInfo_IntegerCastInfo = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_IntegerCastInfo_IntegerCastInfo_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_IntegerCastInfo_expression = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_IntegerCastInfo_maintainer = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_IntegerCastInfo_variable = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_6 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_InternalSaveValue_7 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_IntervalStrategy = + R"doc(This enum describes the straregy used to select the next interval +variable and its value to be fixed.)doc"; + +static const char* + __doc_operations_research_Solver_IntervalStrategy_INTERVAL_DEFAULT = + R"doc(The default is INTERVAL_SET_TIMES_FORWARD.)doc"; + +static const char* + __doc_operations_research_Solver_IntervalStrategy_INTERVAL_SET_TIMES_BACKWARD = + R"doc(Selects the variable with the highest ending time of all variables, +and fixes the ending time to this highest values.)doc"; + +static const char* + __doc_operations_research_Solver_IntervalStrategy_INTERVAL_SET_TIMES_FORWARD = + R"doc(Selects the variable with the lowest starting time of all variables, +and fixes its starting time to this lowest value.)doc"; + +static const char* + __doc_operations_research_Solver_IntervalStrategy_INTERVAL_SIMPLE = + R"doc(The simple is INTERVAL_SET_TIMES_FORWARD.)doc"; + +static const char* __doc_operations_research_Solver_IsADifference = + R"doc(Internal.)doc"; + +static const char* __doc_operations_research_Solver_IsBooleanVar = + R"doc(Returns true if expr represents either boolean_var or 1 - boolean_var. +In that case, it fills inner_var and is_negated to be true if the +expression is 1 - boolean_var -- equivalent to not(boolean_var).)doc"; + +static const char* + __doc_operations_research_Solver_IsLocalSearchProfilingEnabled = + R"doc(Returns whether we are profiling local search.)doc"; + +static const char* __doc_operations_research_Solver_IsProduct = + R"doc(Returns true if expr represents a product of a expr and a constant. In +that case, it fills inner_expr and coefficient with these, and returns +true. In the other case, it fills inner_expr with expr, coefficient +with 1, and returns false.)doc"; + +static const char* __doc_operations_research_Solver_IsProfilingEnabled = + R"doc(Returns whether we are profiling the solver.)doc"; + +static const char* + __doc_operations_research_Solver_IsUncheckedSolutionLimitReached = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_JumpToSentinel = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_JumpToSentinelWhenNested = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_LocalSearchFilterBound = + R"doc(This enum is used in Solver::MakeLocalSearchObjectiveFilter. It +specifies the behavior of the objective filter to create. The goal is +to define under which condition a move is accepted based on the +current objective value.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchFilterBound_EQ = + R"doc(Move is accepted when the current objective value is in the interval +objective.Min .. objective.Max.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchFilterBound_GE = + R"doc(Move is accepted when the current objective value >= objective.Min.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchFilterBound_LE = + R"doc(Move is accepted when the current objective value <= objective.Max.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchOperators = + R"doc(This enum is used in Solver::MakeOperator to specify the neighborhood +to create.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchOperators_CROSS = + R"doc(Operator which cross exchanges the starting chains of 2 paths, +including exchanging the whole paths. First and last nodes are not +moved. Possible neighbors for the paths 1 -> 2 -> 3 -> 4 -> 5 and 6 -> +7 -> 8 (where (1, 5) and (6, 8) are first and last nodes of the paths +and can therefore not be moved): 1 -> [7] -> 3 -> 4 -> 5 6 -> [2] -> 8 +1 -> [7] -> 4 -> 5 6 -> [2 -> 3] -> 8 1 -> [7] -> 5 6 -> [2 -> 3 -> 4] +-> 8)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_DECREMENT = + R"doc(Operator which defines a neighborhood to decrement values. The +behavior is the same as INCREMENT, except values are decremented +instead of incremented.)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_EXCHANGE = + R"doc(Operator which exchanges the positions of two nodes. Possible +neighbors for the path 1 -> 2 -> 3 -> 4 -> 5 (where (1, 5) are first +and last nodes of the path and can therefore not be moved): 1 -> [3] +-> [2] -> 4 -> 5 1 -> [4] -> 3 -> [2] -> 5 1 -> 2 -> [4] -> [3] -> 5)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_EXTENDEDSWAPACTIVE = + R"doc(Operator which makes an inactive node active and an active one +inactive. It is similar to SwapActiveOperator except that it tries to +insert the inactive node in all possible positions instead of just the +position of the node made inactive. Possible neighbors for the path 1 +-> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 are first and last nodes +of the path) are: 1 -> [5] -> 3 -> 4 with 2 inactive 1 -> 3 -> [5] -> +4 with 2 inactive 1 -> [5] -> 2 -> 4 with 3 inactive 1 -> 2 -> [5] -> +4 with 3 inactive)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_FULLPATHLNS = + R"doc(Operator which relaxes one entire path and all inactive nodes, thus +defining num_paths neighbors.)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_INCREMENT = + R"doc(Operator which defines one neighbor per variable. Each neighbor tries +to increment by one the value of the corresponding variable. When a +new solution is found the neighborhood is rebuilt from scratch, i.e., +tries to increment values in the variable order. Consider for instance +variables x and y. x is incremented one by one to its max, and when it +is not possible to increment x anymore, y is incremented once. If this +is a solution, then next neighbor tries to increment x.)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_MAKEACTIVE = + R"doc(Operator which inserts an inactive node into a path. Possible +neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 +are first and last nodes of the path) are: 1 -> [5] -> 2 -> 3 -> 4 1 +-> 2 -> [5] -> 3 -> 4 1 -> 2 -> 3 -> [5] -> 4)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_MAKECHAININACTIVE = + R"doc(Operator which makes a "chain" of path nodes inactive. Possible +neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first and +last nodes of the path) are: 1 -> 3 -> 4 with 2 inactive 1 -> 2 -> 4 +with 3 inactive 1 -> 4 with 2 and 3 inactive)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_MAKEINACTIVE = + R"doc(Operator which makes path nodes inactive. Possible neighbors for the +path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first and last nodes of the +path) are: 1 -> 3 -> 4 with 2 inactive 1 -> 2 -> 4 with 3 inactive)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchOperators_OROPT = + R"doc(Relocate: OROPT and RELOCATE. Operator which moves a sub-chain of a +path to another position; the specified chain length is the fixed +length of the chains being moved. When this length is 1, the operator +simply moves a node to another position. Possible neighbors for the +path 1 -> 2 -> 3 -> 4 -> 5, for a chain length of 2 (where (1, 5) are +first and last nodes of the path and can therefore not be moved): 1 -> +4 -> [2 -> 3] -> 5 1 -> [3 -> 4] -> 2 -> 5 + +Using Relocate with chain lengths of 1, 2 and 3 together is equivalent +to the OrOpt operator on a path. The OrOpt operator is a limited +version of 3Opt (breaks 3 arcs on a path).)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchOperators_PATHLNS = + R"doc(Operator which relaxes two sub-chains of three consecutive arcs each. +Each sub-chain is defined by a start node and the next three arcs. +Those six arcs are relaxed to build a new neighbor. PATHLNS explores +all possible pairs of starting nodes and so defines n^2 neighbors, n +being the number of nodes. Note that the two sub-chains can be part of +the same path; they even may overlap.)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_RELOCATE = + R"doc(Relocate neighborhood with length of 1 (see OROPT comment).)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_SIMPLELNS = + R"doc(Operator which defines one neighbor per variable. Each neighbor +relaxes one variable. When a new solution is found the neighborhood is +rebuilt from scratch. Consider for instance variables x and y. First x +is relaxed and the solver is looking for the best possible solution +(with only x relaxed). Then y is relaxed, and the solver is looking +for a new solution. If a new solution is found, then the next variable +to be relaxed is x.)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_SWAPACTIVE = + R"doc(Operator which replaces an active node by an inactive one. Possible +neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 +are first and last nodes of the path) are: 1 -> [5] -> 3 -> 4 with 2 +inactive 1 -> 2 -> [5] -> 4 with 3 inactive)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_TWOOPT = + R"doc(Operator which reverses a sub-chain of a path. It is called TwoOpt +because it breaks two arcs on the path; resulting paths are called +two-optimal. Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5 +(where (1, 5) are first and last nodes of the path and can therefore +not be moved): 1 -> [3 -> 2] -> 4 -> 5 1 -> [4 -> 3 -> 2] -> 5 1 -> 2 +-> [4 -> 3] -> 5)doc"; + +static const char* + __doc_operations_research_Solver_LocalSearchOperators_UNACTIVELNS = + R"doc(Operator which relaxes all inactive nodes and one sub-chain of six +consecutive arcs. That way the path can be improved by inserting +inactive nodes or swapping arcs.)doc"; + +static const char* __doc_operations_research_Solver_LocalSearchProfile = + R"doc(Returns local search profiling information in a human readable format.)doc"; + +static const char* __doc_operations_research_Solver_MakeAbs = R"doc(|expr|)doc"; + +static const char* __doc_operations_research_Solver_MakeAbsEquality = + R"doc(Creates the constraint abs(var) == abs_var.)doc"; + +static const char* __doc_operations_research_Solver_MakeAcceptFilter = + R"doc(Local Search Filters)doc"; + +static const char* __doc_operations_research_Solver_MakeActionDemon = + R"doc(Creates a demon from a callback.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllDifferent = + R"doc(All variables are pairwise different. This corresponds to the stronger +version of the propagation algorithm.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllDifferent_2 = + R"doc(All variables are pairwise different. If 'stronger_propagation' is +true, stronger, and potentially slower propagation will occur. This +API will be deprecated in the future.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllDifferentExcept = + R"doc(All variables are pairwise different, unless they are assigned to the +escape value.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllSolutionCollector = + R"doc(Collect all solutions of the search.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllSolutionCollector_2 = + R"doc(Collect all solutions of the search. The variables will need to be +added later.)doc"; + +static const char* __doc_operations_research_Solver_MakeAllowedAssignments = + R"doc(This method creates a constraint where the graph of the relation +between the variables is given in extension. There are 'arity' +variables involved in the relation and the graph is given by a integer +tuple set.)doc"; + +static const char* __doc_operations_research_Solver_MakeApplyBranchSelector = + R"doc(Creates a decision builder that will set the branch selector.)doc"; + +static const char* __doc_operations_research_Solver_MakeAssignVariableValue = + R"doc(Decisions.)doc"; + +static const char* + __doc_operations_research_Solver_MakeAssignVariableValueOrDoNothing = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeAssignVariableValueOrFail = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeAssignVariablesValues = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeAssignVariablesValuesOrDoNothing = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeAssignVariablesValuesOrFail = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeAssignment = + R"doc(This method creates an empty assignment.)doc"; + +static const char* __doc_operations_research_Solver_MakeAssignment_2 = + R"doc(This method creates an assignment which is a copy of 'a'.)doc"; + +static const char* __doc_operations_research_Solver_MakeAtMost = + R"doc(|{i | vars[i] == value}| <= max_count)doc"; + +static const char* __doc_operations_research_Solver_MakeAtSolutionCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeBestLexicographicValueSolutionCollector = + R"doc(Same as above, but supporting lexicographic objectives; 'maximize' +specifies the optimization direction for each objective in +'assignment'.)doc"; + +static const char* + __doc_operations_research_Solver_MakeBestLexicographicValueSolutionCollector_2 = + R"doc(Same as above, but supporting lexicographic objectives; 'maximize' +specifies the optimization direction for each objective.)doc"; + +static const char* + __doc_operations_research_Solver_MakeBestValueSolutionCollector = + R"doc(Collect the solution corresponding to the optimal value of the +objective of 'assignment'; if 'assignment' does not have an objective +no solution is collected. This collector only collects one solution +corresponding to the best objective value (the first one found).)doc"; + +static const char* + __doc_operations_research_Solver_MakeBestValueSolutionCollector_2 = + R"doc(Collect the solution corresponding to the optimal value of the +objective of the internal assignment; if this assignment does not have +an objective no solution is collected. This collector only collects +one solution corresponding to the best objective value (the first one +found). The variables and objective(s) will need to be added later.)doc"; + +static const char* __doc_operations_research_Solver_MakeBetweenCt = + R"doc((l <= expr <= u))doc"; + +static const char* __doc_operations_research_Solver_MakeBoolVar = + R"doc(MakeBoolVar will create a variable with a {0, 1} domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeBoolVar_2 = + R"doc(MakeBoolVar will create a variable with a {0, 1} domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeBoolVarArray = + R"doc(This method will append the vector vars with 'var_count' boolean +variables having name "name" where is the index of the +variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeBoolVarArray_2 = + R"doc(This method will append the vector vars with 'var_count' boolean +variables having no names.)doc"; + +static const char* __doc_operations_research_Solver_MakeBoolVarArray_3 = + R"doc(Same but allocates an array and returns it.)doc"; + +static const char* __doc_operations_research_Solver_MakeCircuit = + R"doc(Force the "nexts" variable to create a complete Hamiltonian path.)doc"; + +static const char* __doc_operations_research_Solver_MakeClosureDemon = + R"doc(!defined(SWIG) Creates a demon from a closure.)doc"; + +static const char* __doc_operations_research_Solver_MakeConditionalExpression = + R"doc(Conditional Expr condition ? expr : unperformed_value)doc"; + +static const char* __doc_operations_research_Solver_MakeConstantRestart = + R"doc(This search monitor will restart the search periodically after +'frequency' failures.)doc"; + +static const char* __doc_operations_research_Solver_MakeConstraintAdder = + R"doc(Returns a decision builder that will add the given constraint to the +model.)doc"; + +static const char* + __doc_operations_research_Solver_MakeConstraintInitialPropagateCallback = + R"doc(This method is a specialized case of the MakeConstraintDemon method to +call the InitiatePropagate of the constraint 'ct'.)doc"; + +static const char* __doc_operations_research_Solver_MakeConvexPiecewiseExpr = + R"doc(Convex piecewise function.)doc"; + +static const char* __doc_operations_research_Solver_MakeCount = + R"doc(|{i | vars[i] == value}| == max_count)doc"; + +static const char* __doc_operations_research_Solver_MakeCount_2 = + R"doc(|{i | vars[i] == value}| == max_count)doc"; + +static const char* __doc_operations_research_Solver_MakeCover = + R"doc(This constraint states that the target_var is the convex hull of the +intervals. If none of the interval variables is performed, then the +target var is unperformed too. Also, if the target variable is +unperformed, then all the intervals variables are unperformed too.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative = + R"doc(This constraint forces that, for any integer t, the sum of the demands +corresponding to an interval containing t does not exceed the given +capacity. + +Intervals and demands should be vectors of equal size. + +Demands should only contain non-negative values. Zero values are +supported, and the corresponding intervals are filtered out, as they +neither impact nor are impacted by this constraint.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative_2 = + R"doc(This constraint forces that, for any integer t, the sum of the demands +corresponding to an interval containing t does not exceed the given +capacity. + +Intervals and demands should be vectors of equal size. + +Demands should only contain non-negative values. Zero values are +supported, and the corresponding intervals are filtered out, as they +neither impact nor are impacted by this constraint.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative_3 = + R"doc(This constraint forces that, for any integer t, the sum of the demands +corresponding to an interval containing t does not exceed the given +capacity. + +Intervals and demands should be vectors of equal size. + +Demands should only contain non-negative values. Zero values are +supported, and the corresponding intervals are filtered out, as they +neither impact nor are impacted by this constraint.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative_4 = + R"doc(This constraint enforces that, for any integer t, the sum of the +demands corresponding to an interval containing t does not exceed the +given capacity. + +Intervals and demands should be vectors of equal size. + +Demands should only contain non-negative values. Zero values are +supported, and the corresponding intervals are filtered out, as they +neither impact nor are impacted by this constraint.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative_5 = + R"doc(This constraint enforces that, for any integer t, the sum of demands +corresponding to an interval containing t does not exceed the given +capacity. + +Intervals and demands should be vectors of equal size. + +Demands should be positive.)doc"; + +static const char* __doc_operations_research_Solver_MakeCumulative_6 = + R"doc(This constraint enforces that, for any integer t, the sum of demands +corresponding to an interval containing t does not exceed the given +capacity. + +Intervals and demands should be vectors of equal size. + +Demands should be positive.)doc"; + +static const char* __doc_operations_research_Solver_MakeDecision = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeDecisionBuilderFromAssignment = + R"doc(Returns a decision builder for which the left-most leaf corresponds to +assignment, the rest of the tree being explored using 'db'.)doc"; + +static const char* __doc_operations_research_Solver_MakeDefaultPhase = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeDefaultPhase_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeDefaultRegularLimitParameters = + R"doc(Creates a regular limit proto containing default values.)doc"; + +static const char* __doc_operations_research_Solver_MakeDefaultSolutionPool = + R"doc(Solution Pool.)doc"; + +static const char* + __doc_operations_research_Solver_MakeDelayedConstraintInitialPropagateCallback = + R"doc(This method is a specialized case of the MakeConstraintDemon method to +call the InitiatePropagate of the constraint 'ct' with low priority.)doc"; + +static const char* __doc_operations_research_Solver_MakeDelayedPathCumul = + R"doc(Delayed version of the same constraint: propagation on the nexts +variables is delayed until all constraints have propagated.)doc"; + +static const char* __doc_operations_research_Solver_MakeDeviation = + R"doc(Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var +and sum_i vars[i] == total_sum n = #vars)doc"; + +static const char* __doc_operations_research_Solver_MakeDifference = + R"doc(left - right)doc"; + +static const char* __doc_operations_research_Solver_MakeDifference_2 = + R"doc(value - expr)doc"; + +static const char* __doc_operations_research_Solver_MakeDisjunctiveConstraint = + R"doc(This constraint forces all interval vars into an non-overlapping +sequence. Intervals with zero duration can be scheduled anywhere.)doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute = + R"doc(Aggregated version of count: |{i | v[i] == values[j]}| == cards[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_2 = + R"doc(Aggregated version of count: |{i | v[i] == values[j]}| == cards[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_3 = + R"doc(Aggregated version of count: |{i | v[i] == j}| == cards[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_4 = + R"doc(Aggregated version of count with bounded cardinalities: forall j in 0 +.. card_size - 1: card_min <= |{i | v[i] == j}| <= card_max)doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_5 = + R"doc(Aggregated version of count with bounded cardinalities: forall j in 0 +.. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_6 = + R"doc(Aggregated version of count with bounded cardinalities: forall j in 0 +.. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_7 = + R"doc(Aggregated version of count with bounded cardinalities: forall j in 0 +.. card_size - 1: card_min[j] <= |{i | v[i] == values[j]}| <= +card_max[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDistribute_8 = + R"doc(Aggregated version of count with bounded cardinalities: forall j in 0 +.. card_size - 1: card_min[j] <= |{i | v[i] == values[j]}| <= +card_max[j])doc"; + +static const char* __doc_operations_research_Solver_MakeDiv = + R"doc(expr / value (integer division))doc"; + +static const char* __doc_operations_research_Solver_MakeDiv_2 = + R"doc(numerator / denominator (integer division). Terms need to be positive.)doc"; + +static const char* __doc_operations_research_Solver_MakeElement = + R"doc(values[index])doc"; + +static const char* __doc_operations_research_Solver_MakeElement_2 = + R"doc(values[index])doc"; + +static const char* __doc_operations_research_Solver_MakeElement_3 = + R"doc(Function-based element. The constraint takes ownership of the +callback. The callback must be able to cope with any possible value in +the domain of 'index' (potentially negative ones too).)doc"; + +static const char* __doc_operations_research_Solver_MakeElement_4 = + R"doc(2D version of function-based element expression, values(expr1, expr2).)doc"; + +static const char* __doc_operations_research_Solver_MakeElement_5 = + R"doc(vars[expr])doc"; + +static const char* __doc_operations_research_Solver_MakeElement_6 = + R"doc(vars(argument))doc"; + +static const char* __doc_operations_research_Solver_MakeElementEquality = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeElementEquality_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeElementEquality_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeElementEquality_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeEnterSearchCallback = + R"doc(----- Callback-based search monitors -----)doc"; + +static const char* __doc_operations_research_Solver_MakeEquality = + R"doc(left == right)doc"; + +static const char* __doc_operations_research_Solver_MakeEquality_2 = + R"doc(expr == value)doc"; + +static const char* __doc_operations_research_Solver_MakeEquality_3 = + R"doc(expr == value)doc"; + +static const char* __doc_operations_research_Solver_MakeEquality_4 = + R"doc(This constraints states that the two interval variables are equal.)doc"; + +static const char* __doc_operations_research_Solver_MakeExitSearchCallback = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeFailDecision = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeFalseConstraint = + R"doc(This constraint always fails.)doc"; + +static const char* __doc_operations_research_Solver_MakeFalseConstraint_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeFirstSolutionCollector = + R"doc(Collect the first solution of the search.)doc"; + +static const char* __doc_operations_research_Solver_MakeFirstSolutionCollector_2 = + R"doc(Collect the first solution of the search. The variables will need to +be added later.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationEndSyncedOnEndIntervalVar = + R"doc(Creates an interval var with a fixed duration whose end is +synchronized with the end of another interval, with a given offset. +The performed status is also in sync with the performed status of the +given interval variable.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationEndSyncedOnStartIntervalVar = + R"doc(Creates an interval var with a fixed duration whose end is +synchronized with the start of another interval, with a given offset. +The performed status is also in sync with the performed status of the +given interval variable.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVar = + R"doc(Creates an interval var with a fixed duration. The duration must be +greater than 0. If optional is true, then the interval can be +performed or unperformed. If optional is false, then the interval is +always performed.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVar_2 = + R"doc(Creates a performed interval var with a fixed duration. The duration +must be greater than 0.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVar_3 = + R"doc(Creates an interval var with a fixed duration, and performed_variable. +The duration must be greater than 0.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray = + R"doc(This method fills the vector with 'count' interval variables built +with the corresponding parameters.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray_2 = + R"doc(This method fills the vector with 'count' interval var built with the +corresponding start variables.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray_3 = + R"doc(This method fills the vector with interval variables built with the +corresponding start variables.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray_4 = + R"doc(This method fills the vector with interval variables built with the +corresponding start variables.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray_5 = + R"doc(This method fills the vector with interval variables built with the +corresponding start and performed variables.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationIntervalVarArray_6 = + R"doc(This method fills the vector with interval variables built with the +corresponding start and performed variables.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationStartSyncedOnEndIntervalVar = + R"doc(Creates an interval var with a fixed duration whose start is +synchronized with the end of another interval, with a given offset. +The performed status is also in sync with the performed status of the +given interval variable.)doc"; + +static const char* + __doc_operations_research_Solver_MakeFixedDurationStartSyncedOnStartIntervalVar = + R"doc(Creates an interval var with a fixed duration whose start is +synchronized with the start of another interval, with a given offset. +The performed status is also in sync with the performed status of the +given interval variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeFixedInterval = + R"doc(Creates a fixed and performed interval.)doc"; + +static const char* __doc_operations_research_Solver_MakeGenericTabuSearch = + R"doc(Creates a Tabu Search based on the vars |vars|. A solution is "tabu" +if all the vars in |vars| keep their value.)doc"; + +static const char* __doc_operations_research_Solver_MakeGreater = + R"doc(left > right)doc"; + +static const char* __doc_operations_research_Solver_MakeGreater_2 = + R"doc(expr > value)doc"; + +static const char* __doc_operations_research_Solver_MakeGreater_3 = + R"doc(expr > value)doc"; + +static const char* __doc_operations_research_Solver_MakeGreaterOrEqual = + R"doc(left >= right)doc"; + +static const char* __doc_operations_research_Solver_MakeGreaterOrEqual_2 = + R"doc(expr >= value)doc"; + +static const char* __doc_operations_research_Solver_MakeGreaterOrEqual_3 = + R"doc(expr >= value)doc"; + +static const char* __doc_operations_research_Solver_MakeGuidedLocalSearch = + R"doc(Creates a Guided Local Search monitor. Description here: +http://en.wikipedia.org/wiki/Guided_Local_Search)doc"; + +static const char* __doc_operations_research_Solver_MakeGuidedLocalSearch_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeIfThenElseCt = + R"doc(Special cases with arrays of size two.)doc"; + +static const char* __doc_operations_research_Solver_MakeIndexExpression = + R"doc(Returns the expression expr such that vars[expr] == value. It assumes +that vars are all different.)doc"; + +static const char* __doc_operations_research_Solver_MakeIndexOfConstraint = + R"doc(This constraint is a special case of the element constraint with an +array of integer variables, where the variables are all different and +the index variable is constrained such that vars[index] == target.)doc"; + +static const char* + __doc_operations_research_Solver_MakeIndexOfFirstMaxValueConstraint = + R"doc(Creates a constraint that binds the index variable to the index of the +first variable with the maximum value.)doc"; + +static const char* + __doc_operations_research_Solver_MakeIndexOfFirstMinValueConstraint = + R"doc(Creates a constraint that binds the index variable to the index of the +first variable with the minimum value.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntConst = + R"doc(IntConst will create a constant expression.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntConst_2 = + R"doc(IntConst will create a constant expression.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar = + R"doc(MakeIntVar will create the best range based int var for the bounds +given.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar_2 = + R"doc(MakeIntVar will create a variable with the given sparse domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar_3 = + R"doc(MakeIntVar will create a variable with the given sparse domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar_4 = + R"doc(MakeIntVar will create the best range based int var for the bounds +given.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar_5 = + R"doc(MakeIntVar will create a variable with the given sparse domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVar_6 = + R"doc(MakeIntVar will create a variable with the given sparse domain.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVarArray = + R"doc(This method will append the vector vars with 'var_count' variables +having bounds vmin and vmax and having name "name" where is the +index of the variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVarArray_2 = + R"doc(This method will append the vector vars with 'var_count' variables +having bounds vmin and vmax and having no names.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntVarArray_3 = + R"doc(Same but allocates an array and returns it.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalRelaxedMax = + R"doc(Creates and returns an interval variable that wraps around the given +one, relaxing the max start and end. Relaxing means making unbounded +when optional. If the variable is non optional, this method returns +interval_var. + +More precisely, such an interval variable behaves as follows: * When +the underlying must be performed, the returned interval variable +behaves exactly as the underlying; * When the underlying may or may +not be performed, the returned interval variable behaves like the +underlying, except that it is unbounded on the max side; * When the +underlying cannot be performed, the returned interval variable is of +duration 0 and must be performed in an interval unbounded on both +sides. + +This is very useful for implementing propagators that may only modify +the start min or end min.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalRelaxedMin = + R"doc(Creates and returns an interval variable that wraps around the given +one, relaxing the min start and end. Relaxing means making unbounded +when optional. If the variable is non-optional, this method returns +interval_var. + +More precisely, such an interval variable behaves as follows: * When +the underlying must be performed, the returned interval variable +behaves exactly as the underlying; * When the underlying may or may +not be performed, the returned interval variable behaves like the +underlying, except that it is unbounded on the min side; * When the +underlying cannot be performed, the returned interval variable is of +duration 0 and must be performed in an interval unbounded on both +sides. + +This is very useful to implement propagators that may only modify the +start max or end max.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalVar = + R"doc(Creates an interval var by specifying the bounds on start, duration, +and end.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalVarArray = + R"doc(This method fills the vector with 'count' interval var built with the +corresponding parameters.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalVarRelation = + R"doc(This method creates a relation between an interval var and a date.)doc"; + +static const char* __doc_operations_research_Solver_MakeIntervalVarRelation_2 = + R"doc(This method creates a relation between two interval vars.)doc"; + +static const char* + __doc_operations_research_Solver_MakeIntervalVarRelationWithDelay = + R"doc(This method creates a relation between two interval vars. The given +delay is added to the second interval. i.e.: t1 STARTS_AFTER_END of t2 +with a delay of 2 means t1 will start at least two units of time after +the end of t2.)doc"; + +static const char* + __doc_operations_research_Solver_MakeInversePermutationConstraint = + R"doc(Creates a constraint that enforces that 'left' and 'right' both +represent permutations of [0..left.size()-1], and that 'right' is the +inverse permutation of 'left', i.e. for all i in [0..left.size()-1], +right[left[i]] = i.)doc"; + +static const char* __doc_operations_research_Solver_MakeIsBetweenCt = + R"doc(b == (l <= expr <= u))doc"; + +static const char* __doc_operations_research_Solver_MakeIsBetweenVar = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeIsDifferentCstCt = + R"doc(boolvar == (var != value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsDifferentCstVar = + R"doc(status var of (var != value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsDifferentCt = + R"doc(b == (v1 != v2))doc"; + +static const char* __doc_operations_research_Solver_MakeIsDifferentVar = + R"doc(status var of (v1 != v2))doc"; + +static const char* __doc_operations_research_Solver_MakeIsEqualCstCt = + R"doc(boolvar == (var == value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsEqualCstVar = + R"doc(status var of (var == value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsEqualCt = + R"doc(b == (v1 == v2))doc"; + +static const char* __doc_operations_research_Solver_MakeIsEqualVar = + R"doc(status var of (v1 == v2))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterCstCt = + R"doc(b == (v > c))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterCstVar = + R"doc(status var of (var > value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterCt = + R"doc(b == (left > right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterOrEqualCstCt = + R"doc(boolvar == (var >= value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterOrEqualCstVar = + R"doc(status var of (var >= value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterOrEqualCt = + R"doc(b == (left >= right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterOrEqualVar = + R"doc(status var of (left >= right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsGreaterVar = + R"doc(status var of (left > right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessCstCt = + R"doc(b == (v < c))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessCstVar = + R"doc(status var of (var < value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessCt = + R"doc(b == (left < right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessOrEqualCstCt = + R"doc(boolvar == (var <= value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessOrEqualCstVar = + R"doc(status var of (var <= value))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessOrEqualCt = + R"doc(b == (left <= right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessOrEqualVar = + R"doc(status var of (left <= right))doc"; + +static const char* __doc_operations_research_Solver_MakeIsLessVar = + R"doc(status var of (left < right))doc"; + +static const char* + __doc_operations_research_Solver_MakeIsLexicalLessOrEqualWithOffsetsCt = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeIsMemberCt = + R"doc(boolvar == (expr in set))doc"; + +static const char* __doc_operations_research_Solver_MakeIsMemberCt_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeIsMemberVar = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeIsMemberVar_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeLastSolutionCollector = + R"doc(Collect the last solution of the search.)doc"; + +static const char* __doc_operations_research_Solver_MakeLastSolutionCollector_2 = + R"doc(Collect the last solution of the search. The variables will need to be +added later.)doc"; + +static const char* __doc_operations_research_Solver_MakeLess = + R"doc(left < right)doc"; + +static const char* __doc_operations_research_Solver_MakeLess_2 = + R"doc(expr < value)doc"; + +static const char* __doc_operations_research_Solver_MakeLess_3 = + R"doc(expr < value)doc"; + +static const char* __doc_operations_research_Solver_MakeLessOrEqual = + R"doc(left <= right)doc"; + +static const char* __doc_operations_research_Solver_MakeLessOrEqual_2 = + R"doc(expr <= value)doc"; + +static const char* __doc_operations_research_Solver_MakeLessOrEqual_3 = + R"doc(expr <= value)doc"; + +static const char* __doc_operations_research_Solver_MakeLexicalLess = + R"doc(Creates a constraint that enforces that left is lexicographically less +than right.)doc"; + +static const char* __doc_operations_research_Solver_MakeLexicalLessOrEqual = + R"doc(Creates a constraint that enforces that left is lexicographically less +than or equal to right.)doc"; + +static const char* + __doc_operations_research_Solver_MakeLexicalLessOrEqualWithOffsets = + R"doc(Creates a constraint that enforces that left is lexicographically less +than or equal to right with an offset. This means that for the first +index i such that left[i] is not in [right[i] - (offset[i] - 1), +right[i]], left[i] + offset[i] <= right[i]. Offset values must be > 0.)doc"; + +static const char* __doc_operations_research_Solver_MakeLexicographicOptimize = + R"doc(Creates a lexicographic objective, following the order of the +variables given. Each variable has a corresponding optimization +direction and step.)doc"; + +static const char* + __doc_operations_research_Solver_MakeLexicographicSimulatedAnnealing = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLexicographicTabuSearch = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeLightElement = + R"doc(Returns a light one-dimension function-based element constraint +ensuring var == values(index). The constraint does not perform bound +reduction of the resulting variable until the index variable is bound. +If deep_serialize returns false, the model visitor will not extract +all possible values from the values function.)doc"; + +static const char* __doc_operations_research_Solver_MakeLightElement_2 = + R"doc(Light two-dimension function-based element constraint ensuring var == +values(index1, index2). The constraint does not perform bound +reduction of the resulting variable until the index variables are +bound. If deep_serialize returns false, the model visitor will not +extract all possible values from the values function.)doc"; + +static const char* __doc_operations_research_Solver_MakeLocalSearchPhase = + R"doc(Local Search decision builders factories. Local search is used to +improve a given solution. This initial solution can be specified +either by an Assignment or by a DecisionBulder, and the corresponding +variables, the initial solution being the first solution found by the +DecisionBuilder. The LocalSearchPhaseParameters parameter holds the +actual definition of the local search phase: - a local search operator +used to explore the neighborhood of the current solution, - a decision +builder to instantiate unbound variables once a neighbor has been +defined; in the case of LNS-based operators instantiates fragment +variables; search monitors can be added to this sub-search by wrapping +the decision builder with MakeSolveOnce. - a search limit specifying +how long local search looks for neighbors before accepting one; the +last neighbor is always taken and in the case of a greedy search, this +corresponds to the best local neighbor; first-accept (which is the +default behavior) can be modeled using a solution found limit of 1, - +a vector of local search filters used to speed up the search by +pruning unfeasible neighbors. Metaheuristics can be added by defining +specialized search monitors; currently down/up-hill climbing is +available through OptimizeVar, as well as Guided Local Search, Tabu +Search and Simulated Annealing.)doc"; + +static const char* __doc_operations_research_Solver_MakeLocalSearchPhase_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeLocalSearchPhase_3 = + R"doc(Variant with a sub_decison_builder specific to the first solution.)doc"; + +static const char* __doc_operations_research_Solver_MakeLocalSearchPhase_4 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters = + R"doc(Local Search Phase Parameters)doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters_3 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters_4 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters_5 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeLocalSearchPhaseParameters_6 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeLubyRestart = + R"doc(This search monitor will restart the search periodically. At the +iteration n, it will restart after scale_factor * Luby(n) failures +where Luby is the Luby Strategy (i.e. 1 1 2 1 1 2 4 1 1 2 1 1 2 4 +8...).)doc"; + +static const char* __doc_operations_research_Solver_MakeMapDomain = + R"doc(This constraint maps the domain of 'var' onto the array of variables +'actives'. That is for all i in [0 .. size - 1]: actives[i] == 1 <=> +var->Contains(i);)doc"; + +static const char* __doc_operations_research_Solver_MakeMax = + R"doc(std::max(vars))doc"; + +static const char* __doc_operations_research_Solver_MakeMax_2 = + R"doc(std::max(left, right))doc"; + +static const char* __doc_operations_research_Solver_MakeMax_3 = + R"doc(std::max(expr, value))doc"; + +static const char* __doc_operations_research_Solver_MakeMax_4 = + R"doc(std::max(expr, value))doc"; + +static const char* __doc_operations_research_Solver_MakeMaxEquality = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeMaximize = + R"doc(Creates a maximization objective.)doc"; + +static const char* __doc_operations_research_Solver_MakeMemberCt = + R"doc(expr in set. Propagation is lazy, i.e. this constraint does not +creates holes in the domain of the variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeMemberCt_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeMin = + R"doc(std::min(vars))doc"; + +static const char* __doc_operations_research_Solver_MakeMin_2 = + R"doc(std::min (left, right))doc"; + +static const char* __doc_operations_research_Solver_MakeMin_3 = + R"doc(std::min(expr, value))doc"; + +static const char* __doc_operations_research_Solver_MakeMin_4 = + R"doc(std::min(expr, value))doc"; + +static const char* __doc_operations_research_Solver_MakeMinEquality = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeMinimize = + R"doc(Creates a minimization objective.)doc"; + +static const char* __doc_operations_research_Solver_MakeMirrorInterval = + R"doc(Creates an interval var that is the mirror image of the given one, +that is, the interval var obtained by reversing the axis.)doc"; + +static const char* __doc_operations_research_Solver_MakeModulo = + R"doc(Modulo expression x % mod (with the python convention for modulo).)doc"; + +static const char* __doc_operations_research_Solver_MakeModulo_2 = + R"doc(Modulo expression x % mod (with the python convention for modulo).)doc"; + +static const char* __doc_operations_research_Solver_MakeMonotonicElement = + R"doc(Function based element. The constraint takes ownership of the +callback. The callback must be monotonic. It must be able to cope with +any possible value in the domain of 'index' (potentially negative ones +too). Furtermore, monotonicity is not checked. Thus giving a non- +monotonic function, or specifying an incorrect increasing parameter +will result in undefined behavior.)doc"; + +static const char* __doc_operations_research_Solver_MakeMoveTowardTargetOperator = + R"doc(Creates a local search operator that tries to move the assignment of +some variables toward a target. The target is given as an Assignment. +This operator generates neighbors in which the only difference +compared to the current state is that one variable that belongs to the +target assignment is set to its target value.)doc"; + +static const char* + __doc_operations_research_Solver_MakeMoveTowardTargetOperator_2 = + R"doc(Creates a local search operator that tries to move the assignment of +some variables toward a target. The target is given either as two +vectors: a vector of variables and a vector of associated target +values. The two vectors should be of the same length. This operator +generates neighbors in which the only difference compared to the +current state is that one variable that belongs to the given vector is +set to its target value.)doc"; + +static const char* + __doc_operations_research_Solver_MakeNBestLexicographicValueSolutionCollector = + R"doc(Same as above but supporting lexicographic objectives; 'maximize' +specifies the optimization direction for each objective.)doc"; + +static const char* + __doc_operations_research_Solver_MakeNBestLexicographicValueSolutionCollector_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeNBestValueSolutionCollector = + R"doc(Same as MakeBestValueSolutionCollector but collects the best +solution_count solutions. Collected solutions are sorted in increasing +optimality order (the best solution is the last one).)doc"; + +static const char* + __doc_operations_research_Solver_MakeNBestValueSolutionCollector_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNeighborhoodLimit = + R"doc(Creates a local search operator that wraps another local search +operator and limits the number of neighbors explored (i.e., calls to +MakeNextNeighbor from the current solution (between two calls to +Start()). When this limit is reached, MakeNextNeighbor() returns +false. The counter is cleared when Start() is called.)doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize = + R"doc(NestedOptimize will collapse a search tree described by a decision +builder 'db' and a set of monitors and wrap it into a single point. If +there are no solutions to this nested tree, then NestedOptimize will +fail. If there are solutions, it will find the best as described by +the mandatory objective in the solution as well as the optimization +direction, instantiate all variables to this solution, and return +nullptr.)doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNestedOptimize_6 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNoCycle = + R"doc(Prevent cycles. The "nexts" variables represent the next in the chain. +"active" variables indicate if the corresponding next variable is +active; this could be useful to model unperformed nodes in a routing +problem. A callback can be added to specify sink values (by default +sink values are values >= vars.size()). Ownership of the callback is +passed to the constraint. If assume_paths is either not specified or +true, the constraint assumes the "nexts" variables represent paths +(and performs a faster propagation); otherwise the constraint assumes +they represent a forest.)doc"; + +static const char* __doc_operations_research_Solver_MakeNoCycle_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNonEquality = + R"doc(left != right)doc"; + +static const char* __doc_operations_research_Solver_MakeNonEquality_2 = + R"doc(expr != value)doc"; + +static const char* __doc_operations_research_Solver_MakeNonEquality_3 = + R"doc(expr != value)doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingBoxesConstraint = + R"doc(This constraint states that all the boxes must not overlap. The +coordinates of box i are: (x_vars[i], y_vars[i]), (x_vars[i], +y_vars[i] + y_size[i]), (x_vars[i] + x_size[i], y_vars[i]), (x_vars[i] ++ x_size[i], y_vars[i] + y_size[i]). The sizes must be non-negative. +Boxes with a zero dimension can be pushed like any box.)doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingBoxesConstraint_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingBoxesConstraint_3 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingNonStrictBoxesConstraint = + R"doc(This constraint states that all the boxes must not overlap. The +coordinates of box i are: (x_vars[i], y_vars[i]), (x_vars[i], +y_vars[i] + y_size[i]), (x_vars[i] + x_size[i], y_vars[i]), (x_vars[i] ++ x_size[i], y_vars[i] + y_size[i]). The sizes must be positive. Boxes +with a zero dimension can be placed anywhere.)doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingNonStrictBoxesConstraint_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeNonOverlappingNonStrictBoxesConstraint_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNotBetweenCt = + R"doc((expr < l || expr > u) This constraint is lazy as it will not make +holes in the domain of variables. It will propagate only when +expr->Min() >= l or expr->Max() <= u.)doc"; + +static const char* __doc_operations_research_Solver_MakeNotMemberCt = + R"doc(expr not in set.)doc"; + +static const char* __doc_operations_research_Solver_MakeNotMemberCt_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeNotMemberCt_3 = + R"doc(expr should not be in the list of forbidden intervals +[start[i]..end[i]].)doc"; + +static const char* __doc_operations_research_Solver_MakeNotMemberCt_4 = + R"doc(expr should not be in the list of forbidden intervals +[start[i]..end[i]].)doc"; + +static const char* __doc_operations_research_Solver_MakeNotMemberCt_5 = + R"doc(expr should not be in the list of forbidden intervals.)doc"; + +static const char* __doc_operations_research_Solver_MakeNullIntersect = + R"doc(Creates a constraint that states that all variables in the first +vector are different from all variables in the second group. Thus the +set of values in the first vector does not intersect with the set of +values in the second vector.)doc"; + +static const char* __doc_operations_research_Solver_MakeNullIntersectExcept = + R"doc(Creates a constraint that states that all variables in the first +vector are different from all variables from the second group, unless +they are assigned to the escape value. Thus the set of values in the +first vector minus the escape value does not intersect with the set of +values in the second vector.)doc"; + +static const char* __doc_operations_research_Solver_MakeOperator = + R"doc(Local Search Operators.)doc"; + +static const char* __doc_operations_research_Solver_MakeOperator_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeOperator_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeOperator_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeOpposite = + R"doc(-expr)doc"; + +static const char* __doc_operations_research_Solver_MakeOptimize = + R"doc(Creates a objective with a given sense (true = maximization).)doc"; + +static const char* __doc_operations_research_Solver_MakePack = + R"doc(This constraint packs all variables onto 'number_of_bins' variables. +For any given variable, a value of 'number_of_bins' indicates that the +variable is not assigned to any bin. Dimensions, i.e., cumulative +constraints on this packing, can be added directly from the pack +class.)doc"; + +static const char* __doc_operations_research_Solver_MakePathConnected = + R"doc(Check whether more propagation is needed.)doc"; + +static const char* __doc_operations_research_Solver_MakePathCumul = + R"doc(Creates a constraint which accumulates values along a path such that: +cumuls[next[i]] = cumuls[i] + transits[i]. Active variables indicate +if the corresponding next variable is active; this could be useful to +model unperformed nodes in a routing problem.)doc"; + +static const char* __doc_operations_research_Solver_MakePathCumul_2 = + R"doc(Creates a constraint which accumulates values along a path such that: +cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]). Active +variables indicate if the corresponding next variable is active; this +could be useful to model unperformed nodes in a routing problem. +Ownership of transit_evaluator is taken and it must be a repeatable +callback.)doc"; + +static const char* __doc_operations_research_Solver_MakePathCumul_3 = + R"doc(Creates a constraint which accumulates values along a path such that: +cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]) + +slacks[i]. Active variables indicate if the corresponding next +variable is active; this could be useful to model unperformed nodes in +a routing problem. Ownership of transit_evaluator is taken and it must +be a repeatable callback.)doc"; + +static const char* + __doc_operations_research_Solver_MakePathEnergyCostConstraint = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakePathPrecedenceConstraint = + R"doc(the implementation can easily be modified to do that; evaluate the +impact on models solved with local search.)doc"; + +static const char* + __doc_operations_research_Solver_MakePathPrecedenceConstraint_2 = + R"doc(Same as MakePathPrecedenceConstraint but ensures precedence pairs on +some paths follow a LIFO or FIFO order. LIFO order: given 2 pairs +(a,b) and (c,d), if a is before c on the path then d must be before b +or b must be before c. FIFO order: given 2 pairs (a,b) and (c,d), if a +is before c on the path then b must be before d. LIFO (resp. FIFO) +orders are enforced only on paths starting by indices in +lifo_path_starts (resp. fifo_path_start).)doc"; + +static const char* + __doc_operations_research_Solver_MakePathTransitPrecedenceConstraint = + R"doc(Same as MakePathPrecedenceConstraint but will force i to be before j +if the sum of transits on the path from i to j is strictly positive.)doc"; + +static const char* __doc_operations_research_Solver_MakePhase = + R"doc(for all other functions that have several homonyms in this .h).)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_4 = + R"doc(var_val1_val2_comparator(var, val1, val2) is true iff assigning value +"val1" to variable "var" is better than assigning value "val2".)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_5 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_6 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_7 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_8 = + R"doc(Shortcuts for small arrays.)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_9 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_10 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_11 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePhase_12 = + R"doc(Returns a decision builder which assigns values to variables which +minimize the values returned by the evaluator. The arguments passed to +the evaluator callback are the indices of the variables in vars and +the values of these variables. Ownership of the callback is passed to +the decision builder.)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_13 = + R"doc(Returns a decision builder which assigns values to variables which +minimize the values returned by the evaluator. In case of tie breaks, +the second callback is used to choose the best index in the array of +equivalent pairs with equivalent evaluations. The arguments passed to +the evaluator callback are the indices of the variables in vars and +the values of these variables. Ownership of the callback is passed to +the decision builder.)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_14 = + R"doc(Scheduling phases.)doc"; + +static const char* __doc_operations_research_Solver_MakePhase_15 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePiecewiseLinearExpr = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakePower = + R"doc(expr ^ n (n > 0))doc"; + +static const char* __doc_operations_research_Solver_MakePrintModelVisitor = + R"doc(Prints the model.)doc"; + +static const char* __doc_operations_research_Solver_MakeProd = + R"doc(left * right)doc"; + +static const char* __doc_operations_research_Solver_MakeProd_2 = + R"doc(expr * value)doc"; + +static const char* + __doc_operations_research_Solver_MakeProfiledDecisionBuilderWrapper = + R"doc(Activates profiling on a decision builder.)doc"; + +static const char* __doc_operations_research_Solver_MakeRandomLnsOperator = + R"doc(Creates a large neighborhood search operator which creates fragments +(set of relaxed variables) with up to number_of_variables random +variables (sampling with replacement is performed meaning that at most +number_of_variables variables are selected). Warning: this operator +will always return neighbors; using it without a search limit will +result in a non-ending search. Optionally a random seed can be +specified.)doc"; + +static const char* __doc_operations_research_Solver_MakeRandomLnsOperator_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeRankFirstInterval = + R"doc(Returns a decision that tries to rank first the ith interval var in +the sequence variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeRankLastInterval = + R"doc(Returns a decision that tries to rank last the ith interval var in the +sequence variable.)doc"; + +static const char* __doc_operations_research_Solver_MakeRejectFilter = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeRestoreAssignment = + R"doc(Returns a DecisionBuilder which restores an Assignment (calls void +Assignment::Restore()))doc"; + +static const char* __doc_operations_research_Solver_MakeScalProd = + R"doc(scalar product)doc"; + +static const char* __doc_operations_research_Solver_MakeScalProd_2 = + R"doc(scalar product)doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdEquality = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdEquality_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdEquality_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdEquality_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdGreaterOrEqual = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeScalProdGreaterOrEqual_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdLessOrEqual = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScalProdLessOrEqual_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeScheduleOrExpedite = + R"doc(Returns a decision that tries to schedule a task at a given time. On +the Apply branch, it will set that interval var as performed and set +its end to 'est'. On the Refute branch, it will just update the +'marker' to 'est' - 1. This decision is used in the +INTERVAL_SET_TIMES_BACKWARD strategy.)doc"; + +static const char* __doc_operations_research_Solver_MakeScheduleOrPostpone = + R"doc(Returns a decision that tries to schedule a task at a given time. On +the Apply branch, it will set that interval var as performed and set +its start to 'est'. On the Refute branch, it will just update the +'marker' to 'est' + 1. This decision is used in the +INTERVAL_SET_TIMES_FORWARD strategy.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog = + R"doc(The SearchMonitors below will display a periodic search log on +LOG(INFO) every branch_period branches explored.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_2 = + R"doc(At each solution, this monitor also display the var value.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_3 = + R"doc(At each solution, this monitor will also display result of @p +display_callback.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_4 = + R"doc(At each solution, this monitor will display the 'var' value and the +result of @p display_callback.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_5 = + R"doc(At each solution, this monitor will display the 'vars' values and the +result of @p display_callback.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_6 = + R"doc(OptimizeVar Search Logs At each solution, this monitor will also +display the 'opt_var' value.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_7 = + R"doc(Creates a search monitor that will also print the result of the +display callback.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchLog_8 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSearchProgressBar = + R"doc(Creates a search monitor tracking the progress of the search in a +progress bar. If a search limit is specified in the search, the bar +shows the progress percentage before reaching the limit. If no limit +is specified, an activity bar is displayed.)doc"; + +static const char* __doc_operations_research_Solver_MakeSearchTrace = + R"doc(Creates a search monitor that will trace precisely the behavior of the +search. Use this only for low level debugging.)doc"; + +static const char* __doc_operations_research_Solver_MakeSemiContinuousExpr = + R"doc(Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + +b) a >= 0 and b >= 0)doc"; + +static const char* __doc_operations_research_Solver_MakeSimulatedAnnealing = + R"doc(Creates a Simulated Annealing monitor.)doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce = + R"doc(SolveOnce will collapse a search tree described by a decision builder +'db' and a set of monitors and wrap it into a single point. If there +are no solutions to this nested tree, then SolveOnce will fail. If +there is a solution, it will find it and returns nullptr.)doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSolveOnce_6 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSortingConstraint = + R"doc(Creates a constraint binding the arrays of variables "vars" and +"sorted_vars": sorted_vars[0] must be equal to the minimum of all +variables in vars, and so on: the value of sorted_vars[i] must be +equal to the i-th value of variables invars. + +This constraint propagates in both directions: from "vars" to +"sorted_vars" and vice-versa. + +Behind the scenes, this constraint maintains that: - sorted is always +increasing. - whatever the values of vars, there exists a permutation +that injects its values into the sorted variables. + +For more info, please have a look at: https://mpi- +inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Thiel.pdf)doc"; + +static const char* __doc_operations_research_Solver_MakeSplitVariableDomain = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSquare = + R"doc(expr * expr)doc"; + +static const char* __doc_operations_research_Solver_MakeStatisticsModelVisitor = + R"doc(Displays some nice statistics on the model.)doc"; + +static const char* __doc_operations_research_Solver_MakeStoreAssignment = + R"doc(Returns a DecisionBuilder which stores an Assignment (calls void +Assignment::Store()))doc"; + +static const char* + __doc_operations_research_Solver_MakeStrictDisjunctiveConstraint = + R"doc(This constraint forces all interval vars into an non-overlapping +sequence. Intervals with zero durations cannot overlap with over +intervals.)doc"; + +static const char* __doc_operations_research_Solver_MakeSubCircuit = + R"doc(Force the "nexts" variable to create a complete Hamiltonian path for +those that do not loop upon themselves.)doc"; + +static const char* __doc_operations_research_Solver_MakeSum = + R"doc(left + right.)doc"; + +static const char* __doc_operations_research_Solver_MakeSum_2 = + R"doc(expr + value.)doc"; + +static const char* __doc_operations_research_Solver_MakeSum_3 = + R"doc(sum of all vars.)doc"; + +static const char* __doc_operations_research_Solver_MakeSumEquality = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSumEquality_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSumGreaterOrEqual = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSumLessOrEqual = + R"doc(Variation on arrays.)doc"; + +static const char* __doc_operations_research_Solver_MakeSumObjectiveFilter = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSumObjectiveFilter_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSymmetryManager = + R"doc(Symmetry Breaking.)doc"; + +static const char* __doc_operations_research_Solver_MakeSymmetryManager_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSymmetryManager_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSymmetryManager_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeSymmetryManager_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeTabuSearch = + R"doc(Creates a Tabu Search monitor. In the context of local search the +behavior is similar to MakeOptimize(), creating an objective in a +given sense. The behavior differs once a local optimum is reached: +thereafter solutions which degrade the value of the objective are +allowed if they are not "tabu". A solution is "tabu" if it doesn't +respect the following rules: - improving the best solution found so +far - variables in the "keep" list must keep their value, variables in +the "forbid" list must not take the value they have in the list. +Variables with new values enter the tabu lists after each new solution +found and leave the lists after a given number of iterations (called +tenure). Only the variables passed to the method can enter the lists. +The tabu criterion is softened by the tabu factor which gives the +number of "tabu" violations which is tolerated; a factor of 1 means no +violations allowed; a factor of 0 means all violations are allowed.)doc"; + +static const char* __doc_operations_research_Solver_MakeTemporalDisjunction = + R"doc(This constraint implements a temporal disjunction between two interval +vars t1 and t2. 'alt' indicates which alternative was chosen (alt == 0 +is equivalent to t1 before t2).)doc"; + +static const char* __doc_operations_research_Solver_MakeTemporalDisjunction_2 = + R"doc(This constraint implements a temporal disjunction between two interval +vars.)doc"; + +static const char* __doc_operations_research_Solver_MakeTransitionConstraint = + R"doc(This constraint create a finite automaton that will check the sequence +of variables vars. It uses a transition table called +'transition_table'. Each transition is a triple (current_state, +variable_value, new_state). The initial state is given, and the set of +accepted states is decribed by 'final_states'. These states are hidden +inside the constraint. Only the transitions (i.e. the variables) are +visible.)doc"; + +static const char* __doc_operations_research_Solver_MakeTransitionConstraint_2 = + R"doc(This constraint create a finite automaton that will check the sequence +of variables vars. It uses a transition table called +'transition_table'. Each transition is a triple (current_state, +variable_value, new_state). The initial state is given, and the set of +accepted states is decribed by 'final_states'. These states are hidden +inside the constraint. Only the transitions (i.e. the variables) are +visible.)doc"; + +static const char* __doc_operations_research_Solver_MakeTrueConstraint = + R"doc(This constraint always succeeds.)doc"; + +static const char* __doc_operations_research_Solver_MakeVariableDegreeVisitor = + R"doc(Compute the number of constraints a variable is attached to.)doc"; + +static const char* __doc_operations_research_Solver_MakeVariableDomainFilter = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeVariableGreaterOrEqualValue = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MakeVariableLessOrEqualValue = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedMaximize = + R"doc(Creates a maximization weigthed objective.)doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedMaximize_2 = + R"doc(Creates a maximization weigthed objective.)doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedMinimize = + R"doc(Creates a minimization weighted objective. The actual objective is +scalar_prod(sub_objectives, weights).)doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedMinimize_2 = + R"doc(Creates a minimization weighted objective. The actual objective is +scalar_prod(sub_objectives, weights).)doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedOptimize = + R"doc(Creates a weighted objective with a given sense (true = maximization).)doc"; + +static const char* __doc_operations_research_Solver_MakeWeightedOptimize_2 = + R"doc(Creates a weighted objective with a given sense (true = maximization).)doc"; + +static const char* __doc_operations_research_Solver_MarkerType = + R"doc(This enum is used internally in private methods Solver::PushState and +Solver::PopState to tag states in the search tree.)doc"; + +static const char* __doc_operations_research_Solver_MarkerType_CHOICE_POINT = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MarkerType_REVERSIBLE_ACTION = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MarkerType_SENTINEL = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MarkerType_SIMPLE_MARKER = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MemoryUsage = + R"doc(Current memory usage in bytes)doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent = + R"doc(Search monitor events.)doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kAccept = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kAcceptDelta = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kAcceptNeighbor = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kAcceptSolution = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kAcceptUncheckedNeighbor = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kAfterDecision = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kApplyDecision = R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kAtSolution = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kBeginFail = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kBeginInitialPropagation = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kBeginNextDecision = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kEndFail = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kEndInitialPropagation = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kEndNextDecision = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kEnterSearch = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kExitSearch = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kIsUncheckedSolutionLimitReached = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kLast = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_MonitorEvent_kLocalOptimum = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kNoMoreSolutions = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kPeriodicCheck = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kProgressPercent = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kRefuteDecision = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MonitorEvent_kRestartSearch = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_MultiArmedBanditConcatenateOperators = + R"doc(Creates a local search operator which concatenates a vector of +operators. Uses Multi-Armed Bandit approach for choosing the next +operator to use. Sorts operators based on Upper Confidence Bound +Algorithm which evaluates each operator as sum of average improvement +and exploration function. + +Updates the order of operators when accepts a neighbor with objective +improvement.)doc"; + +static const char* __doc_operations_research_Solver_NameAllVariables = + R"doc(Returns whether all variables should be named.)doc"; + +static const char* __doc_operations_research_Solver_NewSearch = + R"doc(@{ Decomposed search. The code for a top level search should look like +solver->NewSearch(db); while (solver->NextSolution()) { //.. use the +current solution } solver()->EndSearch();)doc"; + +static const char* __doc_operations_research_Solver_NewSearch_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_NewSearch_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_NewSearch_4 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_NewSearch_5 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_NewSearch_6 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_NextSolution = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Now = + R"doc(The 'absolute time' as seen by the solver. Unless a user-provided +clock was injected via SetClock() (eg. for unit tests), this is a real +walltime, shifted so that it was 0 at construction. All so-called +"walltime" limits are relative to this time.)doc"; + +static const char* __doc_operations_research_Solver_OptimizationDirection = + R"doc(Optimization directions.)doc"; + +static const char* + __doc_operations_research_Solver_OptimizationDirection_MAXIMIZATION = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_OptimizationDirection_MINIMIZATION = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_OptimizationDirection_NOT_SET = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_ParentSearch = + R"doc(Returns the Search object which is the parent of the active search, +i.e., the search below the top of the stack. If the active search is +at the bottom of the stack, returns the active search.)doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification = + R"doc(A constraint that maintains the energy cost of paths. Energy is the +integral of force applied over distance. More formally, the energy +used on a path is: energy[path] = sum(node | paths[node] == path /\ +node not end) forces[next[node]] * distances[node] where forces[n] is +the force needed to move loads accumulated until, but excluding weight +and distances[n] is the distance from n to its successor. For +instance, if a path has a route with two pickup/delivery pairs where +the first shipment weighs 1 unit, the second weighs 2 units, and the +distance between nodes is one, the {force/distance} of nodes would be: +start{0/1} P1{0/1} P2{1/1} D1{3/1} D2{2/1} end{0/0}. The energy would +be 0*1 + 1*1 + 3*1 + 2*1 + 0*1. The cost per unit of energy is +cost_per_unit_below_threshold until the force reaches the threshold, +then it is cost_per_unit_above_threshold: min(threshold, +force.CumulVar(Next(node))) * distance.TransitVar(node) * +cost_per_unit_below_threshold + max(0, force.CumulVar(Next(node)) - +threshold) * distance.TransitVar(node) * +cost_per_unit_above_threshold.)doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_EnergyCost = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_EnergyCost_IsNull = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_EnergyCost_cost_per_unit_above_threshold = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_EnergyCost_cost_per_unit_below_threshold = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_EnergyCost_threshold = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_costs = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_distances = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_forces = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_nexts = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_path_ends = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_path_energy_costs = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_path_starts = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_path_used_when_empty = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_PathEnergyCostConstraintSpecification_paths = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_PopState = R"doc()doc"; + +static const char* __doc_operations_research_Solver_PopState_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_ProcessConstraints = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_PushSentinel = R"doc()doc"; + +static const char* __doc_operations_research_Solver_PushState = + R"doc(The PushState and PopState methods manipulates the states of the +reversible objects. They are visible only because they are useful to +write unitary tests.)doc"; + +static const char* __doc_operations_research_Solver_PushState_2 = + R"doc(Initialization. To be called by the constructors only.)doc"; + +static const char* __doc_operations_research_Solver_Rand32 = + R"doc(Returns a random value between 0 and 'size' - 1;)doc"; + +static const char* __doc_operations_research_Solver_Rand64 = + R"doc(Returns a random value between 0 and 'size' - 1;)doc"; + +static const char* __doc_operations_research_Solver_RandomConcatenateOperators = + R"doc(Randomized version of local search concatenator; calls a random +operator at each call to MakeNextNeighbor().)doc"; + +static const char* + __doc_operations_research_Solver_RandomConcatenateOperators_2 = + R"doc(Randomized version of local search concatenator; calls a random +operator at each call to MakeNextNeighbor(). The provided seed is used +to initialize the random number generator.)doc"; + +static const char* __doc_operations_research_Solver_ReSeed = + R"doc(Reseed the solver random generator.)doc"; + +static const char* __doc_operations_research_Solver_RegisterDemon = + R"doc(Adds a new demon and wraps it inside a DemonProfiler if necessary.)doc"; + +static const char* __doc_operations_research_Solver_RegisterIntExpr = + R"doc(Registers a new IntExpr and wraps it inside a TraceIntExpr if +necessary.)doc"; + +static const char* __doc_operations_research_Solver_RegisterIntVar = + R"doc(Registers a new IntVar and wraps it inside a TraceIntVar if necessary.)doc"; + +static const char* __doc_operations_research_Solver_RegisterIntervalVar = + R"doc(Registers a new IntervalVar and wraps it inside a TraceIntervalVar if +necessary.)doc"; + +static const char* __doc_operations_research_Solver_RegularLimit = + R"doc(Creates a search limit that constrains the running time.)doc"; + +static const char* __doc_operations_research_Solver_RestartCurrentSearch = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_RestartSearch = R"doc()doc"; + +static const char* __doc_operations_research_Solver_RevAlloc = + R"doc(Registers the given object as being reversible. By calling this +method, the caller gives ownership of the object to the solver, which +will delete it when there is a backtrack out of the current state. + +Returns the argument for convenience: this way, the caller may +directly invoke a constructor in the argument, without having to store +the pointer first. + +This function is only for users that define their own subclasses of +BaseObject: for all subclasses predefined in the library, the +corresponding factory methods (e.g., MakeIntVar(...), +MakeAllDifferent(...) already take care of the registration.)doc"; + +static const char* __doc_operations_research_Solver_RevAllocArray = + R"doc(Like RevAlloc() above, but for an array of objects: the array must +have been allocated with the new[] operator. The entire array will be +deleted when backtracking out of the current state. + +This method is valid for arrays of int, int64_t, uint64_t, bool, +BaseObject*, IntVar*, IntExpr*, and Constraint*.)doc"; + +static const char* __doc_operations_research_Solver_RunUncheckedLocalSearch = + R"doc(Experimental: runs a local search on the given initial solution, +checking the feasibility and the objective value of solutions using +the filter manager only (solutions are never restored in the CP +world). Only greedy descent is supported.)doc"; + +static const char* + __doc_operations_research_Solver_RunUncheckedLocalSearchInternal = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAlloc = R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_6 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_7 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SafeRevAllocArray_8 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SaveAndAdd = + R"doc(All-in-one SaveAndAdd_value.)doc"; + +static const char* __doc_operations_research_Solver_SaveAndSetValue = + R"doc(All-in-one SaveAndSetValue.)doc"; + +static const char* __doc_operations_research_Solver_SaveValue = + R"doc(SaveValue() saves the value of the corresponding object. It must be +called before modifying the object. The value will be restored upon +backtrack.)doc"; + +static const char* __doc_operations_research_Solver_SearchContext = R"doc()doc"; + +static const char* __doc_operations_research_Solver_SearchContext_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SearchDepth = + R"doc(Gets the search depth of the current active search. Returns -1 if +there is no active search opened.)doc"; + +static const char* __doc_operations_research_Solver_SearchLeftDepth = + R"doc(Gets the search left depth of the current active search. Returns -1 if +there is no active search opened.)doc"; + +static const char* __doc_operations_research_Solver_SearchLimit = + R"doc(Creates a search limit that is reached when either of the underlying +limit is reached. That is, the returned limit is more stringent than +both argument limits.)doc"; + +static const char* __doc_operations_research_Solver_SearchLogParameters = + R"doc(Creates a search monitor from logging parameters.)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_branch_period = + R"doc(SearchMonitors will display a periodic search log every branch_period +branches explored.)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_display_callback = + R"doc(SearchMonitors will display the result of display_callback at each new +solution found and when the search finishes if +display_on_new_solutions_only is false.)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_display_on_new_solutions_only = + R"doc(To be used to protect from cases where display_callback assumes +variables are instantiated, which only happens in AtSolution().)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_objective = + R"doc(SearchMonitors will display values of objective or variables (both +cannot be used together).)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_offsets = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_scaling_factors = + R"doc(When displayed, objective or var values will be scaled and offset by +the given values in the following way: scaling_factor * (value + +offset).)doc"; + +static const char* + __doc_operations_research_Solver_SearchLogParameters_variables = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SequenceStrategy = + R"doc(Used for scheduling. Not yet implemented.)doc"; + +static const char* + __doc_operations_research_Solver_SequenceStrategy_CHOOSE_MIN_SLACK_RANK_FORWARD = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_SequenceStrategy_CHOOSE_RANDOM_RANK_FORWARD = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_SequenceStrategy_SEQUENCE_DEFAULT = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_SequenceStrategy_SEQUENCE_SIMPLE = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SetBranchSelector = + R"doc(Sets the given branch selector on the current active search.)doc"; + +static const char* __doc_operations_research_Solver_SetClock = + R"doc(Set the clock in the timer. Does not take ownership. For dependency +injection.)doc"; + +static const char* __doc_operations_research_Solver_SetName = R"doc()doc"; + +static const char* __doc_operations_research_Solver_SetSearchContext = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SetUseFastLocalSearch = + R"doc(enabled for metaheuristics. Disables/enables fast local search.)doc"; + +static const char* __doc_operations_research_Solver_ShouldFail = + R"doc(See http://cs/file:constraint_solver.i%20ShouldFail.)doc"; + +static const char* __doc_operations_research_Solver_Solve = + R"doc(@{ Solves the problem using the given DecisionBuilder and returns true +if a solution was found and accepted. + +These methods are the ones most users should use to search for a +solution. Note that the definition of 'solution' is subtle. A solution +here is defined as a leaf of the search tree with respect to the given +decision builder for which there is no failure. What this means is +that, contrary to intuition, a solution may not have all variables of +the model bound. It is the responsibility of the decision builder to +keep returning decisions until all variables are indeed bound. The +most extreme counterexample is calling Solve with a trivial decision +builder whose Next() method always returns nullptr. In this case, +Solve immediately returns 'true', since not assigning any variable to +any value is a solution, unless the root node propagation discovers +that the model is infeasible. + +This function must be called either from outside of search, or from +within the Next() method of a decision builder. + +Solve will terminate whenever any of the following event arise: * A +search monitor asks the solver to terminate the search by calling +solver()->FinishCurrentSearch(). * A solution is found that is +accepted by all search monitors, and none of the search monitors +decides to search for another one. + +Upon search termination, there will be a series of backtracks all the +way to the top level. This means that a user cannot expect to inspect +the solution by querying variables after a call to Solve(): all the +information will be lost. In order to do something with the solution, +the user must either: + +* Use a search monitor that can process such a leaf. See, in +particular, the SolutionCollector class. * Do not use Solve. Instead, +use the more fine-grained approach using methods NewSearch(...), +NextSolution(), and EndSearch(). + +Parameter ``db``: + The decision builder that will generate the search tree. + +Parameter ``monitors``: + A vector of search monitors that will be notified of various + events during the search. In their reaction to these events, such + monitors may influence the search.)doc"; + +static const char* __doc_operations_research_Solver_Solve_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Solve_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Solve_4 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Solve_5 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Solve_6 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolveAndCommit = + R"doc(SolveAndCommit using a decision builder and up to three search +monitors, usually one for the objective, one for the limits and one to +collect solutions. + +The difference between a SolveAndCommit() and a Solve() method call is +the fact that SolveAndCommit will not backtrack all modifications at +the end of the search. This method is only usable during the Next() +method of a decision builder.)doc"; + +static const char* __doc_operations_research_Solver_SolveAndCommit_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolveAndCommit_3 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolveAndCommit_4 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolveAndCommit_5 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolveDepth = + R"doc(Gets the number of nested searches. It returns 0 outside search, 1 +during the top level search, 2 or more in case of nested searches.)doc"; + +static const char* __doc_operations_research_Solver_Solver = + R"doc(Solver API)doc"; + +static const char* __doc_operations_research_Solver_Solver_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Solver_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_SolverState = + R"doc(This enum represents the state of the solver w.r.t. the search.)doc"; + +static const char* __doc_operations_research_Solver_SolverState_AT_SOLUTION = + R"doc(After successful NextSolution and before EndSearch.)doc"; + +static const char* __doc_operations_research_Solver_SolverState_IN_ROOT_NODE = + R"doc(Executing the root node.)doc"; + +static const char* __doc_operations_research_Solver_SolverState_IN_SEARCH = + R"doc(Executing the search code.)doc"; + +static const char* + __doc_operations_research_Solver_SolverState_NO_MORE_SOLUTIONS = + R"doc(After failed NextSolution and before EndSearch.)doc"; + +static const char* __doc_operations_research_Solver_SolverState_OUTSIDE_SEARCH = + R"doc(Before search, after search.)doc"; + +static const char* + __doc_operations_research_Solver_SolverState_PROBLEM_INFEASIBLE = + R"doc(After search, the model is infeasible.)doc"; + +static const char* __doc_operations_research_Solver_TopLevelSearch = + R"doc(Returns the Search object that is at the bottom of the search stack. +Contrast with ActiveSearch(), which returns the search at the top of +the stack.)doc"; + +static const char* __doc_operations_research_Solver_TopPeriodicCheck = + R"doc(Performs PeriodicCheck on the top-level search; for instance, can be +called from a nested solve to check top-level limits.)doc"; + +static const char* __doc_operations_research_Solver_TopProgressPercent = + R"doc(Returns a percentage representing the propress of the search before +reaching the limits of the top-level search (can be called from a +nested solve).)doc"; + +static const char* __doc_operations_research_Solver_Try = + R"doc("Try"-builders "recursively". For instance, Try(a,b,c,d) will give a +tree unbalanced to the right, whereas Try(Try(a,b), Try(b,c)) will +give a balanced tree. Investigate if we should only provide the binary +version and/or if we should balance automatically.)doc"; + +static const char* __doc_operations_research_Solver_Try_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Try_3 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_Try_4 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_UnaryIntervalRelation = + R"doc(This enum is used in Solver::MakeIntervalVarRelation to specify the +temporal relation between an interval t and an integer d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_AVOID_DATE = + R"doc(STARTS_AFTER or ENDS_BEFORE, i.e. d is not in t. t starts after d, +i.e. Start(t) >= d. t ends before d, i.e. End(t) <= d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_CROSS_DATE = + R"doc(STARTS_BEFORE and ENDS_AFTER at the same time, i.e. d is in t. t +starts before d, i.e. Start(t) <= d. t ends after d, i.e. End(t) >= d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_ENDS_AFTER = + R"doc(t ends after d, i.e. End(t) >= d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_ENDS_AT = + R"doc(t ends at d, i.e. End(t) == d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_ENDS_BEFORE = + R"doc(t ends before d, i.e. End(t) <= d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_STARTS_AFTER = + R"doc(t starts after d, i.e. Start(t) >= d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_STARTS_AT = + R"doc(t starts at d, i.e. Start(t) == d.)doc"; + +static const char* + __doc_operations_research_Solver_UnaryIntervalRelation_STARTS_BEFORE = + R"doc(t starts before d, i.e. Start(t) <= d.)doc"; + +static const char* __doc_operations_research_Solver_UnfreezeQueue = R"doc()doc"; + +static const char* __doc_operations_research_Solver_UnsafeRevAlloc = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_UnsafeRevAllocArray = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_UnsafeRevAllocArrayAux = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_UnsafeRevAllocAux = + R"doc(UnsafeRevAlloc is used internally for cells in SimpleRevFIFO and other +structures like this.)doc"; + +static const char* __doc_operations_research_Solver_UseFastLocalSearch = + R"doc(Returns true if fast local search is enabled.)doc"; + +static const char* __doc_operations_research_Solver_VirtualMemorySize = + R"doc(Current virtual memory size in bytes)doc"; + +static const char* __doc_operations_research_Solver_accepted_neighbors = + R"doc(The number of accepted neighbors.)doc"; + +static const char* __doc_operations_research_Solver_accepted_neighbors_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_additional_constraint_index = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_additional_constraints_list = R"doc()doc"; + +static const char* + __doc_operations_research_Solver_additional_constraints_parent_list = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_anonymous_variable_index = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_balancing_decision = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_balancing_decision_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_branches = + R"doc(The number of branches explored since the creation of the solver.)doc"; + +static const char* __doc_operations_research_Solver_branches_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_cached_constants = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_cast_constraints = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_cast_information = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_check_alloc_state = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_clear_fail_intercept = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_const_parameters = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_constraint_index = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_constraints = + R"doc(Counts the number of constraints that have been added to the solver +before the search.)doc"; + +static const char* __doc_operations_research_Solver_constraints_list = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_context = + R"doc(Gets the current context of the search.)doc"; + +static const char* __doc_operations_research_Solver_context_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_decisions = R"doc()doc"; + +static const char* __doc_operations_research_Solver_demon_profiler = + R"doc(Access to demon profiler.)doc"; + +static const char* __doc_operations_research_Solver_demon_profiler_2 = + R"doc(Demon monitor)doc"; + +static const char* __doc_operations_research_Solver_demon_runs = + R"doc(The number of demons executed during search for a given priority.)doc"; + +static const char* __doc_operations_research_Solver_demon_runs_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_empty_name = R"doc()doc"; + +static const char* __doc_operations_research_Solver_fail_decision = R"doc()doc"; + +static const char* __doc_operations_research_Solver_fail_intercept = + R"doc(intercept failures)doc"; + +static const char* __doc_operations_research_Solver_fail_stamp = + R"doc(The fail_stamp() is incremented after each backtrack.)doc"; + +static const char* __doc_operations_research_Solver_fail_stamp_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_fails = R"doc()doc"; + +static const char* __doc_operations_research_Solver_failures = + R"doc(The number of failures encountered since the creation of the solver.)doc"; + +static const char* __doc_operations_research_Solver_false_constraint = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_filtered_neighbors = + R"doc(The number of filtered neighbors (neighbors accepted by filters).)doc"; + +static const char* __doc_operations_research_Solver_filtered_neighbors_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_local_search_monitor = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_local_search_profiler = + R"doc(Local search profiler monitor)doc"; + +static const char* __doc_operations_research_Solver_local_search_state = + R"doc(Local search state.)doc"; + +static const char* __doc_operations_research_Solver_model_cache = R"doc()doc"; + +static const char* __doc_operations_research_Solver_model_name = + R"doc(Returns the name of the model.)doc"; + +static const char* __doc_operations_research_Solver_name = R"doc()doc"; + +static const char* __doc_operations_research_Solver_neighbors = + R"doc(The number of neighbors created.)doc"; + +static const char* __doc_operations_research_Solver_neighbors_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_num_int_vars = R"doc()doc"; + +static const char* __doc_operations_research_Solver_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_optimization_direction = + R"doc(The direction of optimization, getter and setter.)doc"; + +static const char* __doc_operations_research_Solver_optimization_direction_2 = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_parameters = + R"doc(Stored Parameters.)doc"; + +static const char* __doc_operations_research_Solver_parameters_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_print_trace = R"doc()doc"; + +static const char* __doc_operations_research_Solver_propagation_monitor = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_propagation_object_names = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_queue = R"doc()doc"; + +static const char* __doc_operations_research_Solver_random = R"doc()doc"; + +static const char* __doc_operations_research_Solver_reset_action_on_fail = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_searches = R"doc()doc"; + +static const char* __doc_operations_research_Solver_set_action_on_fail = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_set_context = + R"doc(Sets the current context of the search.)doc"; + +static const char* __doc_operations_research_Solver_set_fail_intercept = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_set_optimization_direction = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_set_variable_to_clean_on_fail = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_should_fail = R"doc()doc"; + +static const char* __doc_operations_research_Solver_solutions = + R"doc(The number of solutions found since the start of the search.)doc"; + +static const char* __doc_operations_research_Solver_stamp = + R"doc(The stamp indicates how many moves in the search tree we have +performed. It is useful to detect if we need to update same lazy +structures.)doc"; + +static const char* __doc_operations_research_Solver_state = + R"doc(State of the solver.)doc"; + +static const char* __doc_operations_research_Solver_state_2 = R"doc()doc"; + +static const char* __doc_operations_research_Solver_timer = R"doc()doc"; + +static const char* __doc_operations_research_Solver_tmp_vector = + R"doc(Unsafe temporary vector. It is used to avoid leaks in operations that +need storage and that may fail. See IntVar::SetValues() for instance. +It is not locked; do not use in a multi-threaded or reentrant setup.)doc"; + +static const char* __doc_operations_research_Solver_trail = R"doc()doc"; + +static const char* __doc_operations_research_Solver_true_constraint = + R"doc(Cached constraints.)doc"; + +static const char* __doc_operations_research_Solver_unchecked_solutions = + R"doc(The number of unchecked solutions found by local search.)doc"; + +static const char* + __doc_operations_research_Solver_unnamed_enum_at_util_operations_research_constraint_solver_constraint_solver_h_3315_3 = + R"doc(interval of constants cached, inclusive:)doc"; + +static const char* + __doc_operations_research_Solver_unnamed_enum_at_util_operations_research_constraint_solver_constraint_solver_h_3315_3_MAX_CACHED_INT_CONST = + R"doc()doc"; + +static const char* + __doc_operations_research_Solver_unnamed_enum_at_util_operations_research_constraint_solver_constraint_solver_h_3315_3_MIN_CACHED_INT_CONST = + R"doc()doc"; + +static const char* __doc_operations_research_Solver_use_fast_local_search = + R"doc(Local search mode)doc"; + +static const char* __doc_operations_research_Solver_wall_time = + R"doc(DEPRECATED: Use Now() instead. Time elapsed, in ms since the creation +of the solver.)doc"; + +static const char* __doc_operations_research_StateInfo = R"doc()doc"; + +static const char* __doc_operations_research_SymmetryBreaker = R"doc()doc"; + +static const char* __doc_operations_research_Trail = R"doc()doc"; + +static const char* __doc_operations_research_Zero = + R"doc(This method returns 0. It is useful when 0 can be cast either as a +pointer or as an integer value and thus lead to an ambiguous function +call.)doc"; + +static const char* __doc_operations_research_operator_lshift = R"doc()doc"; + +static const char* __doc_operations_research_operator_lshift_2 = R"doc()doc"; + +static const char* __doc_operations_research_operator_lshift_3 = R"doc()doc"; + +static const char* __doc_util_Clock = R"doc()doc"; + +#if defined(__GNUG__) +#pragma GCC diagnostic pop +#endif diff --git a/ortools/constraint_solver/python/constraint_solver_test.py b/ortools/constraint_solver/python/constraint_solver_test.py new file mode 100644 index 0000000000..b121d5ce9d --- /dev/null +++ b/ortools/constraint_solver/python/constraint_solver_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 +# Copyright 2010-2024 Google LLC +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Test for constraint_solver pybind11 layer.""" + +from absl.testing import absltest +from ortools.constraint_solver import constraint_solver + + +class ConstraintSolverTest(absltest.TestCase): + + def test_create_solver(self): + print("test_create_solver") + solver = constraint_solver.Solver("test_create_solver") + print(solver) + + def test_create_int_var(self): + print("test_create_int_var") + solver = constraint_solver.Solver("test_create_int_var") + x = solver.new_int_var(0, 10, "x") + self.assertEqual(str(x), "x(0..10)") + self.assertEqual(x.min, 0) + self.assertEqual(x.max, 10) + self.assertEqual(x.name, "x") + + y = solver.new_int_var([0, 2, 4]) + self.assertEqual(y.min, 0) + self.assertEqual(y.max, 4) + self.assertEmpty(y.name) + y.name = "y" + self.assertEqual(y.name, "y") + + def test_create_int_expr(self): + print("test_create_int_expr") + solver = constraint_solver.Solver("test_create_int_expr") + x = solver.new_int_var(0, 10, "x") + y = solver.new_int_var(0, 10, "y") + + x_plus_3 = x + 3 + self.assertEqual(str(x_plus_3), "(x(0..10) + 3)") + print(x_plus_3) + self.assertEqual(x_plus_3.min, 3) + self.assertEqual(x_plus_3.max, 13) + + self.assertEqual(str(x * 5), "(x(0..10) * 5)") + self.assertEqual(str(x + y), "(x(0..10) + y(0..10))") + self.assertEqual(str(2 + x), "(x(0..10) + 2)") + self.assertEqual(str(7 * x), "(x(0..10) * 7)") + self.assertEqual(str(x * y), "(x(0..10) * y(0..10))") + self.assertEqual(str(x + 2 * y + 5), "((x(0..10) + (y(0..10) * 2)) + 5)") + + def test_fail_outside_solve(self): + print("test_fail_outside_solve") + solver = constraint_solver.Solver("test_fail_outside_solve") + x = solver.new_int_var(0, 10, "x") + try: + x.set_min(20) + except ValueError: + print(" fail caught") + + +if __name__ == "__main__": + absltest.main() diff --git a/ortools/constraint_solver/python/pywrapcp_test.py b/ortools/constraint_solver/python/pywrapcp_test.py index 3a25cf9848..22c6b8b3c4 100755 --- a/ortools/constraint_solver/python/pywrapcp_test.py +++ b/ortools/constraint_solver/python/pywrapcp_test.py @@ -15,6 +15,7 @@ """Test Constraint Solver API.""" import sys + from absl.testing import absltest from ortools.constraint_solver import search_limit_pb2 from ortools.constraint_solver import solver_parameters_pb2 @@ -26,6 +27,7 @@ def inc_callback(i): class ClassIncCallback: + def __init__(self, increment): self.__increment = increment @@ -34,6 +36,7 @@ class ClassIncCallback: class TestIntVarContainerAPI(absltest.TestCase): + def test_contains(self): self.assertTrue( hasattr(pywrapcp.IntVarContainer, "Contains"), @@ -65,6 +68,7 @@ class TestIntVarContainerAPI(absltest.TestCase): class TestIntervalVarContainerAPI(absltest.TestCase): + def test_contains(self): self.assertTrue( hasattr(pywrapcp.IntervalVarContainer, "Contains"), @@ -97,6 +101,7 @@ class TestIntervalVarContainerAPI(absltest.TestCase): class TestSequenceVarContainerAPI(absltest.TestCase): + def test_contains(self): self.assertTrue( hasattr(pywrapcp.SequenceVarContainer, "Contains"), @@ -129,6 +134,7 @@ class TestSequenceVarContainerAPI(absltest.TestCase): class PyWrapCPTest(absltest.TestCase): + def testRabbitPheasant(self): # Create the solver. solver = pywrapcp.Solver("testRabbitPheasant") @@ -527,6 +533,7 @@ class PyWrapCPTest(absltest.TestCase): class CustomSearchMonitor(pywrapcp.SearchMonitor): + def __init__(self, solver, nexts): pywrapcp.SearchMonitor.__init__(self, solver) self._nexts = nexts @@ -539,6 +546,7 @@ class CustomSearchMonitor(pywrapcp.SearchMonitor): class SearchMonitorTest(absltest.TestCase): + def test_search_monitor(self): print("test_search_monitor") solver = pywrapcp.Solver("test search monitor") @@ -551,6 +559,7 @@ class SearchMonitorTest(absltest.TestCase): class CustomDemon(pywrapcp.PyDemon): + def __init__(self, x): super().__init__() self._x = x @@ -561,6 +570,7 @@ class CustomDemon(pywrapcp.PyDemon): class DemonTest(absltest.TestCase): + def test_demon(self): print("test_demon") solver = pywrapcp.Solver("test export") @@ -570,6 +580,7 @@ class DemonTest(absltest.TestCase): class CustomConstraint(pywrapcp.PyConstraint): + def __init__(self, solver, x): super().__init__(solver) self._x = x @@ -592,6 +603,7 @@ class CustomConstraint(pywrapcp.PyConstraint): class InitialPropagateDemon(pywrapcp.PyDemon): + def __init__(self, constraint): super().__init__() self._ct = constraint @@ -601,6 +613,7 @@ class InitialPropagateDemon(pywrapcp.PyDemon): class DumbGreaterOrEqualToFive(pywrapcp.PyConstraint): + def __init__(self, solver, x): super().__init__(solver) self._x = x @@ -619,6 +632,7 @@ class DumbGreaterOrEqualToFive(pywrapcp.PyConstraint): class WatchDomain(pywrapcp.PyDemon): + def __init__(self, x): super().__init__() self._x = x @@ -629,6 +643,7 @@ class WatchDomain(pywrapcp.PyDemon): class HoleConstraint(pywrapcp.PyConstraint): + def __init__(self, solver, x): super().__init__(solver) self._x = x @@ -642,6 +657,7 @@ class HoleConstraint(pywrapcp.PyConstraint): class BinarySum(pywrapcp.PyConstraint): + def __init__(self, solver, x, y, z): super().__init__(solver) self._x = x @@ -661,6 +677,7 @@ class BinarySum(pywrapcp.PyConstraint): class ConstraintTest(absltest.TestCase): + def test_member(self): print("test_member") solver = pywrapcp.Solver("test member") @@ -759,6 +776,7 @@ class ConstraintTest(absltest.TestCase): class CustomDecisionBuilder(pywrapcp.PyDecisionBuilder): + def __init__(self): super().__init__() self._counter = 0 @@ -773,6 +791,7 @@ class CustomDecisionBuilder(pywrapcp.PyDecisionBuilder): class CustomDecision(pywrapcp.PyDecision): + def __init__(self): print("In CustomDecision ctor", file=sys.stderr) super().__init__() @@ -792,6 +811,7 @@ class CustomDecision(pywrapcp.PyDecision): class CustomDecisionBuilderCustomDecision(pywrapcp.PyDecisionBuilder): + def __init__(self): super().__init__() self.__done = False @@ -811,6 +831,7 @@ class CustomDecisionBuilderCustomDecision(pywrapcp.PyDecisionBuilder): class DecisionTest(absltest.TestCase): + def test_custom_decision_builder(self): solver = pywrapcp.Solver("test_custom_decision_builder") db = CustomDecisionBuilder() @@ -827,6 +848,7 @@ class DecisionTest(absltest.TestCase): class LocalSearchTest(absltest.TestCase): + class OneVarLNS(pywrapcp.BaseLns): """One Var LNS.""" @@ -959,6 +981,7 @@ class LocalSearchTest(absltest.TestCase): class MyDecisionBuilder(pywrapcp.PyDecisionBuilder): + def __init__(self, var, value): super().__init__() self.__var = var @@ -971,6 +994,7 @@ class MyDecisionBuilder(pywrapcp.PyDecisionBuilder): class MyLns(pywrapcp.BaseLns): + def __init__(self, int_vars): super().__init__(int_vars) self.__current = 0 @@ -989,6 +1013,7 @@ class MyLns(pywrapcp.BaseLns): class MyLnsNoValues(pywrapcp.BaseLns): + def __init__(self, int_vars): super().__init__(int_vars) self.__current = 0 @@ -1005,6 +1030,7 @@ class MyLnsNoValues(pywrapcp.BaseLns): class MyDecisionBuilderWithRev(pywrapcp.PyDecisionBuilder): + def __init__(self, var, value, rev): super().__init__() self.__var = var @@ -1022,6 +1048,7 @@ class MyDecisionBuilderWithRev(pywrapcp.PyDecisionBuilder): class MyDecisionBuilderThatFailsWithRev(pywrapcp.PyDecisionBuilder): + def Next(self, solver): solver.Fail() return None @@ -1260,6 +1287,7 @@ class PyWrapCPSearchTest(absltest.TestCase): class SplitDomainDecisionBuilder(pywrapcp.PyDecisionBuilder): + def __init__(self, var, value, lower): super().__init__() self.__var = var @@ -1275,6 +1303,7 @@ class SplitDomainDecisionBuilder(pywrapcp.PyDecisionBuilder): class PyWrapCPDecisionTest(absltest.TestCase): + def testSplitDomainLower(self): solver = pywrapcp.Solver("testSplitDomainLower") x = solver.IntVar(0, 10, "x") @@ -1331,6 +1360,7 @@ class PyWrapCPDecisionTest(absltest.TestCase): class IntVarLocalSearchOperatorTest(absltest.TestCase): + def test_ctor(self): solver = pywrapcp.Solver("Solve") int_vars = [solver.IntVar(0, 4) for _ in range(4)] diff --git a/ortools/constraint_solver/python/pywraprouting_test.py b/ortools/constraint_solver/python/pywraprouting_test.py index 6e163a746d..130f6b2f8c 100755 --- a/ortools/constraint_solver/python/pywraprouting_test.py +++ b/ortools/constraint_solver/python/pywraprouting_test.py @@ -17,8 +17,8 @@ import functools from absl.testing import absltest -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 def Distance(node_i, node_j): @@ -46,6 +46,7 @@ def Three(unused_i, unused_j): class Callback: + def __init__(self, model): self.model = model self.costs = [] @@ -55,6 +56,7 @@ class Callback: class TestPyWrapRoutingIndexManager(absltest.TestCase): + def testCtor(self): manager = pywrapcp.RoutingIndexManager(42, 3, 7) self.assertIsNotNone(manager) @@ -87,6 +89,7 @@ class TestPyWrapRoutingIndexManager(absltest.TestCase): class TestPyWrapRoutingModel(absltest.TestCase): + def testCtor(self): manager = pywrapcp.RoutingIndexManager(42, 3, 7) self.assertIsNotNone(manager) @@ -102,12 +105,10 @@ class TestPyWrapRoutingModel(absltest.TestCase): model = pywrapcp.RoutingModel(manager) self.assertIsNotNone(model) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_OPTIMAL, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_OPTIMAL, model.status()) self.assertIsNotNone(assignment) self.assertEqual(0, assignment.ObjectiveValue()) @@ -117,12 +118,10 @@ class TestPyWrapRoutingModel(absltest.TestCase): model = pywrapcp.RoutingModel(manager) self.assertIsNotNone(model) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_OPTIMAL, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_OPTIMAL, model.status()) self.assertIsNotNone(assignment) self.assertEqual(0, assignment.ObjectiveValue()) @@ -137,13 +136,11 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_idx) model.SetArcCostEvaluatorOfAllVehicles(transit_idx) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() self.assertTrue(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(20, assignment.ObjectiveValue()) def testTransitLambda(self): @@ -155,12 +152,10 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_id) model.SetArcCostEvaluatorOfAllVehicles(transit_id) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertIsNotNone(assignment) self.assertEqual(5, assignment.ObjectiveValue()) @@ -174,13 +169,11 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_idx) model.SetArcCostEvaluatorOfAllVehicles(transit_idx) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() self.assertTrue(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(15, assignment.ObjectiveValue()) def testUnaryTransitCallback(self): @@ -194,13 +187,11 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_idx) model.SetArcCostEvaluatorOfAllVehicles(transit_idx) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() self.assertTrue(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(10, assignment.ObjectiveValue()) def testUnaryTransitLambda(self): @@ -212,12 +203,10 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_id) model.SetArcCostEvaluatorOfAllVehicles(transit_id) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertIsNotNone(assignment) self.assertEqual(5, assignment.ObjectiveValue()) @@ -231,13 +220,11 @@ class TestPyWrapRoutingModel(absltest.TestCase): self.assertEqual(1, transit_idx) model.SetArcCostEvaluatorOfAllVehicles(transit_idx) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.Solve() self.assertTrue(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(45, assignment.ObjectiveValue()) def testTSP(self): @@ -252,17 +239,15 @@ class TestPyWrapRoutingModel(absltest.TestCase): ) model.SetArcCostEvaluatorOfAllVehicles(transit_idx) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(90, assignment.ObjectiveValue()) # Inspect solution index = model.Start(0) @@ -287,7 +272,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(89, assignment.ObjectiveValue()) @@ -318,7 +303,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -348,7 +333,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -378,7 +363,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -413,7 +398,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -450,7 +435,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -485,16 +470,14 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.SolveWithParameters(search_parameters) self.assertIsNotNone(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(90, assignment.ObjectiveValue()) # Inspect solution node = model.Start(0) @@ -524,16 +507,14 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.SolveWithParameters(search_parameters) self.assertIsNotNone(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(20, assignment.ObjectiveValue()) # Inspect solution index = model.Start(0) @@ -562,16 +543,14 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() + enums_pb2.RoutingSearchStatus.ROUTING_NOT_SOLVED, model.status() ) assignment = model.SolveWithParameters(search_parameters) self.assertIsNotNone(assignment) - self.assertEqual( - routing_enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status() - ) + self.assertEqual(enums_pb2.RoutingSearchStatus.ROUTING_SUCCESS, model.status()) self.assertEqual(20, assignment.ObjectiveValue()) # Inspect solution for v in range(manager.GetNumberOfVehicles()): @@ -612,7 +591,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(86, assignment.ObjectiveValue()) @@ -651,7 +630,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Solve search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE + enums_pb2.FirstSolutionStrategy.FIRST_UNBOUND_MIN_VALUE ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(68, assignment.ObjectiveValue()) @@ -702,10 +681,10 @@ class TestPyWrapRoutingModel(absltest.TestCase): # Close with parameters search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.SAVINGS + enums_pb2.FirstSolutionStrategy.SAVINGS ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.local_search_operators.use_two_opt = pywrapcp.BOOL_FALSE search_parameters.solution_limit = 20 @@ -740,7 +719,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): model.AddAtSolutionCallback(callback) search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) assignment = model.SolveWithParameters(search_parameters) self.assertEqual(90, assignment.ObjectiveValue()) @@ -802,7 +781,7 @@ class TestPyWrapRoutingModel(absltest.TestCase): search_parameters = pywrapcp.DefaultRoutingSearchParameters() self.assertIsNotNone(model.SolveWithParameters(search_parameters)) self.assertEqual( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC, + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC, model.GetAutomaticFirstSolutionStrategy(), ) @@ -834,12 +813,13 @@ class TestPyWrapRoutingModel(absltest.TestCase): search_parameters = pywrapcp.DefaultRoutingSearchParameters() self.assertIsNotNone(model.SolveWithParameters(search_parameters)) self.assertEqual( - routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION, + enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION, model.GetAutomaticFirstSolutionStrategy(), ) class TestBoundCost(absltest.TestCase): + def testCtor(self): bound_cost = pywrapcp.BoundCost() self.assertIsNotNone(bound_cost) @@ -853,6 +833,7 @@ class TestBoundCost(absltest.TestCase): class TestRoutingDimension(absltest.TestCase): + def testCtor(self): manager = pywrapcp.RoutingIndexManager(31, 7, 3) self.assertIsNotNone(manager) diff --git a/ortools/constraint_solver/python/routing.i b/ortools/constraint_solver/python/routing.i index c5f7b19c8c..f65485326f 100644 --- a/ortools/constraint_solver/python/routing.i +++ b/ortools/constraint_solver/python/routing.i @@ -33,9 +33,9 @@ class RoutingSearchStatus; // Include the files we want to wrap a first time. %{ -#include "ortools/constraint_solver/routing_enums.pb.h" +#include "ortools/routing/enums.pb.h" #include "ortools/constraint_solver/routing_types.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/constraint_solver/routing_parameters.h" #include "ortools/constraint_solver/routing.h" #include "ortools/util/optional_boolean.pb.h" @@ -64,10 +64,10 @@ DEFINE_INDEX_TYPE_TYPEDEF( %ignore operations_research::RoutingModel::AddResourceGroup; %ignore operations_research::RoutingModel::GetResourceGroups; -PY_PROTO_TYPEMAP(ortools.constraint_solver.routing_parameters_pb2, +PY_PROTO_TYPEMAP(ortools.routing.parameters_pb2, RoutingModelParameters, operations_research::RoutingModelParameters) -PY_PROTO_TYPEMAP(ortools.constraint_solver.routing_parameters_pb2, +PY_PROTO_TYPEMAP(ortools.routing.parameters_pb2, RoutingSearchParameters, operations_research::RoutingSearchParameters) diff --git a/ortools/constraint_solver/routing.cc b/ortools/constraint_solver/routing.cc index c16520afa7..3634230b7e 100644 --- a/ortools/constraint_solver/routing.cc +++ b/ortools/constraint_solver/routing.cc @@ -63,16 +63,13 @@ #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/constraint_solver/routing_constraints.h" #include "ortools/constraint_solver/routing_decision_builders.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_filters.h" #include "ortools/constraint_solver/routing_ils.h" -#include "ortools/constraint_solver/routing_ils.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_insertion_lns.h" #include "ortools/constraint_solver/routing_lp_scheduling.h" #include "ortools/constraint_solver/routing_neighborhoods.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_search.h" #include "ortools/constraint_solver/routing_types.h" #include "ortools/constraint_solver/routing_utils.h" @@ -80,6 +77,9 @@ #include "ortools/graph/connected_components.h" #include "ortools/graph/ebert_graph.h" #include "ortools/graph/linear_assignment.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/ils.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/bitset.h" #include "ortools/util/optional_boolean.pb.h" #include "ortools/util/piecewise_linear_function.h" @@ -239,13 +239,20 @@ SweepArranger* RoutingModel::sweep_arranger() const { void RoutingModel::NodeNeighborsByCostClass::ComputeNeighbors( const RoutingModel& routing_model, int num_neighbors, bool add_vehicle_starts_to_neighbors) { + DCHECK_GE(num_neighbors, 0); // TODO(user): consider checking search limits. const int size = routing_model.Size(); + const int num_non_start_end_nodes = size - routing_model.vehicles(); const int size_with_vehicle_nodes = size + routing_model.vehicles(); + node_index_to_neighbors_by_cost_class_.clear(); - if (num_neighbors >= size) { - all_nodes_.resize(size); - std::iota(all_nodes_.begin(), all_nodes_.end(), 0); + if (num_neighbors >= num_non_start_end_nodes) { + all_nodes_.reserve(size); + for (int node = 0; node < size; node++) { + if (add_vehicle_starts_to_neighbors || !routing_model.IsStart(node)) { + all_nodes_.push_back(node); + } + } return; } node_index_to_neighbors_by_cost_class_.resize(size_with_vehicle_nodes); @@ -283,12 +290,10 @@ void RoutingModel::NodeNeighborsByCostClass::ComputeNeighbors( after_node)); } } - std::nth_element(cost_nodes.begin(), - cost_nodes.begin() + num_neighbors - 1, - cost_nodes.end()); - cost_nodes.resize(num_neighbors); + DCHECK_GE(cost_nodes.size(), num_neighbors); // Make sure the order of the n first element is always the same. - std::sort(cost_nodes.begin(), cost_nodes.end()); + absl::c_partial_sort(cost_nodes, cost_nodes.begin() + num_neighbors); + cost_nodes.resize(num_neighbors); auto& node_neighbors = node_index_to_neighbors_by_cost_class_[node_index][cost_class]; diff --git a/ortools/constraint_solver/routing.h b/ortools/constraint_solver/routing.h index 41db282da6..40d5aea136 100644 --- a/ortools/constraint_solver/routing.h +++ b/ortools/constraint_solver/routing.h @@ -184,12 +184,12 @@ #include "ortools/base/types.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/constraint_solveri.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" #include "ortools/constraint_solver/routing_utils.h" #include "ortools/graph/graph.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/sat/theta_tree.h" #include "ortools/util/bitset.h" #include "ortools/util/piecewise_linear_function.h" @@ -1560,10 +1560,11 @@ class RoutingModel { /// Returns the neighbors of the given node for the given cost_class. const std::vector& GetNeighborsOfNodeForCostClass( int cost_class, int node_index) const { - return all_nodes_.empty() ? node_index_to_neighbors_by_cost_class_ + return node_index_to_neighbors_by_cost_class_.empty() + ? all_nodes_ + : node_index_to_neighbors_by_cost_class_ [node_index][cost_class] - ->PositionsSetAtLeastOnce() - : all_nodes_; + ->PositionsSetAtLeastOnce(); } private: diff --git a/ortools/constraint_solver/routing_filters.cc b/ortools/constraint_solver/routing_filters.cc index e98f46131e..a714694675 100644 --- a/ortools/constraint_solver/routing_filters.cc +++ b/ortools/constraint_solver/routing_filters.cc @@ -46,8 +46,8 @@ #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_lp_scheduling.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/bitset.h" #include "ortools/util/piecewise_linear_function.h" #include "ortools/util/saturated_arithmetic.h" @@ -3241,6 +3241,144 @@ IntVarLocalSearchFilter* MakeCPFeasibilityFilter(RoutingModel* routing_model) { new CPFeasibilityFilter(routing_model)); } +void WeightedWaveletTree::Clear() { + elements_.clear(); + tree_location_.clear(); + nodes_.clear(); + for (auto& layer : tree_layers_) layer.clear(); +} + +void WeightedWaveletTree::MakeTreeFromNewElements() { + // New elements are elements_[i] for i in [begin_index, end_index). + const int begin_index = tree_location_.size(); + const int end_index = elements_.size(); + DCHECK_LE(begin_index, end_index); + if (begin_index >= end_index) return; + // Gather all heights, sort and unique them, this makes up the list of + // pivot heights of the underlying tree, with an inorder traversal. + // TODO(user): investigate whether balancing the tree using the + // number of occurrences of each height would be beneficial. + // TODO(user): use a heap-like encoding for the binary search tree: + // children of i at 2*i and 2*i+1. Better cache line utilization. + const int old_node_size = nodes_.size(); + for (int i = begin_index; i < end_index; ++i) { + nodes_.push_back({.pivot_height = elements_[i].height, .pivot_index = -1}); + } + std::sort(nodes_.begin() + old_node_size, nodes_.end()); + nodes_.erase(std::unique(nodes_.begin() + old_node_size, nodes_.end()), + nodes_.end()); + + // Remember location of the tree representation for this range of elements. + // tree_location_ may be smaller than elements_, extend it if needed. + const int new_node_size = nodes_.size(); + tree_location_.resize(end_index, {.node_begin = old_node_size, + .node_end = new_node_size, + .sequence_first = begin_index}); + + // Add and extend layers if needed. + // The amount of layers needed is 1 + ceil(log(sequence size)). + const int num_layers = + 2 + MostSignificantBitPosition32(new_node_size - old_node_size - 1); + if (tree_layers_.size() <= num_layers) tree_layers_.resize(num_layers); + for (int l = 0; l < num_layers; ++l) { + tree_layers_[l].resize(end_index, + {.prefix_sum = 0, .left_index = -1, .is_left = 0}); + } + + // Fill all relevant locations of the tree, and record tree navigation + // information. This recursive function has at most num_layers call depth. + const auto fill_subtree = [this](auto& fill_subtree, int layer, + int node_begin, int node_end, + int range_begin, int range_end) { + DCHECK_LT(node_begin, node_end); + DCHECK_LT(range_begin, range_end); + // Precompute prefix sums of range [range_begin, range_end). + int64_t sum = 0; + for (int i = range_begin; i < range_end; ++i) { + sum += elements_[i].weight; + tree_layers_[layer][i].prefix_sum = sum; + } + if (node_begin + 1 == node_end) return; + // Range has more than one height, partition it. + // Record layer l -> l+1 sequence index mapping: + // - if height < pivot, record where this element will be in layer l+1. + // - if height >= pivot, record where next <= pivot will be in layer l+1. + const int node_mid = node_begin + (node_end - node_begin) / 2; + const int64_t pivot_height = nodes_[node_mid].pivot_height; + int pivot_index = range_begin; + for (int i = range_begin; i < range_end; ++i) { + tree_layers_[layer][i].left_index = pivot_index; + tree_layers_[layer][i].is_left = elements_[i].height < pivot_height; + if (elements_[i].height < pivot_height) ++pivot_index; + } + nodes_[node_mid].pivot_index = pivot_index; + // TODO(user): stable_partition allocates memory, + // find a way to fill layers without this. + std::stable_partition( + elements_.begin() + range_begin, elements_.begin() + range_end, + [pivot_height](const auto& el) { return el.height < pivot_height; }); + + fill_subtree(fill_subtree, layer + 1, node_begin, node_mid, range_begin, + pivot_index); + fill_subtree(fill_subtree, layer + 1, node_mid, node_end, pivot_index, + range_end); + }; + fill_subtree(fill_subtree, 0, old_node_size, new_node_size, begin_index, + end_index); +} + +int64_t WeightedWaveletTree::RangeSumWithThreshold(int64_t threshold_height, + int begin_index, + int end_index) const { + DCHECK_LE(begin_index, end_index); // Range can be empty, but not reversed. + DCHECK_LE(end_index, tree_location_.size()); + DCHECK_EQ(tree_location_.size(), elements_.size()); // No pending elements. + if (begin_index >= end_index) return 0; + auto [node_begin, node_end, sequence_first_index] = + tree_location_[begin_index]; + DCHECK_EQ(tree_location_[end_index - 1].sequence_first, + sequence_first_index); // Range is included in a single sequence. + ElementRange range{ + .range_first_index = begin_index, + .range_last_index = end_index - 1, + .range_first_is_node_first = begin_index == sequence_first_index}; + // Answer in O(1) for the common case where max(heights) < threshold. + if (nodes_[node_end - 1].pivot_height < threshold_height) return 0; + + int64_t sum = 0; + int64_t min_height_of_current_node = nodes_[node_begin].pivot_height; + for (int l = 0; !range.Empty(); ++l) { + const ElementInfo* elements = tree_layers_[l].data(); + if (threshold_height <= min_height_of_current_node) { + // Query or subquery threshold covers all elements of this node. + // This allows to be O(1) when the query's threshold is <= min(heights). + sum += range.Sum(elements); + return sum; + } else if (node_begin + 1 == node_end) { + // This node is a leaf, its height is < threshold, stop descent here. + return sum; + } + + const int node_mid = node_begin + (node_end - node_begin) / 2; + const auto [pivot_height, pivot_index] = nodes_[node_mid]; + const ElementRange right = range.RightSubRange(elements, pivot_index); + if (threshold_height < pivot_height) { + // All elements of the right child have their height above the threshold, + // we can project the range to the right child and add the whole subrange. + if (!right.Empty()) sum += right.Sum(tree_layers_[l + 1].data()); + // Go to the left child. + range = range.LeftSubRange(elements); + node_end = node_mid; + } else { + // Go to the right child. + range = right; + node_begin = node_mid; + min_height_of_current_node = pivot_height; + } + } + return sum; +} + PathEnergyCostChecker::PathEnergyCostChecker( const PathState* path_state, std::vector force_start_min, std::vector force_end_min, std::vector force_class, diff --git a/ortools/constraint_solver/routing_filters.h b/ortools/constraint_solver/routing_filters.h index 4e372758ff..abbf244ef7 100644 --- a/ortools/constraint_solver/routing_filters.h +++ b/ortools/constraint_solver/routing_filters.h @@ -26,8 +26,8 @@ #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_lp_scheduling.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/bitset.h" namespace operations_research { @@ -84,6 +84,231 @@ LocalSearchFilter* MakeResourceAssignmentFilter( /// Returns a filter checking the current solution using CP propagation. IntVarLocalSearchFilter* MakeCPFeasibilityFilter(RoutingModel* routing_model); +// This class allows making fast range queries on sequences of elements. +// * Main characteristics. +// - queries on sequences of elements {height, weight}, +// parametrized by (begin, end, T), returning +// sum_{i \in [begin, end), S[i].height >= T} S[i].weight +// - O(log (#different heights)) time complexity thanks to an underlying +// wavelet tree (https://en.wikipedia.org/wiki/Wavelet_Tree) +// - holds several sequences at once, can be cleared while still keeping +// allocated memory to avoid allocations. +// More details on these points follow. +// +// * Query complexity. +// The time complexity of a query in S is O(log H), where H is the number of +// different heights appearing in S. +// The particular implementation guarantees that queries that are trivial in +// the .height dimension, that is if threshold_height is <= or >= all heights +// in the range, are O(1). +// +// * Initialization complexity. +// The time complexity of filling the underlying data structures, +// which is done by running MakeTreeFromNewElements(), +// is O(N log N) where N is the number of new elements. +// The space complexity is a O(N log H). +// +// * Usage. +// Given Histogram holding elements with fields {.height, .weight}, +// Histogram hist1 {{2, 3}, {1, 4}, {4, 1}, {2, 2}, {3, 1}, {0, 4}}; +// Histogram hist2 {{-2, -3}, {-1, -4}, {-4, -1}, {-2, -2}}; +// WeightedWaveletTree tree; +// +// for (const auto [height, weight] : hist1]) { +// tree.PushBack(height, weight); +// } +// const int begin1 = tree.TreeSize(); +// tree.MakeTreeFromNewElements(); +// const int end1 = tree.TreeSize(); +// const int begin2 = tree.TreeSize(); // begin2 == end1. +// for (const auto [height, weight] : hist2]) { +// tree.PushBack(height, weight); +// } +// tree.MakeTreeFromNewElements(); +// const int end2 = tree.TreeSize(); +// +// // Sum of weights on whole first sequence, == 3 + 4 + 1 + 2 + 1 + 4 +// tree.RangeSumWithThreshold(/*threshold=*/0, /*begin=*/begin1, /*end=*/end1); +// // Sum of weights on whole second sequence, all heights are negative, +// // so the result is 0. +// tree.RangeSumWithThreshold(/*threshold=*/0, /*begin=*/begin2, /*end=*/end2); +// // This is forbidden, because the range overlaps two sequences. +// tree.RangeSumWithThreshold(/*threshold=*/0, /*begin=*/2, /*end=*/10); +// // Returns 2 = 0 + 1 + 0 + 1. +// tree.RangeSumWithThreshold(/*threshold=*/3, /*begin=*/1, /*end=*/5); +// // Returns -6 = -4 + 0 + -2. +// tree.RangeSumWithThreshold(/*threshold=*/-2, /*begin=*/1, /*end=*/4); +// // Add another sequence. +// Histogram hist3 {{1, 1}, {3, 4}}; +// const int begin3 = tree.TreeSize(); +// for (const auto [height, weight] : hist3) { +// tree.PushBack(height, weight); +// } +// tree.MakeTreeFromNewElements(); +// const int end3 = tree.TreeSize(); +// // Returns 4 = 0 + 4. +// tree.RangeSumWithThreshold(/*threshold=*/2, /*begin=*/begin3, /*end=*/end3); +// // Clear the tree, this invalidates all range queries. +// tree.Clear(); +// // Forbidden! +// tree.RangeSumWithThreshold(/*threshold=*/2, /*begin=*/begin3, /*end=*/end3); +// +// * Implementation. +// This data structure uses two main techniques of the wavelet tree: +// - a binary search tree in the height dimension. +// - nodes only hold information about elements in their height range, +// keeping selected elements in the same order as the full sequence, +// and can map the index of its elements to their left and right child. +// The layout of the tree is packed by separating the tree navigation +// information from the (prefix sum + mapping) information. +// Here is how the tree for heights 6 4 1 3 6 1 7 4 2 is laid out in memory: +// tree_layers_ // nodes_ +// 6 4 1 3 6 1 7 4 2 // 4 +// 1 3 1 2|6 4 6 7 4 // 2 6 +// 1 1|3 2|4 4|6 6 7 // _ 3 _ 7 +// _ _|2|3|_ _|6 6|7 // Dummy information is used to pad holes in nodes_. +// In addition to the mapping information of each element, each node holds +// the prefix sum of weights up to each element, to be able to compute the sum +// of S[i].weight of elements in its height range, for any range, in O(1). +// The data structure does not actually need height information inside the tree +// nodes, and does not store them. +class WeightedWaveletTree { + public: + WeightedWaveletTree() {} + + // Clears all trees, which invalidates all further range queries on currently + // existing trees. This does *not* release memory held by this object. + void Clear(); + + // Returns the total number of elements in trees. + int TreeSize() const { return tree_location_.size(); } + + // Adds an element at index this->Size(). + void PushBack(int64_t height, int64_t weight) { + elements_.push_back({.height = height, .weight = weight}); + } + + // Generates the wavelet tree for all new elements, i.e. elements that were + // added with PushBack() since the latest of these events: construction of + // this object, a previous call to MakeTreeFromNewElements(), or a call to + // Clear(). + // The range of new elements [begin, end), with begin the Size() at the + // latest event, and end the current Size(). + void MakeTreeFromNewElements(); + + // Returns sum_{begin_index <= i < end_index, + // S[i].height >= threshold_height} S[i].weight. + // The range [begin_index, end_index) can only cover elements that were new + // at the same call to MakeTreeFromNewElements(). + // When calling this method, there must be no pending new elements, + // i.e. the last method called must not have been PushBack() or TreeSize(). + int64_t RangeSumWithThreshold(int64_t threshold_height, int begin_index, + int end_index) const; + + private: + // Internal copy of an element. + struct Element { + int64_t height; + int64_t weight; + }; + // Elements are stored in a vector, they are only used during the + // initialization of the data structure. + std::vector elements_; + + // Maps the index of an element to the location of its tree. + // Elements of the same sequence have the same TreeLocation value. + struct TreeLocation { + int node_begin; // index of the first node in the tree in nodes_. + int node_end; // index of the last node in the tree in nodes_, plus 1. + int sequence_first; // index of the first element in all layers. + }; + std::vector tree_location_; + + // A node of the tree is represented by the height of its pivot element and + // the index of its pivot in the layer below, or -1 if the node is a leaf. + struct Node { + int64_t pivot_height; + int pivot_index; + bool operator<(const Node& other) const { + return pivot_height < other.pivot_height; + } + bool operator==(const Node& other) const { + return pivot_height == other.pivot_height; + } + }; + std::vector nodes_; + + // Holds range sum query and mapping information of each element + // in each layer. + // - prefix_sum: sum of weights in this node up to this element, included. + // - left_index: number of elements in the same layer that are either: + // - in a node on the left of this node, or + // - in the same node, preceding this element, mapped to the left subtree. + // Coincides with this element's index in the left subtree if is_left = 1. + // - is_left: 1 if the element is in the left subtree, otherwise 0. + struct ElementInfo { + int64_t prefix_sum; + int left_index : 31; + unsigned int is_left : 1; + }; + // Contains range sum query and mapping data of all elements in their + // respective tree, arranged by layer (depth) in the tree. + // Layer 0 has root data, layer 1 has information of the left child + // then the right child, layer 2 has left-left, left-right, right-left, + // then right-right, etc. + // Trees are stored consecutively, e.g. in each layer, the tree resulting + // from the second MakeTreeFromNewElements() has its root information + // after that of the tree resulting from the first MakeTreeFromNewElements(). + // If a node does not exist, some padding is stored instead. + // Padding allows all layers to store the same number of element information, + // which is one ElementInfo per element of the original sequence. + // The values necessary to navigate the tree are stored in a separate + // structure, in tree_location_ and nodes_. + std::vector> tree_layers_; + + // Represents a range of elements inside a node of a wavelet tree. + // Also provides methods to compute the range sum query corresponding to + // the range, and to project the range to left and right children. + struct ElementRange { + int range_first_index; + int range_last_index; // Last element of the range, inclusive. + // True when the first element of this range is the first element of the + // node. This is tracked to avoid out-of-bounds indices when computing range + // sum queries from prefix sums. + bool range_first_is_node_first; + + bool Empty() const { return range_first_index > range_last_index; } + + int64_t Sum(const ElementInfo* elements) const { + return elements[range_last_index].prefix_sum - + (range_first_is_node_first + ? 0 + : elements[range_first_index - 1].prefix_sum); + } + + ElementRange RightSubRange(const ElementInfo* els, int pivot_index) const { + ElementRange right = { + .range_first_index = + pivot_index + + (range_first_index - els[range_first_index].left_index), + .range_last_index = + pivot_index + + (range_last_index - els[range_last_index].left_index) - + els[range_last_index].is_left, + .range_first_is_node_first = false}; + right.range_first_is_node_first = right.range_first_index == pivot_index; + return right; + } + + ElementRange LeftSubRange(const ElementInfo* els) const { + return {.range_first_index = els[range_first_index].left_index, + .range_last_index = els[range_last_index].left_index - + !els[range_last_index].is_left, + .range_first_is_node_first = range_first_is_node_first}; + } + }; +}; + class PathEnergyCostChecker { public: struct EnergyCost { diff --git a/ortools/constraint_solver/routing_flow.cc b/ortools/constraint_solver/routing_flow.cc index 67e68f6232..f97d23f033 100644 --- a/ortools/constraint_solver/routing_flow.cc +++ b/ortools/constraint_solver/routing_flow.cc @@ -30,8 +30,8 @@ #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_lp_scheduling.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/graph/min_cost_flow.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/saturated_arithmetic.h" namespace operations_research { diff --git a/ortools/constraint_solver/routing_ils.cc b/ortools/constraint_solver/routing_ils.cc index 4ea6964cf9..e40b314e48 100644 --- a/ortools/constraint_solver/routing_ils.cc +++ b/ortools/constraint_solver/routing_ils.cc @@ -30,10 +30,10 @@ #include "ortools/base/protoutil.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_ils.pb.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_search.h" #include "ortools/constraint_solver/routing_types.h" +#include "ortools/routing/ils.pb.h" +#include "ortools/routing/parameters.pb.h" namespace operations_research { namespace { @@ -76,10 +76,17 @@ SavingsFilteredHeuristic::SavingsParameters MakeSavingsParameters( std::unique_ptr MakeRuinProcedure( const RuinRecreateParameters& parameters, RoutingModel* model, std::mt19937* rnd) { + const int num_non_start_end_nodes = model->Size() - model->vehicles(); + const uint32_t preferred_num_neighbors = + parameters.route_selection_neighbors_ratio() * num_non_start_end_nodes; + switch (parameters.ruin_strategy()) { case RuinStrategy::SPATIALLY_CLOSE_ROUTES_REMOVAL: return std::make_unique( - model, rnd, parameters.num_ruined_routes()); + model, rnd, parameters.num_ruined_routes(), + std::min(parameters.route_selection_max_neighbors(), + std::max(parameters.route_selection_min_neighbors(), + preferred_num_neighbors))); break; default: LOG(ERROR) << "Unsupported ruin procedure."; @@ -162,9 +169,12 @@ class GreedyDescentAcceptanceCriterion : public NeighborAcceptanceCriterion { class CoolingSchedule { public: CoolingSchedule(NeighborAcceptanceCriterion::SearchState final_search_state, - double initial_temperature) + double initial_temperature, double final_temperature) : final_search_state_(std::move(final_search_state)), - initial_temperature_(initial_temperature) {} + initial_temperature_(initial_temperature), + final_temperature_(final_temperature) { + DCHECK_GE(initial_temperature_, final_temperature_); + } virtual ~CoolingSchedule() = default; // Returns the temperature according to given search state. @@ -172,8 +182,24 @@ class CoolingSchedule { const NeighborAcceptanceCriterion::SearchState& search_state) const = 0; protected: + // Returns the progress of the given search state with respect to the final + // search state. + double GetProgress( + const NeighborAcceptanceCriterion::SearchState& search_state) const { + const double duration_progress = + absl::FDivDuration(search_state.duration, final_search_state_.duration); + const double solutions_progress = + static_cast(search_state.solutions) / + final_search_state_.solutions; + const double progress = std::max(duration_progress, solutions_progress); + // We take the min with 1 as at the end of the search we may go a bit above + // 1 with duration_progress depending on when we check the time limit. + return std::min(1.0, progress); + } + const NeighborAcceptanceCriterion::SearchState final_search_state_; const double initial_temperature_; + const double final_temperature_; }; // A cooling schedule that lowers the temperature in an exponential way. @@ -182,20 +208,14 @@ class ExponentialCoolingSchedule : public CoolingSchedule { ExponentialCoolingSchedule( NeighborAcceptanceCriterion::SearchState final_search_state, double initial_temperature, double final_temperature) - : CoolingSchedule(std::move(final_search_state), initial_temperature), + : CoolingSchedule(std::move(final_search_state), initial_temperature, + final_temperature), temperature_ratio_(final_temperature / initial_temperature) {} double GetTemperature(const NeighborAcceptanceCriterion::SearchState& search_state) const override { - const double duration_progress = - absl::FDivDuration(search_state.duration, final_search_state_.duration); - const double solutions_progress = - static_cast(search_state.solutions) / - final_search_state_.solutions; - // We take the min with 1 as at the end of the search we may go a bit above - // 1 with duration_progress depending on when we check the time limit. - const double progress = - std::min(1.0, std::max(duration_progress, solutions_progress)); + const double progress = GetProgress(search_state); + return initial_temperature_ * std::pow(temperature_ratio_, progress); } @@ -203,6 +223,23 @@ class ExponentialCoolingSchedule : public CoolingSchedule { const double temperature_ratio_; }; +// A cooling schedule that lowers the temperature in a linear way. +class LinearCoolingSchedule : public CoolingSchedule { + public: + LinearCoolingSchedule( + NeighborAcceptanceCriterion::SearchState final_search_state, + double initial_temperature, double final_temperature) + : CoolingSchedule(std::move(final_search_state), initial_temperature, + final_temperature) {} + + double GetTemperature(const NeighborAcceptanceCriterion::SearchState& + search_state) const override { + const double progress = GetProgress(search_state); + return initial_temperature_ - + progress * (initial_temperature_ - final_temperature_); + } +}; + std::unique_ptr MakeCoolingSchedule( const RoutingSearchParameters& parameters) { const absl::Duration final_duration = @@ -214,12 +251,19 @@ std::unique_ptr MakeCoolingSchedule( parameters.iterated_local_search_parameters() .simulated_annealing_parameters(); + NeighborAcceptanceCriterion::SearchState final_search_state{ + final_duration, parameters.solution_limit()}; + switch (sa_params.cooling_schedule_strategy()) { case CoolingScheduleStrategy::EXPONENTIAL: return std::make_unique( NeighborAcceptanceCriterion::SearchState{final_duration, parameters.solution_limit()}, sa_params.initial_temperature(), sa_params.final_temperature()); + case CoolingScheduleStrategy::LINEAR: + return std::make_unique( + std::move(final_search_state), sa_params.initial_temperature(), + sa_params.final_temperature()); default: LOG(ERROR) << "Unsupported cooling schedule strategy."; return nullptr; @@ -255,10 +299,11 @@ class SimulatedAnnealingAcceptanceCriterion } // namespace CloseRoutesRemovalRuinProcedure::CloseRoutesRemovalRuinProcedure( - RoutingModel* model, std::mt19937* rnd, size_t num_routes) + RoutingModel* model, std::mt19937* rnd, size_t num_routes, + int num_neighbors_for_route_selection) : model_(*model), neighbors_manager_(model->GetOrCreateNodeNeighborsByCostClass( - /*TODO(user): use a parameter*/ 100, + num_neighbors_for_route_selection, /*add_vehicle_starts_to_neighbors=*/false)), num_routes_(num_routes), rnd_(*rnd), @@ -278,6 +323,8 @@ std::function CloseRoutesRemovalRuinProcedure::Ruin( } while (model_.IsStart(seed_node) || seed_route == -1); DCHECK(!model_.IsEnd(seed_node)); + removed_routes_.Set(seed_route); + const RoutingCostClassIndex cost_class_index = model_.GetCostClassIndexOfVehicle(seed_route); @@ -286,15 +333,15 @@ std::function CloseRoutesRemovalRuinProcedure::Ruin( cost_class_index.value(), seed_node); for (int neighbor : neighbors) { + if (removed_routes_.NumberOfSetCallsWithDifferentArguments() == + num_routes_) { + break; + } const int64_t route = assignment->Value(model_.VehicleVar(neighbor)); if (route < 0 || removed_routes_[route]) { continue; } removed_routes_.Set(route); - if (removed_routes_.NumberOfSetCallsWithDifferentArguments() == - num_routes_) { - break; - } } } @@ -375,7 +422,7 @@ DecisionBuilder* MakePerturbationDecisionBuilder( case PerturbationStrategy::RUIN_AND_RECREATE: return MakeRuinAndRecreateDecisionBuilder( parameters, model, rnd, assignment, std::move(stop_search), - filter_manager); + filter_manager); default: LOG(ERROR) << "Unsupported perturbation strategy."; return nullptr; diff --git a/ortools/constraint_solver/routing_ils.h b/ortools/constraint_solver/routing_ils.h index 57e3aeaa4e..7ff002f340 100644 --- a/ortools/constraint_solver/routing_ils.h +++ b/ortools/constraint_solver/routing_ils.h @@ -23,7 +23,7 @@ #include "absl/time/time.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/bitset.h" namespace operations_research { @@ -40,7 +40,8 @@ class RuinProcedure { class CloseRoutesRemovalRuinProcedure : public RuinProcedure { public: CloseRoutesRemovalRuinProcedure(RoutingModel* model, std::mt19937* rnd, - size_t num_routes); + size_t num_routes, + int num_neighbors_for_route_selection); // Returns next accessors where at most num_routes routes have been shortcut, // i.e., next(shortcut route begin) = shortcut route end. // Next accessors for customers belonging to shortcut routes are still set to diff --git a/ortools/constraint_solver/routing_index_manager.h b/ortools/constraint_solver/routing_index_manager.h index be84c60423..c44f3e6e12 100644 --- a/ortools/constraint_solver/routing_index_manager.h +++ b/ortools/constraint_solver/routing_index_manager.h @@ -14,13 +14,12 @@ #ifndef OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_INDEX_MANAGER_H_ #define OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_INDEX_MANAGER_H_ +#include #include #include #include "absl/log/check.h" -#include "ortools/base/logging.h" #include "ortools/base/strong_vector.h" -#include "ortools/base/types.h" #include "ortools/constraint_solver/routing_types.h" namespace operations_research { diff --git a/ortools/constraint_solver/routing_lp_scheduling.cc b/ortools/constraint_solver/routing_lp_scheduling.cc index c2536293ab..f1b441a0a7 100644 --- a/ortools/constraint_solver/routing_lp_scheduling.cc +++ b/ortools/constraint_solver/routing_lp_scheduling.cc @@ -43,10 +43,11 @@ #include "ortools/base/types.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/glop/parameters.pb.h" #include "ortools/graph/ebert_graph.h" #include "ortools/graph/min_cost_flow.h" +#include "ortools/port/proto_utils.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/sat/cp_model.pb.h" #include "ortools/sat/lp_utils.h" #include "ortools/util/flat_matrix.h" @@ -2544,7 +2545,7 @@ bool DimensionCumulOptimizerCore::SetGlobalConstraintsForResourceAssignment( const auto& add_domain_constraint = [&solver, cumul_offset, assign_rc_to_v](const Domain& domain, - int cumul_variable) { + int cumul_variable) { if (domain == Domain::AllValues()) { return; } @@ -3141,7 +3142,7 @@ std::string ConstraintToString(const sat::ConstraintProto& constraint, } } } else { - s += constraint.ShortDebugString(); + s += ProtobufShortDebugString(constraint); } return s; } diff --git a/ortools/constraint_solver/routing_lp_scheduling.h b/ortools/constraint_solver/routing_lp_scheduling.h index b93e124055..6a76cfa3de 100644 --- a/ortools/constraint_solver/routing_lp_scheduling.h +++ b/ortools/constraint_solver/routing_lp_scheduling.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -32,15 +31,16 @@ #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" -#include "ortools/base/dump_vars.h" +#include "absl/types/span.h" #include "ortools/base/logging.h" #include "ortools/base/mathutil.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/glop/lp_solver.h" #include "ortools/glop/parameters.pb.h" #include "ortools/lp_data/lp_data.h" #include "ortools/lp_data/lp_types.h" +#include "ortools/port/proto_utils.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/sat/cp_model.pb.h" #include "ortools/sat/cp_model_solver.h" #include "ortools/sat/model.h" @@ -588,7 +588,7 @@ class RoutingCPSatWrapper : public RoutingLinearSolverWrapper { } DimensionSchedulingStatus Solve(absl::Duration duration_limit) override { parameters_.set_max_time_in_seconds(absl::ToDoubleSeconds(duration_limit)); - VLOG(2) << model_.DebugString(); + VLOG(2) << ProtobufDebugString(model_); if (hint_.vars_size() == model_.variables_size()) { *model_.mutable_solution_hint() = hint_; } diff --git a/ortools/constraint_solver/routing_parameters.cc b/ortools/constraint_solver/routing_parameters.cc index eafdcbf625..6c640654ca 100644 --- a/ortools/constraint_solver/routing_parameters.cc +++ b/ortools/constraint_solver/routing_parameters.cc @@ -28,10 +28,11 @@ #include "ortools/base/protoutil.h" #include "ortools/base/types.h" #include "ortools/constraint_solver/constraint_solver.h" -#include "ortools/constraint_solver/routing_enums.pb.h" -#include "ortools/constraint_solver/routing_ils.pb.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/solver_parameters.pb.h" +#include "ortools/port/proto_utils.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/ils.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/sat/sat_parameters.pb.h" #include "ortools/util/optional_boolean.pb.h" #include "ortools/util/testing_utils.h" @@ -58,6 +59,9 @@ IteratedLocalSearchParameters CreateDefaultIteratedLocalSearchParameters() { rr->set_ruin_strategy(RuinStrategy::SPATIALLY_CLOSE_ROUTES_REMOVAL); rr->set_recreate_strategy(FirstSolutionStrategy::LOCAL_CHEAPEST_INSERTION); rr->set_num_ruined_routes(2); + rr->set_route_selection_neighbors_ratio(1.0); + rr->set_route_selection_min_neighbors(10); + rr->set_route_selection_max_neighbors(100); ils.set_improve_perturbed_solution(true); ils.set_acceptance_strategy(AcceptanceStrategy::GREEDY_DESCENT); SimulatedAnnealingParameters* sa = @@ -281,16 +285,33 @@ void FindErrorsInIteratedLocalSearchParameters( rr.ruin_strategy())); } - if (rr.ruin_strategy() == RuinStrategy::SPATIALLY_CLOSE_ROUTES_REMOVAL && - rr.num_ruined_routes() <= 0) { - errors.emplace_back( - StrCat("iterated_local_search_parameters.ruin_recreate_parameters." - "ruin_strategy is set to ", - rr.ruin_strategy(), - " but " - "iterated_local_search_parameters.ruin_recreate_parameters." - "num_ruined_routes is ", - rr.num_ruined_routes())); + if (rr.ruin_strategy() == RuinStrategy::SPATIALLY_CLOSE_ROUTES_REMOVAL) { + if (rr.num_ruined_routes() <= 0) { + errors.emplace_back( + StrCat("iterated_local_search_parameters.ruin_recreate_parameters." + "ruin_strategy is set to ", + rr.ruin_strategy(), + " but " + "iterated_local_search_parameters.ruin_recreate_parameters." + "num_ruined_routes is ", + rr.num_ruined_routes())); + } + if (const double ratio = rr.route_selection_neighbors_ratio(); + std::isnan(ratio) || ratio < 0 || ratio > 1) { + errors.emplace_back( + StrCat("Invalid " + "iterated_local_search_parameters.ruin_recreate_parameters." + "route_selection_neighbors_ratio: ", + ratio)); + } + if (rr.route_selection_min_neighbors() > + rr.route_selection_max_neighbors()) { + errors.emplace_back( + StrCat("iterated_local_search_parameters.ruin_recreate_parameters." + "route_selection_min_neighbors cannot be greater than " + "iterated_local_search_parameters.ruin_recreate_parameters." + "route_selection_max_neighbors")); + } } if (rr.recreate_strategy() == FirstSolutionStrategy::UNSET) { @@ -501,12 +522,14 @@ std::vector FindErrorsInRoutingSearchParameters( if (const int64_t lim = search_parameters.solution_limit(); lim < 1) errors.emplace_back(StrCat("Invalid solution_limit: ", lim)); if (!IsValidNonNegativeDuration(search_parameters.time_limit())) { - errors.emplace_back("Invalid time_limit: " + - search_parameters.time_limit().ShortDebugString()); + errors.emplace_back( + "Invalid time_limit: " + + ProtobufShortDebugString(search_parameters.time_limit())); } if (!IsValidNonNegativeDuration(search_parameters.lns_time_limit())) { - errors.emplace_back("Invalid lns_time_limit: " + - search_parameters.lns_time_limit().ShortDebugString()); + errors.emplace_back( + "Invalid lns_time_limit: " + + ProtobufShortDebugString(search_parameters.lns_time_limit())); } if (const double ratio = search_parameters.secondary_ls_time_limit_ratio(); std::isnan(ratio) || ratio < 0 || ratio >= 1) { diff --git a/ortools/constraint_solver/routing_parameters.h b/ortools/constraint_solver/routing_parameters.h index a8dc536adc..6b2204ba79 100644 --- a/ortools/constraint_solver/routing_parameters.h +++ b/ortools/constraint_solver/routing_parameters.h @@ -17,7 +17,7 @@ #include #include -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" namespace operations_research { diff --git a/ortools/constraint_solver/routing_sat.cc b/ortools/constraint_solver/routing_sat.cc index 3e9508ec92..00c44c0bea 100644 --- a/ortools/constraint_solver/routing_sat.cc +++ b/ortools/constraint_solver/routing_sat.cc @@ -29,8 +29,8 @@ #include "ortools/base/map_util.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/sat/cp_model.pb.h" #include "ortools/sat/cp_model_solver.h" #include "ortools/sat/integer.h" diff --git a/ortools/constraint_solver/routing_search.cc b/ortools/constraint_solver/routing_search.cc index 497b137a0a..fff661054a 100644 --- a/ortools/constraint_solver/routing_search.cc +++ b/ortools/constraint_solver/routing_search.cc @@ -51,11 +51,11 @@ #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" #include "ortools/constraint_solver/routing_utils.h" #include "ortools/graph/christofides.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/util/bitset.h" #include "ortools/util/range_query_function.h" #include "ortools/util/saturated_arithmetic.h" diff --git a/ortools/constraint_solver/routing_search.h b/ortools/constraint_solver/routing_search.h index 34ee65103a..0ad3b36e53 100644 --- a/ortools/constraint_solver/routing_search.h +++ b/ortools/constraint_solver/routing_search.h @@ -41,10 +41,10 @@ #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/constraint_solver/routing_types.h" #include "ortools/constraint_solver/routing_utils.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" namespace operations_research { diff --git a/ortools/constraint_solver/samples/BUILD.bazel b/ortools/constraint_solver/samples/BUILD.bazel index 1ba9c188d1..5214884b26 100644 --- a/ortools/constraint_solver/samples/BUILD.bazel +++ b/ortools/constraint_solver/samples/BUILD.bazel @@ -13,50 +13,50 @@ load(":code_samples.bzl", "code_sample_cc") -code_sample_cc(name = "minimal_jobshop_cp") +code_sample_cc(name="minimal_jobshop_cp") -code_sample_cc(name = "nqueens_cp") +code_sample_cc(name="nqueens_cp") -code_sample_cc(name = "nurses_cp") +code_sample_cc(name="nurses_cp") -code_sample_cc(name = "rabbits_and_pheasants_cp") +code_sample_cc(name="rabbits_and_pheasants_cp") -code_sample_cc(name = "simple_cp_program") +code_sample_cc(name="simple_cp_program") -code_sample_cc(name = "simple_ls_program") +code_sample_cc(name="simple_ls_program") -code_sample_cc(name = "simple_routing_program") +code_sample_cc(name="simple_routing_program") -code_sample_cc(name = "tsp") +code_sample_cc(name="tsp") -code_sample_cc(name = "tsp_circuit_board") +code_sample_cc(name="tsp_circuit_board") -code_sample_cc(name = "tsp_cities") +code_sample_cc(name="tsp_cities") -code_sample_cc(name = "tsp_distance_matrix") +code_sample_cc(name="tsp_distance_matrix") -code_sample_cc(name = "vrp") +code_sample_cc(name="vrp") -code_sample_cc(name = "vrp_breaks") +code_sample_cc(name="vrp_breaks") -code_sample_cc(name = "vrp_capacity") +code_sample_cc(name="vrp_capacity") -code_sample_cc(name = "vrp_drop_nodes") +code_sample_cc(name="vrp_drop_nodes") -code_sample_cc(name = "vrp_global_span") +code_sample_cc(name="vrp_global_span") -code_sample_cc(name = "vrp_initial_routes") +code_sample_cc(name="vrp_initial_routes") -code_sample_cc(name = "vrp_pickup_delivery") +code_sample_cc(name="vrp_pickup_delivery") -code_sample_cc(name = "vrp_pickup_delivery_fifo") +code_sample_cc(name="vrp_pickup_delivery_fifo") -code_sample_cc(name = "vrp_pickup_delivery_lifo") +code_sample_cc(name="vrp_pickup_delivery_lifo") -code_sample_cc(name = "vrp_resources") +code_sample_cc(name="vrp_resources") -code_sample_cc(name = "vrp_starts_ends") +code_sample_cc(name="vrp_starts_ends") -code_sample_cc(name = "vrp_time_windows") +code_sample_cc(name="vrp_time_windows") -code_sample_cc(name = "vrp_with_time_limit") +code_sample_cc(name="vrp_with_time_limit") diff --git a/ortools/constraint_solver/samples/SimpleRoutingProgram.cs b/ortools/constraint_solver/samples/SimpleRoutingProgram.cs index de914bf0cf..fd5d86087f 100644 --- a/ortools/constraint_solver/samples/SimpleRoutingProgram.cs +++ b/ortools/constraint_solver/samples/SimpleRoutingProgram.cs @@ -15,6 +15,7 @@ // [START import] using System; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/SimpleRoutingProgram.java b/ortools/constraint_solver/samples/SimpleRoutingProgram.java index 5e45bd1400..10041d72cc 100644 --- a/ortools/constraint_solver/samples/SimpleRoutingProgram.java +++ b/ortools/constraint_solver/samples/SimpleRoutingProgram.java @@ -18,11 +18,11 @@ import static java.lang.Math.abs; import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; +import com.google.ortools.routing.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/Tsp.cs b/ortools/constraint_solver/samples/Tsp.cs index 5911a373d0..354475edb5 100644 --- a/ortools/constraint_solver/samples/Tsp.cs +++ b/ortools/constraint_solver/samples/Tsp.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/Tsp.java b/ortools/constraint_solver/samples/Tsp.java index f1d12862c1..61a4cc030d 100644 --- a/ortools/constraint_solver/samples/Tsp.java +++ b/ortools/constraint_solver/samples/Tsp.java @@ -18,12 +18,12 @@ import static java.lang.Math.abs; import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; -import com.google.ortools.constraintsolver.RoutingSearchStatus; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; +import com.google.ortools.routing.RoutingSearchStatus; import java.util.function.LongBinaryOperator; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/TspCircuitBoard.cs b/ortools/constraint_solver/samples/TspCircuitBoard.cs index f70bba6495..b167ebb03e 100644 --- a/ortools/constraint_solver/samples/TspCircuitBoard.cs +++ b/ortools/constraint_solver/samples/TspCircuitBoard.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/TspCircuitBoard.java b/ortools/constraint_solver/samples/TspCircuitBoard.java index 508c8afbd7..c396d52c65 100644 --- a/ortools/constraint_solver/samples/TspCircuitBoard.java +++ b/ortools/constraint_solver/samples/TspCircuitBoard.java @@ -13,14 +13,15 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/TspCities.cs b/ortools/constraint_solver/samples/TspCities.cs index 3ce6979851..c7922d6157 100644 --- a/ortools/constraint_solver/samples/TspCities.cs +++ b/ortools/constraint_solver/samples/TspCities.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/TspCities.java b/ortools/constraint_solver/samples/TspCities.java index 238a28862a..97bf7a4068 100644 --- a/ortools/constraint_solver/samples/TspCities.java +++ b/ortools/constraint_solver/samples/TspCities.java @@ -13,14 +13,15 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/TspDistanceMatrix.cs b/ortools/constraint_solver/samples/TspDistanceMatrix.cs index 8bcfd289ee..1a1ccb00c4 100644 --- a/ortools/constraint_solver/samples/TspDistanceMatrix.cs +++ b/ortools/constraint_solver/samples/TspDistanceMatrix.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/TspDistanceMatrix.java b/ortools/constraint_solver/samples/TspDistanceMatrix.java index 30631806e6..f2d345b6e1 100644 --- a/ortools/constraint_solver/samples/TspDistanceMatrix.java +++ b/ortools/constraint_solver/samples/TspDistanceMatrix.java @@ -13,14 +13,15 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/Vrp.cs b/ortools/constraint_solver/samples/Vrp.cs index bab505f511..58f12a46c6 100644 --- a/ortools/constraint_solver/samples/Vrp.cs +++ b/ortools/constraint_solver/samples/Vrp.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/Vrp.java b/ortools/constraint_solver/samples/Vrp.java index d8e309fbc9..04c968d82b 100644 --- a/ortools/constraint_solver/samples/Vrp.java +++ b/ortools/constraint_solver/samples/Vrp.java @@ -13,15 +13,16 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; -import com.google.ortools.constraintsolver.RoutingSearchStatus; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchStatus; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpBreaks.cs b/ortools/constraint_solver/samples/VrpBreaks.cs index 5d24d1c30b..1d8513057c 100644 --- a/ortools/constraint_solver/samples/VrpBreaks.cs +++ b/ortools/constraint_solver/samples/VrpBreaks.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpBreaks.java b/ortools/constraint_solver/samples/VrpBreaks.java index f5280cc19c..ad802194de 100644 --- a/ortools/constraint_solver/samples/VrpBreaks.java +++ b/ortools/constraint_solver/samples/VrpBreaks.java @@ -13,20 +13,21 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.AssignmentIntervalContainer; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.IntVar; import com.google.ortools.constraintsolver.IntervalVar; import com.google.ortools.constraintsolver.IntervalVarElement; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.Solver; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpCapacity.cs b/ortools/constraint_solver/samples/VrpCapacity.cs index 585d485430..6e1adc8b7b 100644 --- a/ortools/constraint_solver/samples/VrpCapacity.cs +++ b/ortools/constraint_solver/samples/VrpCapacity.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; using Google.Protobuf.WellKnownTypes; // Duration // [END import] diff --git a/ortools/constraint_solver/samples/VrpCapacity.java b/ortools/constraint_solver/samples/VrpCapacity.java index ce3148f25c..1c602cd3d0 100644 --- a/ortools/constraint_solver/samples/VrpCapacity.java +++ b/ortools/constraint_solver/samples/VrpCapacity.java @@ -13,15 +13,16 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.LocalSearchMetaheuristic; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.LocalSearchMetaheuristic; +import com.google.ortools.routing.RoutingSearchParameters; import com.google.protobuf.Duration; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpDropNodes.cs b/ortools/constraint_solver/samples/VrpDropNodes.cs index 073080a9db..bd7fadbee3 100644 --- a/ortools/constraint_solver/samples/VrpDropNodes.cs +++ b/ortools/constraint_solver/samples/VrpDropNodes.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; using Google.Protobuf.WellKnownTypes; // Duration // [END import] diff --git a/ortools/constraint_solver/samples/VrpDropNodes.java b/ortools/constraint_solver/samples/VrpDropNodes.java index 1c573c8224..40cadd9dc7 100644 --- a/ortools/constraint_solver/samples/VrpDropNodes.java +++ b/ortools/constraint_solver/samples/VrpDropNodes.java @@ -13,15 +13,16 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.LocalSearchMetaheuristic; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.LocalSearchMetaheuristic; +import com.google.ortools.routing.RoutingSearchParameters; import com.google.protobuf.Duration; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpGlobalSpan.cs b/ortools/constraint_solver/samples/VrpGlobalSpan.cs index 6628907e9d..9806f02678 100644 --- a/ortools/constraint_solver/samples/VrpGlobalSpan.cs +++ b/ortools/constraint_solver/samples/VrpGlobalSpan.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpGlobalSpan.java b/ortools/constraint_solver/samples/VrpGlobalSpan.java index 7a55063fe0..ccc1b21547 100644 --- a/ortools/constraint_solver/samples/VrpGlobalSpan.java +++ b/ortools/constraint_solver/samples/VrpGlobalSpan.java @@ -13,15 +13,16 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpInitialRoutes.cs b/ortools/constraint_solver/samples/VrpInitialRoutes.cs index fa3bda4277..098242c743 100644 --- a/ortools/constraint_solver/samples/VrpInitialRoutes.cs +++ b/ortools/constraint_solver/samples/VrpInitialRoutes.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpInitialRoutes.java b/ortools/constraint_solver/samples/VrpInitialRoutes.java index 6c75910221..07f86b891e 100644 --- a/ortools/constraint_solver/samples/VrpInitialRoutes.java +++ b/ortools/constraint_solver/samples/VrpInitialRoutes.java @@ -13,14 +13,15 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpPickupDelivery.cs b/ortools/constraint_solver/samples/VrpPickupDelivery.cs index d68f7177b9..6d004ee78b 100644 --- a/ortools/constraint_solver/samples/VrpPickupDelivery.cs +++ b/ortools/constraint_solver/samples/VrpPickupDelivery.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpPickupDelivery.java b/ortools/constraint_solver/samples/VrpPickupDelivery.java index d64fad8dfe..f459d6f61c 100644 --- a/ortools/constraint_solver/samples/VrpPickupDelivery.java +++ b/ortools/constraint_solver/samples/VrpPickupDelivery.java @@ -13,16 +13,17 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.Solver; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.FirstSolutionStrategy; +import com.google.ortools.routing.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.cs b/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.cs index a97889b63c..4aa9cc8179 100644 --- a/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.cs +++ b/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.java b/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.java index 6c365643be..93efc266e5 100644 --- a/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.java +++ b/ortools/constraint_solver/samples/VrpPickupDeliveryFifo.java @@ -13,16 +13,17 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.Solver; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.cs b/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.cs index acc157d90b..e0c43da2d4 100644 --- a/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.cs +++ b/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.cs @@ -16,10 +16,11 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// -/// Minimal Pickup & Delivery Problem (PDP). +/// Minimal Pickup & Delivery Problem (PDP). /// public class VrpPickupDeliveryLifo { diff --git a/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.java b/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.java index 0c55f1dba2..d36f10053a 100644 --- a/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.java +++ b/ortools/constraint_solver/samples/VrpPickupDeliveryLifo.java @@ -13,16 +13,17 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.Solver; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpResources.cs b/ortools/constraint_solver/samples/VrpResources.cs index bbfc8952b6..6e752fa43a 100644 --- a/ortools/constraint_solver/samples/VrpResources.cs +++ b/ortools/constraint_solver/samples/VrpResources.cs @@ -17,6 +17,7 @@ using System; using System.Linq; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpResources.java b/ortools/constraint_solver/samples/VrpResources.java index 10f08a3dd1..0a26091631 100644 --- a/ortools/constraint_solver/samples/VrpResources.java +++ b/ortools/constraint_solver/samples/VrpResources.java @@ -13,18 +13,19 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.IntVar; import com.google.ortools.constraintsolver.IntervalVar; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.Solver; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.Arrays; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpSolutionCallback.cs b/ortools/constraint_solver/samples/VrpSolutionCallback.cs index 9bb8ceec5d..40432e9f55 100644 --- a/ortools/constraint_solver/samples/VrpSolutionCallback.cs +++ b/ortools/constraint_solver/samples/VrpSolutionCallback.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; using Google.Protobuf.WellKnownTypes; // Duration // [END import] diff --git a/ortools/constraint_solver/samples/VrpSolutionCallback.java b/ortools/constraint_solver/samples/VrpSolutionCallback.java index ad9e879665..13b63c8e65 100644 --- a/ortools/constraint_solver/samples/VrpSolutionCallback.java +++ b/ortools/constraint_solver/samples/VrpSolutionCallback.java @@ -13,16 +13,17 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.LocalSearchMetaheuristic; -import com.google.ortools.constraintsolver.RoutingDimension; -import com.google.ortools.constraintsolver.RoutingIndexManager; -import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; -import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Enums.LocalSearchMetaheuristic; +import com.google.ortools.routing.Globals; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; +import com.google.ortools.routing.RoutingDimension; +import com.google.ortools.routing.RoutingIndexManager; +import com.google.ortools.routing.RoutingModel; import com.google.protobuf.Duration; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpStartsEnds.cs b/ortools/constraint_solver/samples/VrpStartsEnds.cs index b98892df28..9dc1122cd2 100644 --- a/ortools/constraint_solver/samples/VrpStartsEnds.cs +++ b/ortools/constraint_solver/samples/VrpStartsEnds.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] /// diff --git a/ortools/constraint_solver/samples/VrpStartsEnds.java b/ortools/constraint_solver/samples/VrpStartsEnds.java index cdeed144db..05c7003d33 100644 --- a/ortools/constraint_solver/samples/VrpStartsEnds.java +++ b/ortools/constraint_solver/samples/VrpStartsEnds.java @@ -13,15 +13,16 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpTimeWindows.cs b/ortools/constraint_solver/samples/VrpTimeWindows.cs index 783a91cb58..188004739e 100644 --- a/ortools/constraint_solver/samples/VrpTimeWindows.cs +++ b/ortools/constraint_solver/samples/VrpTimeWindows.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; // [END import] // [START program_part1] diff --git a/ortools/constraint_solver/samples/VrpTimeWindows.java b/ortools/constraint_solver/samples/VrpTimeWindows.java index 8c3fec554b..f34faa9e60 100644 --- a/ortools/constraint_solver/samples/VrpTimeWindows.java +++ b/ortools/constraint_solver/samples/VrpTimeWindows.java @@ -13,16 +13,17 @@ // [START program] package com.google.ortools.constraintsolver.samples; + // [START import] import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; import com.google.ortools.constraintsolver.IntVar; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/VrpWithTimeLimit.cs b/ortools/constraint_solver/samples/VrpWithTimeLimit.cs index b1dce90694..e699f8d233 100644 --- a/ortools/constraint_solver/samples/VrpWithTimeLimit.cs +++ b/ortools/constraint_solver/samples/VrpWithTimeLimit.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using Google.OrTools.ConstraintSolver; +using Google.OrTools.Routing; using Google.Protobuf.WellKnownTypes; // Duration // [END import] diff --git a/ortools/constraint_solver/samples/VrpWithTimeLimit.java b/ortools/constraint_solver/samples/VrpWithTimeLimit.java index d09f09006c..5f7505f679 100644 --- a/ortools/constraint_solver/samples/VrpWithTimeLimit.java +++ b/ortools/constraint_solver/samples/VrpWithTimeLimit.java @@ -18,13 +18,13 @@ import static java.lang.Math.max; import com.google.ortools.Loader; import com.google.ortools.constraintsolver.Assignment; -import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.LocalSearchMetaheuristic; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; -import com.google.ortools.constraintsolver.RoutingSearchParameters; import com.google.ortools.constraintsolver.main; +import com.google.ortools.routing.Enums.FirstSolutionStrategy; +import com.google.ortools.routing.Enums.LocalSearchMetaheuristic; +import com.google.ortools.routing.Parameters.RoutingSearchParameters; import com.google.protobuf.Duration; import java.util.logging.Logger; // [END import] diff --git a/ortools/constraint_solver/samples/code_samples.bzl b/ortools/constraint_solver/samples/code_samples.bzl index 6c86853446..3eacc96df9 100644 --- a/ortools/constraint_solver/samples/code_samples.bzl +++ b/ortools/constraint_solver/samples/code_samples.bzl @@ -15,25 +15,25 @@ def code_sample_cc(name): native.cc_binary( - name = name + "_cc", - srcs = [name + ".cc"], - deps = [ + name=name + "_cc", + srcs=[name + ".cc"], + deps=[ "//ortools/base", "//ortools/constraint_solver:cp", "//ortools/constraint_solver:routing", - "//ortools/constraint_solver:routing_enums_cc_proto", + "//ortools/routing:enums_cc_proto", ], ) native.cc_test( - name = name + "_cc_test", - size = "small", - srcs = [name + ".cc"], - deps = [ + name=name + "_cc_test", + size="small", + srcs=[name + ".cc"], + deps=[ ":" + name + "_cc", "//ortools/base", "//ortools/constraint_solver:cp", "//ortools/constraint_solver:routing", - "//ortools/constraint_solver:routing_enums_cc_proto", + "//ortools/routing:enums_cc_proto", ], ) diff --git a/ortools/constraint_solver/samples/cvrp_reload.py b/ortools/constraint_solver/samples/cvrp_reload.py index 111fa5db6d..9561f79b0c 100755 --- a/ortools/constraint_solver/samples/cvrp_reload.py +++ b/ortools/constraint_solver/samples/cvrp_reload.py @@ -15,31 +15,31 @@ # limitations under the License. """Capacitated Vehicle Routing Problem (CVRP). - This is a sample using the routing library python wrapper to solve a CVRP - problem while allowing multiple trips, i.e., vehicles can return to a depot - to reset their load ("reload"). +This is a sample using the routing library python wrapper to solve a CVRP +problem while allowing multiple trips, i.e., vehicles can return to a depot +to reset their load ("reload"). - A description of the CVRP problem can be found here: - http://en.wikipedia.org/wiki/Vehicle_routing_problem. +A description of the CVRP problem can be found here: +http://en.wikipedia.org/wiki/Vehicle_routing_problem. - Distances are in meters. +Distances are in meters. - In order to implement multiple trips, new nodes are introduced at the same - locations of the original depots. These additional nodes can be dropped - from the schedule at 0 cost. +In order to implement multiple trips, new nodes are introduced at the same +locations of the original depots. These additional nodes can be dropped +from the schedule at 0 cost. - The max_slack parameter associated to the capacity constraints of all nodes - can be set to be the maximum of the vehicles' capacities, rather than 0 like - in a traditional CVRP. Slack is required since before a solution is found, - it is not known how much capacity will be transferred at the new nodes. For - all the other (original) nodes, the slack is then re-set to 0. +The max_slack parameter associated to the capacity constraints of all nodes +can be set to be the maximum of the vehicles' capacities, rather than 0 like +in a traditional CVRP. Slack is required since before a solution is found, +it is not known how much capacity will be transferred at the new nodes. For +all the other (original) nodes, the slack is then re-set to 0. - The above two considerations are implemented in `add_capacity_constraints()`. +The above two considerations are implemented in `add_capacity_constraints()`. - Last, it is useful to set a large distance between the initial depot and the - new nodes introduced, to avoid schedules having spurious transits through - those new nodes unless it's necessary to reload. This consideration is taken - into account in `create_distance_evaluator()`. +Last, it is useful to set a large distance between the initial depot and the +new nodes introduced, to avoid schedules having spurious transits through +those new nodes unless it's necessary to reload. This consideration is taken +into account in `create_distance_evaluator()`. """ from functools import partial diff --git a/ortools/constraint_solver/samples/cvrptw_break.py b/ortools/constraint_solver/samples/cvrptw_break.py index 61497ce5bd..b6b58c8027 100755 --- a/ortools/constraint_solver/samples/cvrptw_break.py +++ b/ortools/constraint_solver/samples/cvrptw_break.py @@ -15,18 +15,18 @@ # [START program] """Capacitated Vehicle Routing Problem with Time Windows (CVRPTW). - This is a sample using the routing library python wrapper to solve a CVRPTW - problem. - A description of the problem can be found here: - http://en.wikipedia.org/wiki/Vehicle_routing_problem. +This is a sample using the routing library python wrapper to solve a CVRPTW +problem. +A description of the problem can be found here: +http://en.wikipedia.org/wiki/Vehicle_routing_problem. - Distances are in meters and time in minutes. +Distances are in meters and time in minutes. """ # [START import] import functools -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -326,7 +326,11 @@ def main(): vehicle_break = data["breaks"][v] break_intervals[v] = [ routing.solver().FixedDurationIntervalVar( - 15, 100, vehicle_break[0], vehicle_break[1], f"Break for vehicle {v}" + 15, + 100, + vehicle_break[0], + vehicle_break[1], + f"Break for vehicle {v}", ) ] time_dimension.SetBreakIntervalsOfVehicle( @@ -337,7 +341,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # pylint: disable=no-member # [END parameters] diff --git a/ortools/constraint_solver/samples/simple_routing_program.cc b/ortools/constraint_solver/samples/simple_routing_program.cc index 7b01bd55f8..ea09c2e30a 100644 --- a/ortools/constraint_solver/samples/simple_routing_program.cc +++ b/ortools/constraint_solver/samples/simple_routing_program.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/simple_routing_program.py b/ortools/constraint_solver/samples/simple_routing_program.py old mode 100755 new mode 100644 index 346974ae57..a7c0d72766 --- a/ortools/constraint_solver/samples/simple_routing_program.py +++ b/ortools/constraint_solver/samples/simple_routing_program.py @@ -16,8 +16,8 @@ """Vehicle Routing example.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -61,7 +61,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # pylint: disable=no-member # [END parameters] diff --git a/ortools/constraint_solver/samples/tsp.cc b/ortools/constraint_solver/samples/tsp.cc index b3a2b2defe..33e5217fe9 100644 --- a/ortools/constraint_solver/samples/tsp.cc +++ b/ortools/constraint_solver/samples/tsp.cc @@ -21,9 +21,9 @@ #include "ortools/base/logging.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/tsp.py b/ortools/constraint_solver/samples/tsp.py old mode 100755 new mode 100644 index ff7bd8a6b5..92b1c21dab --- a/ortools/constraint_solver/samples/tsp.py +++ b/ortools/constraint_solver/samples/tsp.py @@ -20,11 +20,11 @@ http://en.wikipedia.org/wiki/Travelling_salesperson_problem. """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 -FirstSolutionStrategy = routing_enums_pb2.FirstSolutionStrategy -RoutingSearchStatus = routing_enums_pb2.RoutingSearchStatus +FirstSolutionStrategy = enums_pb2.FirstSolutionStrategy +RoutingSearchStatus = enums_pb2.RoutingSearchStatus # [END import] diff --git a/ortools/constraint_solver/samples/tsp_circuit_board.cc b/ortools/constraint_solver/samples/tsp_circuit_board.cc index 8061285beb..2030427602 100644 --- a/ortools/constraint_solver/samples/tsp_circuit_board.cc +++ b/ortools/constraint_solver/samples/tsp_circuit_board.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/tsp_circuit_board.py b/ortools/constraint_solver/samples/tsp_circuit_board.py old mode 100755 new mode 100644 index 8f017245c8..8a17fde545 --- a/ortools/constraint_solver/samples/tsp_circuit_board.py +++ b/ortools/constraint_solver/samples/tsp_circuit_board.py @@ -17,8 +17,8 @@ # [START import] import math -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -161,7 +161,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/tsp_cities.cc b/ortools/constraint_solver/samples/tsp_cities.cc index 4685ca7332..7387c9ebfd 100644 --- a/ortools/constraint_solver/samples/tsp_cities.cc +++ b/ortools/constraint_solver/samples/tsp_cities.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/tsp_cities.py b/ortools/constraint_solver/samples/tsp_cities.py old mode 100755 new mode 100644 index db59340daa..2d33e9ce06 --- a/ortools/constraint_solver/samples/tsp_cities.py +++ b/ortools/constraint_solver/samples/tsp_cities.py @@ -16,8 +16,8 @@ """Simple Travelling Salesperson Problem (TSP) between cities.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -104,7 +104,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/tsp_cities_routes.cc b/ortools/constraint_solver/samples/tsp_cities_routes.cc index dd0687a007..080595a4f5 100644 --- a/ortools/constraint_solver/samples/tsp_cities_routes.cc +++ b/ortools/constraint_solver/samples/tsp_cities_routes.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/tsp_distance_matrix.cc b/ortools/constraint_solver/samples/tsp_distance_matrix.cc index 2aabc02665..3eb95c2183 100644 --- a/ortools/constraint_solver/samples/tsp_distance_matrix.cc +++ b/ortools/constraint_solver/samples/tsp_distance_matrix.cc @@ -18,9 +18,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/tsp_distance_matrix.py b/ortools/constraint_solver/samples/tsp_distance_matrix.py old mode 100755 new mode 100644 index a3dde36775..594e0c2caf --- a/ortools/constraint_solver/samples/tsp_distance_matrix.py +++ b/ortools/constraint_solver/samples/tsp_distance_matrix.py @@ -16,8 +16,8 @@ """Simple Travelling Salesman Problem.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -110,7 +110,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp.cc b/ortools/constraint_solver/samples/vrp.cc index 53dbf39916..b6cfaff554 100644 --- a/ortools/constraint_solver/samples/vrp.cc +++ b/ortools/constraint_solver/samples/vrp.cc @@ -21,9 +21,9 @@ #include "ortools/base/logging.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp.py b/ortools/constraint_solver/samples/vrp.py old mode 100755 new mode 100644 index 39839802e3..dccfcfdc1a --- a/ortools/constraint_solver/samples/vrp.py +++ b/ortools/constraint_solver/samples/vrp.py @@ -15,20 +15,20 @@ # [START program] """Simple Vehicles Routing Problem (VRP). - This is a sample using the routing library python wrapper to solve a VRP - problem. - A description of the problem can be found here: - http://en.wikipedia.org/wiki/Vehicle_routing_problem. +This is a sample using the routing library python wrapper to solve a VRP +problem. +A description of the problem can be found here: +http://en.wikipedia.org/wiki/Vehicle_routing_problem. - Distances are in meters. +Distances are in meters. """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 -FirstSolutionStrategy = routing_enums_pb2.FirstSolutionStrategy -RoutingSearchStatus = routing_enums_pb2.RoutingSearchStatus +FirstSolutionStrategy = enums_pb2.FirstSolutionStrategy +RoutingSearchStatus = enums_pb2.RoutingSearchStatus # [END import] @@ -92,7 +92,6 @@ def print_solution(manager, routing, solution): print(plan_output) total_distance += route_distance print(f"Total Distance of all routes: {total_distance}m") - # [END solution_printer] diff --git a/ortools/constraint_solver/samples/vrp_breaks.cc b/ortools/constraint_solver/samples/vrp_breaks.cc index 862705c17c..fcc82f6a6e 100644 --- a/ortools/constraint_solver/samples/vrp_breaks.cc +++ b/ortools/constraint_solver/samples/vrp_breaks.cc @@ -26,9 +26,9 @@ #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_breaks.py b/ortools/constraint_solver/samples/vrp_breaks.py index ef764c53da..fcad91faf9 100755 --- a/ortools/constraint_solver/samples/vrp_breaks.py +++ b/ortools/constraint_solver/samples/vrp_breaks.py @@ -15,17 +15,17 @@ # [START program] """Vehicle Routing Problem (VRP) with breaks. - This is a sample using the routing library python wrapper to solve a VRP - problem. - A description of the problem can be found here: - http://en.wikipedia.org/wiki/Vehicle_routing_problem. +This is a sample using the routing library python wrapper to solve a VRP +problem. +A description of the problem can be found here: +http://en.wikipedia.org/wiki/Vehicle_routing_problem. - Durations are in minutes. +Durations are in minutes. """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -175,10 +175,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) # search_parameters.log_search = True search_parameters.time_limit.FromSeconds(2) diff --git a/ortools/constraint_solver/samples/vrp_breaks_from_start.py b/ortools/constraint_solver/samples/vrp_breaks_from_start.py index db3effc457..c3c26a1ff5 100755 --- a/ortools/constraint_solver/samples/vrp_breaks_from_start.py +++ b/ortools/constraint_solver/samples/vrp_breaks_from_start.py @@ -13,19 +13,21 @@ # limitations under the License. # [START program] """Vehicles Routing Problem (VRP) with breaks relative to the vehicle start time. - Each vehicles start at T:15min, T:30min, T:45min and T:60min respectively. - Each vehicle must perform a break lasting 5 minutes, - starting between 25 and 45 minutes after route start. - e.g. vehicle 2 starting a T:45min must start a 5min breaks - between [45+25,45+45] i.e. in the range [70, 90]. +Each vehicles start at T:15min, T:30min, T:45min and T:60min respectively. - Durations are in minutes. +Each vehicle must perform a break lasting 5 minutes, +starting between 25 and 45 minutes after route start. +e.g. vehicle 2 starting a T:45min must start a 5min breaks +between [45+25,45+45] i.e. in the range [70, 90]. + +Durations are in minutes. """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.constraint_solver import routing_enums_pb2 + # [END import] diff --git a/ortools/constraint_solver/samples/vrp_capacity.cc b/ortools/constraint_solver/samples/vrp_capacity.cc index 5fc10e8a41..82206a0c83 100644 --- a/ortools/constraint_solver/samples/vrp_capacity.cc +++ b/ortools/constraint_solver/samples/vrp_capacity.cc @@ -19,9 +19,9 @@ #include "google/protobuf/duration.pb.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_capacity.py b/ortools/constraint_solver/samples/vrp_capacity.py old mode 100755 new mode 100644 index 246236b0d1..a5fba65d92 --- a/ortools/constraint_solver/samples/vrp_capacity.py +++ b/ortools/constraint_solver/samples/vrp_capacity.py @@ -16,8 +16,8 @@ """Capacited Vehicles Routing Problem (CVRP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -145,10 +145,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(1) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_drop_nodes.cc b/ortools/constraint_solver/samples/vrp_drop_nodes.cc index 912b85e5f4..3e0ba0e5bf 100644 --- a/ortools/constraint_solver/samples/vrp_drop_nodes.cc +++ b/ortools/constraint_solver/samples/vrp_drop_nodes.cc @@ -19,9 +19,9 @@ #include "google/protobuf/duration.pb.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_drop_nodes.py b/ortools/constraint_solver/samples/vrp_drop_nodes.py old mode 100755 new mode 100644 index e611f7f733..a19589a5d4 --- a/ortools/constraint_solver/samples/vrp_drop_nodes.py +++ b/ortools/constraint_solver/samples/vrp_drop_nodes.py @@ -16,8 +16,8 @@ """Capacited Vehicles Routing Problem (CVRP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -158,10 +158,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(1) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_global_span.cc b/ortools/constraint_solver/samples/vrp_global_span.cc index 6e2f18832e..e17f77b329 100644 --- a/ortools/constraint_solver/samples/vrp_global_span.cc +++ b/ortools/constraint_solver/samples/vrp_global_span.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_global_span.py b/ortools/constraint_solver/samples/vrp_global_span.py old mode 100755 new mode 100644 index ba6ab408ef..9120582770 --- a/ortools/constraint_solver/samples/vrp_global_span.py +++ b/ortools/constraint_solver/samples/vrp_global_span.py @@ -15,17 +15,17 @@ # [START program] """Simple Vehicles Routing Problem (VRP). - This is a sample using the routing library python wrapper to solve a VRP - problem. - A description of the problem can be found here: - http://en.wikipedia.org/wiki/Vehicle_routing_problem. +This is a sample using the routing library python wrapper to solve a VRP +problem. +A description of the problem can be found here: +http://en.wikipedia.org/wiki/Vehicle_routing_problem. - Distances are in meters. +Distances are in meters. """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -81,7 +81,6 @@ def print_solution(data, manager, routing, solution): print(plan_output) max_route_distance = max(route_distance, max_route_distance) print(f"Maximum of the route distances: {max_route_distance}m") - # [END solution_printer] @@ -139,7 +138,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_initial_routes.cc b/ortools/constraint_solver/samples/vrp_initial_routes.cc index 14024510be..611b0bf435 100644 --- a/ortools/constraint_solver/samples/vrp_initial_routes.cc +++ b/ortools/constraint_solver/samples/vrp_initial_routes.cc @@ -23,9 +23,9 @@ #include "ortools/base/logging.h" #include "ortools/constraint_solver/constraint_solver.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_initial_routes.py b/ortools/constraint_solver/samples/vrp_initial_routes.py old mode 100755 new mode 100644 index b32e2f9e8c..46781b73c4 --- a/ortools/constraint_solver/samples/vrp_initial_routes.py +++ b/ortools/constraint_solver/samples/vrp_initial_routes.py @@ -16,8 +16,8 @@ """Vehicles Routing Problem (VRP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -83,7 +83,6 @@ def print_solution(data, manager, routing, solution): print(plan_output) max_route_distance = max(route_distance, max_route_distance) print(f"Maximum of the route distances: {max_route_distance}m") - # [END solution_printer] @@ -141,10 +140,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(5) # When an initial solution is given for search, the model will be closed with diff --git a/ortools/constraint_solver/samples/vrp_items_to_deliver.py b/ortools/constraint_solver/samples/vrp_items_to_deliver.py index 10b0b3dc37..7739632b79 100755 --- a/ortools/constraint_solver/samples/vrp_items_to_deliver.py +++ b/ortools/constraint_solver/samples/vrp_items_to_deliver.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 # [START program] """Vehicles Routing Problem (VRP) for delivering items from any suppliers. -Description: -Need to deliver some item X and Y at end nodes (at least 11 X and 13 Y). -Several locations provide them and even few provide both. + +Description: Need to deliver some item X and Y at end nodes (at least 11 X and +13 Y). Several locations provide them and even few provide both. fleet: * vehicles: 2 @@ -14,8 +14,8 @@ fleet: """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.constraint_solver import routing_enums_pb2 # [END import] @@ -79,76 +79,331 @@ def create_data_model(): # [END demands_capacities] data["distance_matrix"] = [ [ - 0, 548, 776, 696, 582, 274, 502, 194, 308, 194, 536, 502, 388, 354, - 468, 776, 662 + 0, + 548, + 776, + 696, + 582, + 274, + 502, + 194, + 308, + 194, + 536, + 502, + 388, + 354, + 468, + 776, + 662, ], [ - 548, 0, 684, 308, 194, 502, 730, 354, 696, 742, 1084, 594, 480, 674, - 1016, 868, 1210 + 548, + 0, + 684, + 308, + 194, + 502, + 730, + 354, + 696, + 742, + 1084, + 594, + 480, + 674, + 1016, + 868, + 1210, ], [ - 776, 684, 0, 992, 878, 502, 274, 810, 468, 742, 400, 1278, 1164, - 1130, 788, 1552, 754 + 776, + 684, + 0, + 992, + 878, + 502, + 274, + 810, + 468, + 742, + 400, + 1278, + 1164, + 1130, + 788, + 1552, + 754, ], [ - 696, 308, 992, 0, 114, 650, 878, 502, 844, 890, 1232, 514, 628, 822, - 1164, 560, 1358 + 696, + 308, + 992, + 0, + 114, + 650, + 878, + 502, + 844, + 890, + 1232, + 514, + 628, + 822, + 1164, + 560, + 1358, ], [ - 582, 194, 878, 114, 0, 536, 764, 388, 730, 776, 1118, 400, 514, 708, - 1050, 674, 1244 + 582, + 194, + 878, + 114, + 0, + 536, + 764, + 388, + 730, + 776, + 1118, + 400, + 514, + 708, + 1050, + 674, + 1244, ], [ - 274, 502, 502, 650, 536, 0, 228, 308, 194, 240, 582, 776, 662, 628, - 514, 1050, 708 + 274, + 502, + 502, + 650, + 536, + 0, + 228, + 308, + 194, + 240, + 582, + 776, + 662, + 628, + 514, + 1050, + 708, ], [ - 502, 730, 274, 878, 764, 228, 0, 536, 194, 468, 354, 1004, 890, 856, - 514, 1278, 480 + 502, + 730, + 274, + 878, + 764, + 228, + 0, + 536, + 194, + 468, + 354, + 1004, + 890, + 856, + 514, + 1278, + 480, ], [ - 194, 354, 810, 502, 388, 308, 536, 0, 342, 388, 730, 468, 354, 320, - 662, 742, 856 + 194, + 354, + 810, + 502, + 388, + 308, + 536, + 0, + 342, + 388, + 730, + 468, + 354, + 320, + 662, + 742, + 856, ], [ - 308, 696, 468, 844, 730, 194, 194, 342, 0, 274, 388, 810, 696, 662, - 320, 1084, 514 + 308, + 696, + 468, + 844, + 730, + 194, + 194, + 342, + 0, + 274, + 388, + 810, + 696, + 662, + 320, + 1084, + 514, ], [ - 194, 742, 742, 890, 776, 240, 468, 388, 274, 0, 342, 536, 422, 388, - 274, 810, 468 + 194, + 742, + 742, + 890, + 776, + 240, + 468, + 388, + 274, + 0, + 342, + 536, + 422, + 388, + 274, + 810, + 468, ], [ - 536, 1084, 400, 1232, 1118, 582, 354, 730, 388, 342, 0, 878, 764, - 730, 388, 1152, 354 + 536, + 1084, + 400, + 1232, + 1118, + 582, + 354, + 730, + 388, + 342, + 0, + 878, + 764, + 730, + 388, + 1152, + 354, ], [ - 502, 594, 1278, 514, 400, 776, 1004, 468, 810, 536, 878, 0, 114, - 308, 650, 274, 844 + 502, + 594, + 1278, + 514, + 400, + 776, + 1004, + 468, + 810, + 536, + 878, + 0, + 114, + 308, + 650, + 274, + 844, ], [ - 388, 480, 1164, 628, 514, 662, 890, 354, 696, 422, 764, 114, 0, 194, - 536, 388, 730 + 388, + 480, + 1164, + 628, + 514, + 662, + 890, + 354, + 696, + 422, + 764, + 114, + 0, + 194, + 536, + 388, + 730, ], [ - 354, 674, 1130, 822, 708, 628, 856, 320, 662, 388, 730, 308, 194, 0, - 342, 422, 536 + 354, + 674, + 1130, + 822, + 708, + 628, + 856, + 320, + 662, + 388, + 730, + 308, + 194, + 0, + 342, + 422, + 536, ], [ - 468, 1016, 788, 1164, 1050, 514, 514, 662, 320, 274, 388, 650, 536, - 342, 0, 764, 194 + 468, + 1016, + 788, + 1164, + 1050, + 514, + 514, + 662, + 320, + 274, + 388, + 650, + 536, + 342, + 0, + 764, + 194, ], [ - 776, 868, 1552, 560, 674, 1050, 1278, 742, 1084, 810, 1152, 274, - 388, 422, 764, 0, 798 + 776, + 868, + 1552, + 560, + 674, + 1050, + 1278, + 742, + 1084, + 810, + 1152, + 274, + 388, + 422, + 764, + 0, + 798, ], [ - 662, 1210, 754, 1358, 1244, 708, 480, 856, 514, 468, 354, 844, 730, - 536, 194, 798, 0 + 662, + 1210, + 754, + 1358, + 1244, + 708, + 480, + 856, + 514, + 468, + 354, + 844, + 730, + 536, + 194, + 798, + 0, ], ] - assert len(data['providers_x']) == len(data['distance_matrix']) - assert len(data['providers_y']) == len(data['distance_matrix']) + assert len(data["providers_x"]) == len(data["distance_matrix"]) + assert len(data["providers_y"]) == len(data["distance_matrix"]) return data # [END data_model] @@ -156,14 +411,14 @@ def create_data_model(): # [START solution_printer] def print_solution(data, manager, routing, assignment): """Prints assignment on console.""" - print(f'Objective: {assignment.ObjectiveValue()}') + print(f"Objective: {assignment.ObjectiveValue()}") # Display dropped nodes. - dropped_nodes = 'Dropped nodes:' + dropped_nodes = "Dropped nodes:" for node in range(routing.Size()): if routing.IsStart(node) or routing.IsEnd(node): continue if assignment.Value(routing.NextVar(node)) == node: - dropped_nodes += f' {manager.IndexToNode(node)}' + dropped_nodes += f" {manager.IndexToNode(node)}" print(dropped_nodes) # Display routes total_distance = 0 @@ -171,31 +426,31 @@ def print_solution(data, manager, routing, assignment): total_load_y = 0 for vehicle_id in range(manager.GetNumberOfVehicles()): index = routing.Start(vehicle_id) - plan_output = f'Route for vehicle {vehicle_id}:\n' + plan_output = f"Route for vehicle {vehicle_id}:\n" route_distance = 0 route_load_x = 0 route_load_y = 0 while not routing.IsEnd(index): node_index = manager.IndexToNode(index) - route_load_x += data['providers_x'][node_index] - route_load_y += data['providers_y'][node_index] - plan_output += f' {node_index} Load(X:{route_load_x}, Y:{route_load_y}) -> ' + route_load_x += data["providers_x"][node_index] + route_load_y += data["providers_y"][node_index] + plan_output += f" {node_index} Load(X:{route_load_x}, Y:{route_load_y}) -> " previous_index = index previous_node_index = node_index index = assignment.Value(routing.NextVar(index)) node_index = manager.IndexToNode(index) - #route_distance += routing.GetArcCostForVehicle(previous_index, index, vehicle_id) - route_distance += data['distance_matrix'][previous_node_index][node_index] + # route_distance += routing.GetArcCostForVehicle(previous_index, index, vehicle_id) + route_distance += data["distance_matrix"][previous_node_index][node_index] node_index = manager.IndexToNode(index) - plan_output += f' {node_index} Load({route_load_x}, {route_load_y})\n' - plan_output += f'Distance of the route: {route_distance}m\n' - plan_output += f'Load of the route: X:{route_load_x}, Y:{route_load_y}\n' + plan_output += f" {node_index} Load({route_load_x}, {route_load_y})\n" + plan_output += f"Distance of the route: {route_distance}m\n" + plan_output += f"Load of the route: X:{route_load_x}, Y:{route_load_y}\n" print(plan_output) total_distance += route_distance total_load_x += route_load_x total_load_y += route_load_y - print(f'Total Distance of all routes: {total_distance}m') - print(f'Total load of all routes: X:{total_load_x}, Y:{total_load_y}') + print(f"Total Distance of all routes: {total_distance}m") + print(f"Total load of all routes: X:{total_load_x}, Y:{total_load_y}") # [END solution_printer] @@ -209,7 +464,10 @@ def main(): # Create the routing index manager. # [START index_manager] manager = pywrapcp.RoutingIndexManager( - len(data["distance_matrix"]), data["num_vehicles"], data["starts"], data["ends"] + len(data["distance_matrix"]), + data["num_vehicles"], + data["starts"], + data["ends"], ) # [END index_manager] diff --git a/ortools/constraint_solver/samples/vrp_node_max.py b/ortools/constraint_solver/samples/vrp_node_max.py index 17a8e0b91e..e7eabaf258 100755 --- a/ortools/constraint_solver/samples/vrp_node_max.py +++ b/ortools/constraint_solver/samples/vrp_node_max.py @@ -20,8 +20,8 @@ road multiply by a constant factor (4200) """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -73,7 +73,6 @@ def create_data_model(): data["num_vehicles"] = 4 data["depot"] = 0 return data - # [END data_model] @@ -116,7 +115,6 @@ def print_solution(data, manager, routing, solution): print(plan_output) max_route_distance = max(route_distance, max_route_distance) print(f"Maximum of the route distances: {max_route_distance}m") - # [END solution_printer] @@ -242,10 +240,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) # search_parameters.log_search = True search_parameters.time_limit.FromSeconds(5) diff --git a/ortools/constraint_solver/samples/vrp_nodes_indices.py b/ortools/constraint_solver/samples/vrp_nodes_indices.py index 1a66624801..cd76a39ce3 100755 --- a/ortools/constraint_solver/samples/vrp_nodes_indices.py +++ b/ortools/constraint_solver/samples/vrp_nodes_indices.py @@ -18,11 +18,15 @@ This script generate few markdown tables to better understand the relation between nodes and indices. Things to notice: -* Since we have two duplicates (node 5 and node 4) solver need 2 extra indices to have an unique index for each vehicle start/stop and locations. -* Solver needs to "create" an index for a vehicle 1 start since solver need an unique start index per vehicle. +* Since we have two duplicates (node 5 and node 4) solver need 2 extra indices +to have an unique index for each vehicle start/stop and locations. +* Solver needs to "create" an index for a vehicle 1 start since solver need an +unique start index per vehicle. * All end nodes are moved to the end of the index list aka [15, 16, 17, 18]. -* routing.Size() return the number of node which are not end nodes (here 15 aka [0-14]) -note: using the two properties above, we know that any index in range(routing.Size()) is not a vehicle end node. +* routing.Size() return the number of node which are not end nodes (here 15 aka +[0-14]) +note: using the two properties above, we know that any index in +range(routing.Size()) is not a vehicle end node. * Since end nodes are moved to the end, their respective "empty" node index are reused so all locations indices are "shifted" @@ -31,13 +35,15 @@ e.g. node 9 is mapped to index 6 e.g. start node 7 mapped to index 4 Takeaway: -* Allways use routing.Start(), routing.End(), manager.IndexToNode() or manager.NodeToIndex(). +* Allways use routing.Start(), routing.End(), manager.IndexToNode() or +manager.NodeToIndex(). * Location node is not necessarily equal to its index. -* To loop through ALL indices use manager.GetNumberOfIndices() (Python) or manager::num_indices() (C++) +* To loop through ALL indices use manager.GetNumberOfIndices() (Python) or +manager::num_indices() (C++) """ -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.constraint_solver import routing_enums_pb2 def main(): @@ -68,11 +74,14 @@ def main(): print("\nNodes:") print( - "| locations | manager.GetNumberOfNodes | manager.GetNumberOfIndices | routing.nodes | routing.Size |" + "| locations | manager.GetNumberOfNodes | manager.GetNumberOfIndices |" + " routing.nodes | routing.Size |" ) print("|---|---|---|---|---|") print( - f"| {locations} | {manager.GetNumberOfNodes()} | {manager.GetNumberOfIndices()} | {routing.nodes()} | {routing.Size()} |" + f"| {locations} | {manager.GetNumberOfNodes()} |" + f" {manager.GetNumberOfIndices()} | {routing.nodes()} |" + f" {routing.Size()} |" ) print("\nLocations:") @@ -83,7 +92,8 @@ def main(): continue index = manager.NodeToIndex(node) print( - f"| {node} | {index} | {routing.IsStart(index)} | {routing.IsEnd(index)} |" + f"| {node} | {index} | {routing.IsStart(index)} |" + f" {routing.IsEnd(index)} |" ) print("\nStart/End:") @@ -93,13 +103,15 @@ def main(): start_index = routing.Start(v) start_node = manager.IndexToNode(start_index) print( - f"| {v} | start | {start_node} | {start_index} | {routing.IsStart(start_index)} | {routing.IsEnd(start_index)} |" + f"| {v} | start | {start_node} | {start_index} |" + f" {routing.IsStart(start_index)} | {routing.IsEnd(start_index)} |" ) for v in range(manager.GetNumberOfVehicles()): end_index = routing.End(v) end_node = manager.IndexToNode(end_index) print( - f"| {v} | end | {end_node} | {end_index} | {routing.IsStart(end_index)} | {routing.IsEnd(end_index)} |" + f"| {v} | end | {end_node} | {end_index} |" + f" {routing.IsStart(end_index)} | {routing.IsEnd(end_index)} |" ) diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery.cc b/ortools/constraint_solver/samples/vrp_pickup_delivery.cc index ae796099a1..c5317106a3 100644 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery.cc +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery.cc @@ -18,9 +18,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery.py b/ortools/constraint_solver/samples/vrp_pickup_delivery.py index 82006e8982..e6479665f1 100755 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery.py +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery.py @@ -16,8 +16,8 @@ """Simple Pickup Delivery Problem (PDP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -154,7 +154,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION + enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.cc b/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.cc index 0c67aec80e..49bf9d348d 100644 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.cc +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.cc @@ -18,9 +18,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.py b/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.py index d46b0a34e0..ed3155c158 100755 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.py +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery_fifo.py @@ -16,8 +16,8 @@ """Simple Pickup Delivery Problem (PDP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -157,7 +157,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION + enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.cc b/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.cc index 6a1de4e5c8..9264132cab 100644 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.cc +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.cc @@ -18,9 +18,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.py b/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.py index 5bbc1f94f7..e3ef6e4746 100755 --- a/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.py +++ b/ortools/constraint_solver/samples/vrp_pickup_delivery_lifo.py @@ -16,8 +16,8 @@ """Simple Pickup Delivery Problem (PDP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -157,7 +157,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION + enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_resources.cc b/ortools/constraint_solver/samples/vrp_resources.cc index 1d54b4da49..2f3151e29b 100644 --- a/ortools/constraint_solver/samples/vrp_resources.cc +++ b/ortools/constraint_solver/samples/vrp_resources.cc @@ -20,9 +20,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_resources.py b/ortools/constraint_solver/samples/vrp_resources.py old mode 100755 new mode 100644 index 06e8b6f6e0..00e55ca24f --- a/ortools/constraint_solver/samples/vrp_resources.py +++ b/ortools/constraint_solver/samples/vrp_resources.py @@ -16,8 +16,8 @@ """Vehicles Routing Problem (VRP) with Resource Constraints.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -207,7 +207,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_routes.cc b/ortools/constraint_solver/samples/vrp_routes.cc index 7d53a4bf30..72d3e2c28a 100644 --- a/ortools/constraint_solver/samples/vrp_routes.cc +++ b/ortools/constraint_solver/samples/vrp_routes.cc @@ -18,9 +18,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_solution_callback.cc b/ortools/constraint_solver/samples/vrp_solution_callback.cc index e9a87e3d97..b6fc7c4947 100644 --- a/ortools/constraint_solver/samples/vrp_solution_callback.cc +++ b/ortools/constraint_solver/samples/vrp_solution_callback.cc @@ -21,9 +21,9 @@ #include "google/protobuf/duration.pb.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_solution_callback.py b/ortools/constraint_solver/samples/vrp_solution_callback.py index 4effcee167..59c67b1794 100755 --- a/ortools/constraint_solver/samples/vrp_solution_callback.py +++ b/ortools/constraint_solver/samples/vrp_solution_callback.py @@ -15,19 +15,19 @@ # [START program] """Simple Vehicles Routing Problem (VRP). - This is a sample using the routing library python wrapper to solve a VRP - problem. +This is a sample using the routing library python wrapper to solve a VRP +problem. - The solver stop after improving its solution 15 times or after 5 seconds. +The solver stop after improving its solution 15 times or after 5 seconds. - Distances are in meters. +Distances are in meters. """ # [START import] import weakref -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -64,7 +64,8 @@ def create_data_model(): # [START solution_callback_printer] def print_solution( - routing_manager: pywrapcp.RoutingIndexManager, routing_model: pywrapcp.RoutingModel + routing_manager: pywrapcp.RoutingIndexManager, + routing_model: pywrapcp.RoutingModel, ): """Prints solution on console.""" print("################") @@ -86,7 +87,6 @@ def print_solution( print(plan_output) total_distance += route_distance print(f"Total Distance of all routes: {total_distance}m") - # [END solution_callback_printer] @@ -119,7 +119,6 @@ class SolutionCallback: self._counter += 1 if self._counter > self._counter_limit: self._routing_model_ref().solver().FinishCurrentSearch() # pytype: disable=attribute-error - # [END solution_callback] @@ -184,10 +183,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(5) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_starts_ends.cc b/ortools/constraint_solver/samples/vrp_starts_ends.cc index 1e8765789a..24851d203e 100644 --- a/ortools/constraint_solver/samples/vrp_starts_ends.cc +++ b/ortools/constraint_solver/samples/vrp_starts_ends.cc @@ -19,9 +19,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_starts_ends.py b/ortools/constraint_solver/samples/vrp_starts_ends.py old mode 100755 new mode 100644 index 046388212b..b78f3380ff --- a/ortools/constraint_solver/samples/vrp_starts_ends.py +++ b/ortools/constraint_solver/samples/vrp_starts_ends.py @@ -16,8 +16,8 @@ """Simple Vehicles Routing Problem.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -89,7 +89,10 @@ def main(): # Create the routing index manager. # [START index_manager] manager = pywrapcp.RoutingIndexManager( - len(data["distance_matrix"]), data["num_vehicles"], data["starts"], data["ends"] + len(data["distance_matrix"]), + data["num_vehicles"], + data["starts"], + data["ends"], ) # [END index_manager] @@ -133,7 +136,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_time_windows.cc b/ortools/constraint_solver/samples/vrp_time_windows.cc index 7e87767b80..c2587c3912 100644 --- a/ortools/constraint_solver/samples/vrp_time_windows.cc +++ b/ortools/constraint_solver/samples/vrp_time_windows.cc @@ -20,9 +20,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] // [START program_part1] diff --git a/ortools/constraint_solver/samples/vrp_time_windows.py b/ortools/constraint_solver/samples/vrp_time_windows.py old mode 100755 new mode 100644 index ffa94be0a7..c39c98a79c --- a/ortools/constraint_solver/samples/vrp_time_windows.py +++ b/ortools/constraint_solver/samples/vrp_time_windows.py @@ -16,8 +16,8 @@ """Vehicles Routing Problem (VRP) with Time Windows.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -173,7 +173,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py b/ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py index 1096afaf9b..31131cd854 100755 --- a/ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py +++ b/ortools/constraint_solver/samples/vrp_time_windows_per_vehicles.py @@ -14,24 +14,25 @@ # [START program] """Vehicles Routing Problem (VRP) with Time Window (TW) per vehicle. - All time are in minutes using 0am as origin - e.g. 8am = 480, 11am = 660, 1pm = 780 ... +All time are in minutes using 0am as origin +e.g. 8am = 480, 11am = 660, 1pm = 780 ... - We have 1 depot (0) and 16 locations (1-16). - We have a fleet of 4 vehicles (0-3) whose working time is [480, 1020] (8am-5pm) - We have the distance matrix between these locations and depot. - We have a service time of 25min at each location. +We have 1 depot (0) and 16 locations (1-16). +We have a fleet of 4 vehicles (0-3) whose working time is [480, 1020] (8am-5pm) +We have the distance matrix between these locations and depot. +We have a service time of 25min at each location. - Locations are duplicated so we can simulate a TW per vehicle. - location: [01-16] vehicle: 0 TW: [540, 660] (9am-11am) - location: [17-32] vehicle: 1 TW: [660, 780] (11am-1pm) - location: [33-48] vehicle: 2 TW: [780, 900] (1pm-3pm) - location: [49-64] vehicle: 3 TW: [900, 1020] (3pm-5pm) +Locations are duplicated so we can simulate a TW per vehicle. +location: [01-16] vehicle: 0 TW: [540, 660] (9am-11am) +location: [17-32] vehicle: 1 TW: [660, 780] (11am-1pm) +location: [33-48] vehicle: 2 TW: [780, 900] (1pm-3pm) +location: [49-64] vehicle: 3 TW: [900, 1020] (3pm-5pm) """ # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.constraint_solver import routing_enums_pb2 + # [END import] diff --git a/ortools/constraint_solver/samples/vrp_tokens.py b/ortools/constraint_solver/samples/vrp_tokens.py index 04405b8271..0b72b82c4f 100755 --- a/ortools/constraint_solver/samples/vrp_tokens.py +++ b/ortools/constraint_solver/samples/vrp_tokens.py @@ -15,8 +15,8 @@ """Simple VRP with special locations which need to be visited at end of the route.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -155,10 +155,10 @@ def main(): # Setting first solution heuristic. search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.time_limit.FromSeconds(1) diff --git a/ortools/constraint_solver/samples/vrp_with_time_limit.cc b/ortools/constraint_solver/samples/vrp_with_time_limit.cc index ca16171be6..c04833ab0b 100644 --- a/ortools/constraint_solver/samples/vrp_with_time_limit.cc +++ b/ortools/constraint_solver/samples/vrp_with_time_limit.cc @@ -20,9 +20,9 @@ #include "google/protobuf/duration.pb.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] namespace operations_research { diff --git a/ortools/constraint_solver/samples/vrp_with_time_limit.py b/ortools/constraint_solver/samples/vrp_with_time_limit.py old mode 100755 new mode 100644 index 9f6bfedbf9..dc0085ea36 --- a/ortools/constraint_solver/samples/vrp_with_time_limit.py +++ b/ortools/constraint_solver/samples/vrp_with_time_limit.py @@ -16,8 +16,8 @@ """Vehicles Routing Problem (VRP).""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -98,10 +98,10 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) search_parameters.local_search_metaheuristic = ( - routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH + enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH ) search_parameters.log_search = True search_parameters.time_limit.FromSeconds(5) diff --git a/ortools/constraint_solver/samples/vrptw_store_solution_data.cc b/ortools/constraint_solver/samples/vrptw_store_solution_data.cc index 4d0b6d4e7e..7d5be38ffc 100644 --- a/ortools/constraint_solver/samples/vrptw_store_solution_data.cc +++ b/ortools/constraint_solver/samples/vrptw_store_solution_data.cc @@ -20,9 +20,9 @@ #include #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/routing/enums.pb.h" // [END import] // [START program_part1] diff --git a/ortools/constraint_solver/samples/vrptw_store_solution_data.py b/ortools/constraint_solver/samples/vrptw_store_solution_data.py old mode 100755 new mode 100644 index 9f9b5756bd..9f65f78d8d --- a/ortools/constraint_solver/samples/vrptw_store_solution_data.py +++ b/ortools/constraint_solver/samples/vrptw_store_solution_data.py @@ -16,8 +16,8 @@ """VRPTW example that stores routes and cumulative data in an array.""" # [START import] -from ortools.constraint_solver import routing_enums_pb2 from ortools.constraint_solver import pywrapcp +from ortools.routing import enums_pb2 # [END import] @@ -67,7 +67,6 @@ def create_data_model(): data["num_vehicles"] = 4 data["depot"] = 0 return data - # [END data_model] @@ -105,7 +104,6 @@ def print_solution(routes, cumul_data): total_time += cumul_data[i][len(route) - 1][0] route_str += f"Total time: {total_time}min" print(route_str) - # [END solution_printer] @@ -123,7 +121,6 @@ def get_routes(solution, routing, manager): route.append(manager.IndexToNode(index)) routes.append(route) return routes - # [END get_routes] @@ -147,7 +144,6 @@ def get_cumul_data(solution, routing, dimension): route_data.append([solution.Min(dim_var), solution.Max(dim_var)]) cumul_data.append(route_data) return cumul_data - # [END get_cumulative_data] @@ -226,7 +222,7 @@ def main(): # [START parameters] search_parameters = pywrapcp.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( - routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC + enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC ) # [END parameters] diff --git a/ortools/dotnet/Google.OrTools-full.csproj.in b/ortools/dotnet/Google.OrTools-full.csproj.in index 94fe0d295a..3ae935f791 100644 --- a/ortools/dotnet/Google.OrTools-full.csproj.in +++ b/ortools/dotnet/Google.OrTools-full.csproj.in @@ -89,6 +89,10 @@ pdlp/%(Filename)%(Extension) + + routing/%(Filename)%(Extension) + + sat/%(Filename)%(Extension) @@ -171,6 +175,11 @@ true PreserveNewest + + content/routing + true + PreserveNewest + content/sat true diff --git a/ortools/dotnet/Google.OrTools-local.csproj.in b/ortools/dotnet/Google.OrTools-local.csproj.in index 851b23a537..3612d7149f 100644 --- a/ortools/dotnet/Google.OrTools-local.csproj.in +++ b/ortools/dotnet/Google.OrTools-local.csproj.in @@ -89,6 +89,10 @@ pdlp/%(Filename)%(Extension) + + routing/%(Filename)%(Extension) + + sat/%(Filename)%(Extension) @@ -159,6 +163,11 @@ true PreserveNewest + + content/routing + true + PreserveNewest + content/sat true diff --git a/ortools/python/setup.py.in b/ortools/python/setup.py.in index 9c2812541d..72d341f43c 100644 --- a/ortools/python/setup.py.in +++ b/ortools/python/setup.py.in @@ -99,6 +99,7 @@ setup( '$', '*.pyi' ], + '@PYTHON_PROJECT@.routing':['*.pyi'], '@PYTHON_PROJECT@.sat':['*.pyi'], '@PYTHON_PROJECT@.sat.colab':['*.pyi', 'py.typed'], '@PYTHON_PROJECT@.sat.python':[ diff --git a/ortools/routing/BUILD.bazel b/ortools/routing/BUILD.bazel new file mode 100644 index 0000000000..ad3a31a992 --- /dev/null +++ b/ortools/routing/BUILD.bazel @@ -0,0 +1,71 @@ +# Copyright 2010-2024 Google LLC +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@rules_cc//cc:defs.bzl", "cc_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + +package(default_visibility = ["//visibility:public"]) + +proto_library( + name = "ils_proto", + srcs = ["ils.proto"], + deps = [":enums_proto"], +) + +cc_proto_library( + name = "ils_cc_proto", + deps = ["ils_proto"], +) + +proto_library( + name = "enums_proto", + srcs = ["enums.proto"], +) + +cc_proto_library( + name = "enums_cc_proto", + deps = [":enums_proto"], +) + +# java_proto_library( +# name = "enums_java_proto", +# deps = [":enums_proto"], +# ) + +proto_library( + name = "parameters_proto", + srcs = ["parameters.proto"], + deps = [ + ":enums_proto", + ":ils_proto", + "//ortools/constraint_solver:solver_parameters_proto", + "//ortools/sat:sat_parameters_proto", + "//ortools/util:optional_boolean_proto", + "@com_google_protobuf//:duration_proto", + ], +) + +cc_proto_library( + name = "parameters_cc_proto", + deps = [":parameters_proto"], +) + +# java_proto_library( +# name = "parameters_java_proto", +# deps = [":parameters_proto"], +# ) + +#py_proto_library( +# name = "parameters_py_pb2", +# deps = [":parameters_proto"], +#) diff --git a/ortools/constraint_solver/routing_enums.proto b/ortools/routing/enums.proto similarity index 98% rename from ortools/constraint_solver/routing_enums.proto rename to ortools/routing/enums.proto index 216b01c12e..d17e079566 100644 --- a/ortools/constraint_solver/routing_enums.proto +++ b/ortools/routing/enums.proto @@ -15,9 +15,9 @@ syntax = "proto3"; -option java_package = "com.google.ortools.constraintsolver"; +option java_package = "com.google.ortools.routing"; option java_multiple_files = true; -option csharp_namespace = "Google.OrTools.ConstraintSolver"; +option csharp_namespace = "Google.OrTools.Routing"; package operations_research; diff --git a/ortools/constraint_solver/routing_ils.proto b/ortools/routing/ils.proto similarity index 60% rename from ortools/constraint_solver/routing_ils.proto rename to ortools/routing/ils.proto index d81f9502d4..449321ff3f 100644 --- a/ortools/constraint_solver/routing_ils.proto +++ b/ortools/routing/ils.proto @@ -21,11 +21,11 @@ syntax = "proto3"; -option java_package = "com.google.ortools.constraintsolver"; +option java_package = "com.google.ortools.routing"; option java_multiple_files = true; -option csharp_namespace = "Google.OrTools.ConstraintSolver"; +option csharp_namespace = "Google.OrTools.Routing"; -import "ortools/constraint_solver/routing_enums.proto"; +import "ortools/routing/enums.proto"; package operations_research; @@ -50,6 +50,26 @@ message RuinRecreateParameters { // Number of routes removed during a ruin application defined on routes. optional uint32 num_ruined_routes = 3; + + // Ratio in [0, 1] of non start/end nodes to consider as neighbors for the + // identification of routes spatially close to a non start/end seed node. + // + // In particular, given a non start/end seed node s served by route r, we say + // that a route r' is spatially close to the seed node s if there is at + // least one non start/end node s' among the neighbors of s, such that s' is + // served by r'. + // + // The neighbors_ratio is coupled with the corresponding min_neighbors and + // max_neighbors values, defining the minimum and maximum number of neighbor + // nodes considered for a given seed node: + // num_neighbors = min(max_neighbors, + // max(min_neighbors, neighbors_ratio * NUM_NON_START_END_NODES)) + // + // Neighbors ratio, and minimum and maximum number of non start/end neighbor + // nodes for the identification of spatially close routes. + optional double route_selection_neighbors_ratio = 4; + optional uint32 route_selection_min_neighbors = 5; + optional uint32 route_selection_max_neighbors = 6; } // Defines how a reference solution is perturbed. @@ -63,15 +83,39 @@ message PerturbationStrategy { } } -// The cooling schedule strategy defines how the simulated annealing temperature -// moves from the initial to the final value. +// The cooling schedule strategy defines how to compute the current simulated +// annealing temperature t given +// - the initial temperature t0 +// - the final temperature t1 +// - the current search progress 0 <= p <= 1 +// +// The value of t0 and t1 is defined by the initial_temperature and +// final_temperature in SimulatedAnnealingParameters, respectively. +// +// The search progress p is derived, at any given time, by the search limits. +// In particular, p measures how far we are in the search process w.r.t. to the +// number of explored solutions and the time limit. +// +// The temperature t, computed according to one of the strategies defined below, +// together with the selected AcceptanceStrategy, is used to guide the search +// trajectory. In particular, given a neighbor solution S', generated by the +// the application of the perturbation and improvement step to a reference +// solution S, we have that S will be replaced by S' iff +// cost(S') + t * log(U(0, 1)) < cost(S) +// where U(0, 1) is a random number sampled from a uniform distribution of real +// numbers in [0, 1]. message CoolingScheduleStrategy { enum Value { // Unspecified value. UNSET = 0; - // Exponential cooldown. + // Exponentially decreases the temperature as the search progresses. + // More precisely, t = t0 * (t1/t0)^p. EXPONENTIAL = 1; + + // Linearly decreases the temperature as the search progresses. + // More precisely, t = t0 - p * (t0 - t1). + LINEAR = 2; } } @@ -81,10 +125,10 @@ message SimulatedAnnealingParameters { // final. CoolingScheduleStrategy.Value cooling_schedule_strategy = 1; - // The initial temperature. + // The initial temperature. See CoolingScheduleStrategy for its usage. optional double initial_temperature = 2; - // The final temperature. + // The final temperature. See CoolingScheduleStrategy for its usage. optional double final_temperature = 3; // TODO(user): support automatic definition of initial and final diff --git a/ortools/constraint_solver/routing_parameters.proto b/ortools/routing/parameters.proto similarity index 99% rename from ortools/constraint_solver/routing_parameters.proto rename to ortools/routing/parameters.proto index e549f79285..ac5f8faa36 100644 --- a/ortools/constraint_solver/routing_parameters.proto +++ b/ortools/routing/parameters.proto @@ -17,14 +17,14 @@ syntax = "proto3"; -option java_package = "com.google.ortools.constraintsolver"; +option java_package = "com.google.ortools.routing"; option java_multiple_files = true; -option csharp_namespace = "Google.OrTools.ConstraintSolver"; +option csharp_namespace = "Google.OrTools.Routing"; import "google/protobuf/duration.proto"; -import "ortools/constraint_solver/routing_enums.proto"; -import "ortools/constraint_solver/routing_ils.proto"; import "ortools/constraint_solver/solver_parameters.proto"; +import "ortools/routing/enums.proto"; +import "ortools/routing/ils.proto"; import "ortools/sat/sat_parameters.proto"; import "ortools/util/optional_boolean.proto"; diff --git a/ortools/routing/parsers/carp_parser.cc b/ortools/routing/parsers/carp_parser.cc index a259974dff..b1ba0ff0e2 100644 --- a/ortools/routing/parsers/carp_parser.cc +++ b/ortools/routing/parsers/carp_parser.cc @@ -21,6 +21,7 @@ #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" +#include "absl/strings/string_view.h" #include "absl/types/span.h" #include "ortools/base/numbers.h" #include "ortools/util/filelineiter.h" @@ -49,7 +50,7 @@ bool CarpParser::LoadFile(const std::string& file_name) { return ParseFile(file_name); } -bool CarpParser::ParseFile(const std::string& file_name) { +bool CarpParser::ParseFile(absl::string_view file_name) { static auto section_headers = std::array({ "NOMBRE", "COMENTARIO", diff --git a/ortools/routing/parsers/carp_parser.h b/ortools/routing/parsers/carp_parser.h index 8a40cd0c73..cbacbc06f6 100644 --- a/ortools/routing/parsers/carp_parser.h +++ b/ortools/routing/parsers/carp_parser.h @@ -60,6 +60,7 @@ #include #include +#include "absl/strings/string_view.h" #include "absl/types/span.h" #include "ortools/base/linked_hash_map.h" #include "ortools/base/logging.h" @@ -156,7 +157,7 @@ class CarpParser { }; void Initialize(); - bool ParseFile(const std::string& file_name); + bool ParseFile(absl::string_view file_name); bool ParseMetadataLine(absl::Span words); bool ParseEdge(std::string_view line, bool with_servicing); diff --git a/ortools/routing/parsers/nearp_parser.cc b/ortools/routing/parsers/nearp_parser.cc index ece0e93fba..bc69de236e 100644 --- a/ortools/routing/parsers/nearp_parser.cc +++ b/ortools/routing/parsers/nearp_parser.cc @@ -22,6 +22,7 @@ #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" +#include "absl/strings/string_view.h" #include "ortools/base/numbers.h" #include "ortools/util/filelineiter.h" @@ -54,7 +55,7 @@ bool NearpParser::LoadFile(const std::string& file_name) { return ParseFile(file_name); } -bool NearpParser::ParseFile(const std::string& file_name) { +bool NearpParser::ParseFile(absl::string_view file_name) { // Only put the first word as header, as the main check is just done on this // first word (no ambiguity is possible for well-formed files; a more precise // check is done for metadata). diff --git a/ortools/routing/parsers/nearp_parser.h b/ortools/routing/parsers/nearp_parser.h index a07535c0ea..cc60cac5c6 100644 --- a/ortools/routing/parsers/nearp_parser.h +++ b/ortools/routing/parsers/nearp_parser.h @@ -80,6 +80,7 @@ #include #include +#include "absl/strings/string_view.h" #include "ortools/base/linked_hash_map.h" #include "ortools/base/logging.h" #include "ortools/routing/parsers/simple_graph.h" @@ -211,7 +212,7 @@ class NearpParser { }; void Initialize(); - bool ParseFile(const std::string& file_name); + bool ParseFile(absl::string_view file_name); bool ParseMetadataLine(const std::vector& words); bool ParseArc(std::string_view line, bool with_servicing); bool ParseEdge(std::string_view line, bool with_servicing); diff --git a/ortools/routing/parsers/pdtsp_parser.cc b/ortools/routing/parsers/pdtsp_parser.cc index 426c2ab511..0f34dda26f 100644 --- a/ortools/routing/parsers/pdtsp_parser.cc +++ b/ortools/routing/parsers/pdtsp_parser.cc @@ -43,7 +43,7 @@ File* OpenReadOnly(absl::string_view file_name) { PdTspParser::PdTspParser() : section_(SIZE_SECTION) {} -bool PdTspParser::LoadFile(const std::string& file_name) { +bool PdTspParser::LoadFile(absl::string_view file_name) { for (const std::string& line : FileLines(file_name, FileLineIterator::REMOVE_INLINE_CR)) { ProcessNewLine(line); diff --git a/ortools/routing/parsers/pdtsp_parser.h b/ortools/routing/parsers/pdtsp_parser.h index 2039c68463..266d55d4b1 100644 --- a/ortools/routing/parsers/pdtsp_parser.h +++ b/ortools/routing/parsers/pdtsp_parser.h @@ -22,6 +22,7 @@ #include #include +#include "absl/strings/string_view.h" #include "ortools/base/types.h" namespace operations_research { @@ -31,7 +32,7 @@ class PdTspParser { PdTspParser(); ~PdTspParser() = default; // Loads and parse a PDTSP from a given file. - bool LoadFile(const std::string& file_name); + bool LoadFile(absl::string_view file_name); // Returns the index of the depot. int depot() const { return depot_; } // Returns the number of nodes in the PDTSP. diff --git a/ortools/routing/parsers/solomon_parser.cc b/ortools/routing/parsers/solomon_parser.cc index 00d2ebc4cb..72819a3d5b 100644 --- a/ortools/routing/parsers/solomon_parser.cc +++ b/ortools/routing/parsers/solomon_parser.cc @@ -67,7 +67,7 @@ void SolomonParser::Initialize() { to_read_ = 1; } -bool SolomonParser::ParseFile(const std::string& file_name) { +bool SolomonParser::ParseFile(absl::string_view file_name) { for (const std::string& line : FileLines(file_name, FileLineIterator::REMOVE_INLINE_CR)) { const std::vector words = diff --git a/ortools/routing/parsers/solomon_parser.h b/ortools/routing/parsers/solomon_parser.h index d02a7e357d..d21c6f17b4 100644 --- a/ortools/routing/parsers/solomon_parser.h +++ b/ortools/routing/parsers/solomon_parser.h @@ -115,7 +115,7 @@ class SolomonParser { // Parsing void Initialize(); - bool ParseFile(const std::string& file_name); + bool ParseFile(absl::string_view file_name); // Parsing data const std::map sections_; diff --git a/ortools/routing/parsers/tsplib_parser.cc b/ortools/routing/parsers/tsplib_parser.cc index 836625285c..85f86b1241 100644 --- a/ortools/routing/parsers/tsplib_parser.cc +++ b/ortools/routing/parsers/tsplib_parser.cc @@ -747,7 +747,7 @@ TspLibTourParser::TspLibTourParser() : section_(UNDEFINED_SECTION), size_(0) {} // TODO(user): Return false when issues were encountered while parsing the // file. -bool TspLibTourParser::LoadFile(const std::string& file_name) { +bool TspLibTourParser::LoadFile(absl::string_view file_name) { section_ = UNDEFINED_SECTION; comments_.clear(); tour_.clear(); @@ -818,7 +818,7 @@ CVRPToursParser::CVRPToursParser() : cost_(0) {} // TODO(user): Return false when issues were encountered while parsing the // file. -bool CVRPToursParser::LoadFile(const std::string& file_name) { +bool CVRPToursParser::LoadFile(absl::string_view file_name) { tours_.clear(); cost_ = 0; std::shared_ptr zip_archive( diff --git a/ortools/routing/parsers/tsplib_parser.h b/ortools/routing/parsers/tsplib_parser.h index 75e48f24a3..6abfc62402 100644 --- a/ortools/routing/parsers/tsplib_parser.h +++ b/ortools/routing/parsers/tsplib_parser.h @@ -31,6 +31,7 @@ #include #include "absl/container/flat_hash_map.h" +#include "absl/strings/string_view.h" #include "absl/types/span.h" #include "ortools/base/types.h" #include "ortools/routing/parsers/simple_graph.h" @@ -197,7 +198,7 @@ class TspLibTourParser final { public: TspLibTourParser(); // Loads and parses a given tour file. - bool LoadFile(const std::string& file_name); + bool LoadFile(absl::string_view file_name); // Returns a vector corresponding to the sequence of nodes of the tour. const std::vector& tour() const { return tour_; } // Returns the size of the tour. @@ -236,7 +237,7 @@ class CVRPToursParser final { public: CVRPToursParser(); // Loads and parses a given tours file. - bool LoadFile(const std::string& file_name); + bool LoadFile(absl::string_view file_name); // Returns a vector corresponding to the sequence of nodes of tours. const std::vector>& tours() const { return tours_; } int64_t cost() const { return cost_; } diff --git a/ortools/routing/parsers/tsptw_parser.cc b/ortools/routing/parsers/tsptw_parser.cc index 208a3bf64e..bfabc7dea5 100644 --- a/ortools/routing/parsers/tsptw_parser.cc +++ b/ortools/routing/parsers/tsptw_parser.cc @@ -154,7 +154,7 @@ bool TspTWParser::ParseLopezIbanezBlum(const std::string& file_name) { return entry_count == size_; } -bool TspTWParser::ParseDaSilvaUrrutia(const std::string& file_name) { +bool TspTWParser::ParseDaSilvaUrrutia(absl::string_view file_name) { for (const std::string& line : FileLines(file_name, FileLineIterator::REMOVE_INLINE_CR)) { // Skip header. diff --git a/ortools/routing/parsers/tsptw_parser.h b/ortools/routing/parsers/tsptw_parser.h index b853151e18..90b1778787 100644 --- a/ortools/routing/parsers/tsptw_parser.h +++ b/ortools/routing/parsers/tsptw_parser.h @@ -25,6 +25,7 @@ #include #include +#include "absl/strings/string_view.h" #include "ortools/base/types.h" #include "ortools/routing/parsers/simple_graph.h" @@ -70,7 +71,7 @@ class TspTWParser final { void operator=(const TspTWParser&) = delete; #endif bool ParseLopezIbanezBlum(const std::string& file_name); - bool ParseDaSilvaUrrutia(const std::string& file_name); + bool ParseDaSilvaUrrutia(absl::string_view file_name); int64_t size_; int depot_; diff --git a/ortools/routing/python/routing_doc.h b/ortools/routing/python/routing_doc.h new file mode 100644 index 0000000000..9ff6d468e6 --- /dev/null +++ b/ortools/routing/python/routing_doc.h @@ -0,0 +1,3990 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + This file contains docstrings for use in the Python bindings. + Do not edit! They were automatically extracted by pybind11_mkdoc. + */ + +#define __EXPAND(x) x +#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT +#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) +#define __CAT1(a, b) a##b +#define __CAT2(a, b) __CAT1(a, b) +#define __DOC1(n1) __doc_##n1 +#define __DOC2(n1, n2) __doc_##n1##_##n2 +#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 +#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 +#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 +#define __DOC6(n1, n2, n3, n4, n5, n6) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 +#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 +#define DOC(...) \ + __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) + +#if defined(__GNUG__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +static const char* __doc_operations_research_AppendTasksFromIntervals = + R"doc()doc"; + +static const char* __doc_operations_research_BoundCost = + R"doc(A structure meant to store soft bounds and associated violation +constants. It is 'Simple' because it has one BoundCost per element, in +contrast to 'Multiple'. Design notes: - it is meant to store model +information to be shared through pointers, so it disallows copy and +assign to avoid accidental duplication. - it keeps soft bounds as an +array of structs to help cache, because code that uses such bounds +typically use both bound and cost. - soft bounds are named pairs, +prevents some mistakes. - using operator[] to access elements is not +interesting, because the structure will be accessed through pointers, +moreover having to type bound_cost reminds the user of the order if +they do a copy assignment of the element.)doc"; + +static const char* __doc_operations_research_BoundCost_BoundCost = R"doc()doc"; + +static const char* __doc_operations_research_BoundCost_BoundCost_2 = + R"doc()doc"; + +static const char* __doc_operations_research_BoundCost_bound = R"doc()doc"; + +static const char* __doc_operations_research_BoundCost_cost = R"doc()doc"; + +static const char* __doc_operations_research_DisjunctivePropagator = + R"doc(This class acts like a CP propagator: it takes a set of tasks given by +their start/duration/end features, and reduces the range of possible +values.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_ChainSpanMin = + R"doc(Propagates a lower bound of the chain span, end[num_chain_tasks] - +start[0], to span_min.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_ChainSpanMinDynamic = + R"doc(Computes a lower bound of the span of the chain, taking into account +only the first nonchain task. For more accurate results, this should +be called after Precedences(), otherwise the lower bound might be +lower than feasible.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_DetectablePrecedencesWithChain = + R"doc(Does detectable precedences deductions on tasks in the chain +precedence, taking the time windows of nonchain tasks into account.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_DistanceDuration = + R"doc(Propagates distance_duration constraints, if any.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_EdgeFinding = + R"doc(Does edge-finding deductions on all tasks.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_ForbiddenIntervals = + R"doc(Tasks might have holes in their domain, this enforces such holes.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_MirrorTasks = + R"doc(Transforms the problem with a time symmetry centered in 0. Returns +true for convenience.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_Precedences = + R"doc(Propagates the deductions from the chain of precedences, if there is +one.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_Propagate = + R"doc(Computes new bounds for all tasks, returns false if infeasible. This +does not compute a fixed point, so recalling it may filter more.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_Tasks = + R"doc(A structure to hold tasks described by their features. The first +num_chain_tasks are considered linked by a chain of precedences, i.e. +if i < j < num_chain_tasks, then end(i) <= start(j). This occurs +frequently in routing, and can be leveraged by some variants of +classic propagators.)doc"; + +static const char* __doc_operations_research_DisjunctivePropagator_Tasks_Clear = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_distance_duration = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_duration_max = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_duration_min = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_end_max = R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_end_min = R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_forbidden_intervals = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_is_preemptible = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_num_chain_tasks = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_span_max = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_span_min = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_start_max = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_Tasks_start_min = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_event_of_task = R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_nonchain_tasks_by_start_max = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_tasks_by_end_max = + R"doc()doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_tasks_by_start_min = + R"doc(Mappings between events and tasks.)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_theta_lambda_tree = + R"doc(The main algorithm uses Vilim's theta tree data structure. See Petr +Vilim's PhD thesis "Global Constraints in Scheduling".)doc"; + +static const char* + __doc_operations_research_DisjunctivePropagator_total_duration_before = + R"doc(Maps chain elements to the sum of chain task durations before them.)doc"; + +static const char* __doc_operations_research_FillPathEvaluation = R"doc()doc"; + +static const char* __doc_operations_research_FillTravelBoundsOfVehicle = + R"doc()doc"; + +static const char* __doc_operations_research_FinalizerVariables = R"doc()doc"; + +static const char* __doc_operations_research_GlobalDimensionCumulOptimizer = + R"doc()doc"; + +static const char* __doc_operations_research_GlobalVehicleBreaksConstraint = + R"doc(GlobalVehicleBreaksConstraint ensures breaks constraints are enforced +on all vehicles in the dimension passed to its constructor. It is +intended to be used for dimensions representing time. A break +constraint ensures break intervals fit on the route of a vehicle. For +a given vehicle, it forces break intervals to be disjoint from visit +intervals, where visit intervals start at CumulVar(node) and last for +node_visit_transit[node]. Moreover, it ensures that there is enough +time between two consecutive nodes of a route to do transit and +vehicle breaks, i.e. if Next(nodeA) = nodeB, CumulVar(nodeA) = tA and +CumulVar(nodeB) = tB, then SlackVar(nodeA) >= sum_{breaks \subseteq +[tA, tB)} duration(break).)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_DebugString = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_FillPartialPathOfVehicle = + R"doc(Sets path_ to be the longest sequence such that _ path_[0] is the +start of the vehicle _ Next(path_[i-1]) is Bound() and has value +path_[i], followed by the end of the vehicle if the last node was not +an end.)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_FillPathTravels = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_GlobalVehicleBreaksConstraint = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_InitialPropagate = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_Post = R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_PropagateNode = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_PropagateVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator = + R"doc(This translates pruning information to solver variables. If +constructed with an IntervalVar*, it follows the usual semantics of +IntervalVars. If constructed with an IntVar*, before_start and +after_start, operations are translated to simulate an interval that +starts at start - before_start and ends and start + after_start. If +constructed with nothing, the TaskTranslator will do nothing. This +class should have been an interface + subclasses, but that would force +pointers in the user's task vector, which means dynamic allocation. +With this union-like structure, a vector's reserved size will adjust +to usage and eventually no more dynamic allocation will be made.)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_SetDurationMin = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_SetEndMax = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_SetEndMin = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_SetStartMax = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_SetStartMin = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_TaskTranslator = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_TaskTranslator_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_TaskTranslator_3 = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_after_start = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_before_start = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_interval = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_TaskTranslator_start = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_dimension = + R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_disjunctive_propagator = + R"doc(This is used to restrict bounds of tasks.)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_model = R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_path = R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_task_translators = + R"doc(Route and interval variables are normalized to the following values.)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_tasks = R"doc()doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_travel_bounds = + R"doc(Used to help filling tasks_ at each propagation.)doc"; + +static const char* + __doc_operations_research_GlobalVehicleBreaksConstraint_vehicle_demons = + R"doc()doc"; + +static const char* __doc_operations_research_IndexNeighborFinder = + R"doc(Class to find index neighbors. Used by various parts of the vehicle +routing framework (heuristics, local search) which rely on finding +index neighbors (essentially to speed up search). It relies on having +coordinates.)doc"; + +static const char* __doc_operations_research_IndexNeighborFinder_2 = + R"doc(Class to find index neighbors. Used by various parts of the vehicle +routing framework (heuristics, local search) which rely on finding +index neighbors (essentially to speed up search). It relies on having +coordinates.)doc"; + +static const char* + __doc_operations_research_IndexNeighborFinder_FindIndexNeighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_IndexNeighborFinder_IndexNeighborFinder = + R"doc()doc"; + +static const char* + __doc_operations_research_IndexNeighborFinder_IndexNeighborFinder_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_IndexNeighborFinder_IndexNeighborFinder_3 = + R"doc()doc"; + +static const char* __doc_operations_research_IndexNeighborFinder_manager = + R"doc(When the IndexNeighborFinder is created using NodeIndex as index, the +manager_ is used to translate from variable index to NodeIndex and +back when calling FindIndexNeighbors().)doc"; + +static const char* + __doc_operations_research_IndexNeighborFinder_operator_assign = R"doc()doc"; + +static const char* __doc_operations_research_IndexNeighborFinder_points = + R"doc()doc"; + +static const char* __doc_operations_research_IntVarFilteredDecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_LocalDimensionCumulOptimizer = + R"doc()doc"; + +static const char* __doc_operations_research_LocalSearchPhaseParameters = + R"doc()doc"; + +static const char* __doc_operations_research_MakeBinCapacities = R"doc()doc"; + +static const char* __doc_operations_research_MakeVehicleBreaksFilter = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_End = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_Ends = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_GetPath = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_IsEnd = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_IsStart = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_NumPaths = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_Paths = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_PathsMetadata = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_Start = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_Starts = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_end_of_path = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_is_end = R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_is_start = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_path_of_node = + R"doc()doc"; + +static const char* __doc_operations_research_PathsMetadata_start_of_path = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension = + R"doc(for a given vehicle, it is passed as an external vector, it would be +better to have this information here.)doc"; + +static const char* __doc_operations_research_RoutingDimension_2 = + R"doc(for a given vehicle, it is passed as an external vector, it would be +better to have this information here.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_AddNodePrecedence = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_AddNodePrecedence_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_AllTransitEvaluatorSignsAreUnknown = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_AreVehicleTransitsPositive = + R"doc(Returns true iff the transit evaluator of 'vehicle' is positive for +all arcs.)doc"; + +static const char* __doc_operations_research_RoutingDimension_CloseModel = + R"doc(Finalize the model of the dimension.)doc"; + +static const char* __doc_operations_research_RoutingDimension_CumulVar = + R"doc(Get the cumul, transit and slack variables for the given node (given +as int64_t var index).)doc"; + +static const char* __doc_operations_research_RoutingDimension_FixedTransitVar = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetAllowedIntervalsInRange = + R"doc(Returns allowed intervals for a given node in a given interval.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetBinaryTransitEvaluator = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetBreakDistanceDurationOfVehicle = + R"doc(Returns the pairs (distance, duration) specified by break distance +constraints.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetBreakIntervalsOfVehicle = + R"doc(Returns the break intervals set by SetBreakIntervalsOfVehicle().)doc"; + +static const char* __doc_operations_research_RoutingDimension_GetCumulVarMax = + R"doc(Gets the current maximum of the cumul variable associated to index.)doc"; + +static const char* __doc_operations_research_RoutingDimension_GetCumulVarMin = + R"doc(Gets the current minimum of the cumul variable associated to index.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetCumulVarPiecewiseLinearCost = + R"doc(Returns the piecewise linear cost of a cumul variable for a given +variable index. The returned pointer has the same validity as this +class.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetCumulVarSoftLowerBound = + R"doc(Returns the soft lower bound of a cumul variable for a given variable +index. The "hard" lower bound of the variable is returned if no soft +lower bound has been set.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetCumulVarSoftLowerBoundCoefficient = + R"doc(Returns the cost coefficient of the soft lower bound of a cumul +variable for a given variable index. If no soft lower bound has been +set, 0 is returned.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetCumulVarSoftUpperBound = + R"doc(Returns the soft upper bound of a cumul variable for a given variable +index. The "hard" upper bound of the variable is returned if no soft +upper bound has been set.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetCumulVarSoftUpperBoundCoefficient = + R"doc(Returns the cost coefficient of the soft upper bound of a cumul +variable for a given variable index. If no soft upper bound has been +set, 0 is returned.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetFirstPossibleGreaterOrEqualValueForNode = + R"doc(Returns the smallest value outside the forbidden intervals of node +'index' that is greater than or equal to a given 'min_value'.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetGlobalOptimizerOffset = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetLastPossibleLessOrEqualValueForNode = + R"doc(Returns the largest value outside the forbidden intervals of node +'index' that is less than or equal to a given 'max_value'. NOTE: If +this method is called with a max_value lower than the node's cumul +min, it will return -1.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetLocalOptimizerOffsetForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetNodePrecedences = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetPathPrecedenceGraph = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetPickupToDeliveryLimitForPair = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetPostTravelEvaluatorOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetPreTravelEvaluatorOfVehicle = + R"doc(!defined(SWIGPYTHON))doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetQuadraticCostSoftSpanUpperBoundForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSlackCostCoefficientForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSlackCostCoefficientForVehicleClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSoftSpanUpperBoundForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSpanCostCoefficientForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSpanCostCoefficientForVehicleClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetSpanUpperBoundForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetTransitEvaluatorSign = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_GetTransitValue = + R"doc(Returns the transition value for a given pair of nodes (as var index); +this value is the one taken by the corresponding transit variable when +the 'next' variable for 'from_index' is bound to 'to_index'.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetTransitValueFromClass = + R"doc(Same as above but taking a vehicle class of the dimension instead of a +vehicle (the class of a vehicle can be obtained with +vehicle_to_class()).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_GetUnaryTransitEvaluator = + R"doc(Returns the unary callback evaluating the transit value between two +node indices for a given vehicle. If the corresponding callback is not +unary, returns a null callback.)doc"; + +static const char* __doc_operations_research_RoutingDimension_HasBreakConstraints = + R"doc(Returns true if any break interval or break distance was defined.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasCumulVarPiecewiseLinearCost = + R"doc(Returns true if a piecewise linear cost has been set for a given +variable index.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasCumulVarSoftLowerBound = + R"doc(Returns true if a soft lower bound has been set for a given variable +index.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasCumulVarSoftUpperBound = + R"doc(Returns true if a soft upper bound has been set for a given variable +index.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasPickupToDeliveryLimits = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasQuadraticCostSoftSpanUpperBounds = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_HasSoftSpanUpperBounds = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_Initialize = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_InitializeBreaks = + R"doc(Sets up vehicle_break_intervals_, vehicle_break_distance_duration_, +pre_travel_evaluators and post_travel_evaluators.)doc"; + +static const char* __doc_operations_research_RoutingDimension_InitializeCumuls = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_InitializeTransitVariables = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_InitializeTransits = R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_IsUnary = + R"doc(Returns true iff all transit evaluators for this dimension are unary.)doc"; + +static const char* __doc_operations_research_RoutingDimension_NodePrecedence = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_NodePrecedence_first_node = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_NodePrecedence_offset = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_NodePrecedence_second_node = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_PiecewiseLinearCost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_PiecewiseLinearCost_PiecewiseLinearCost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_PiecewiseLinearCost_cost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_PiecewiseLinearCost_var = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_RoutingDimension = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_RoutingDimension_2 = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_RoutingDimension_3 = R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_SelfBased = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetBreakDistanceDurationOfVehicle = + R"doc(With breaks supposed to be consecutive, this forces the distance +between breaks of size at least minimum_break_duration to be at most +distance. This supposes that the time until route start and after +route end are infinite breaks.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetBreakIntervalsOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetBreakIntervalsOfVehicle_2 = + R"doc(Deprecated, sets pre_travel(i, j) = node_visit_transit[i].)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetBreakIntervalsOfVehicle_3 = + R"doc(Deprecated, sets pre_travel(i, j) = node_visit_transit[i] and +post_travel(i, j) = delays(i, j).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetCumulVarPiecewiseLinearCost = + R"doc(Sets a piecewise linear cost on the cumul variable of a given variable +index. If f is a piecewise linear function, the resulting cost at +'index' will be f(CumulVar(index)). As of 3/2017, only non-decreasing +positive cost functions are supported.)doc"; + +static const char* __doc_operations_research_RoutingDimension_SetCumulVarRange = + R"doc(Restricts the range of the cumul variable associated to index.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetCumulVarSoftLowerBound = + R"doc(Sets a soft lower bound to the cumul variable of a given variable +index. If the value of the cumul variable is less than the bound, a +cost proportional to the difference between this value and the bound +is added to the cost function of the model: cumulVar > lower_bound -> +cost = 0 cumulVar <= lower_bound -> cost = coefficient * (lower_bound +- cumulVar). This is also handy to model earliness costs when the +dimension represents time.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetCumulVarSoftUpperBound = + R"doc(Sets a soft upper bound to the cumul variable of a given variable +index. If the value of the cumul variable is greater than the bound, a +cost proportional to the difference between this value and the bound +is added to the cost function of the model: cumulVar <= upper_bound -> +cost = 0 cumulVar > upper_bound -> cost = coefficient * (cumulVar - +upper_bound) This is also handy to model tardiness costs when the +dimension represents time.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetGlobalSpanCostCoefficient = + R"doc(Sets a cost proportional to the *global* dimension span, that is the +difference between the largest value of route end cumul variables and +the smallest value of route start cumul variables. In other words: +global_span_cost = coefficient * (Max(dimension end value) - +Min(dimension start value)).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetOffsetForGlobalOptimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetPickupToDeliveryLimitFunctionForPair = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetQuadraticCostSoftSpanUpperBoundForVehicle = + R"doc(If the span of vehicle on this dimension is larger than bound, the +cost will be increased by cost * (span - bound)^2.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSlackCostCoefficientForAllVehicles = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSlackCostCoefficientForVehicle = + R"doc(Sets a cost proportional to the dimension total slack on a given +vehicle, or on all vehicles at once. "coefficient" must be +nonnegative. This is handy to model costs only proportional to idle +time when the dimension represents time. The cost for a vehicle is +slack_cost = coefficient * (dimension end value - dimension start +value - total_transit).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSoftSpanUpperBoundForVehicle = + R"doc(If the span of vehicle on this dimension is larger than bound, the +cost will be increased by cost * (span - bound).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSpanCostCoefficientForAllVehicles = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSpanCostCoefficientForVehicle = + R"doc(Sets a cost proportional to the dimension span on a given vehicle, or +on all vehicles at once. "coefficient" must be nonnegative. This is +handy to model costs proportional to idle time when the dimension +represents time. The cost for a vehicle is span_cost = coefficient * +(dimension end value - dimension start value).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetSpanUpperBoundForVehicle = + R"doc(!defined(SWIGPYTHON) Sets an upper bound on the dimension span on a +given vehicle. This is the preferred way to limit the "length" of the +route of a vehicle according to a dimension.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetVehicleOffsetsForLocalOptimizer = + R"doc(Moves elements of "offsets" into vehicle_offsets_for_local_optimizer_.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetupCumulVarPiecewiseLinearCosts = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetupCumulVarSoftLowerBoundCosts = + R"doc(Sets up the cost variables related to cumul soft lower bounds.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetupCumulVarSoftUpperBoundCosts = + R"doc(Sets up the cost variables related to cumul soft upper bounds.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetupGlobalSpanCost = + R"doc(Sets up the cost variables related to the global span and per-vehicle +span costs (only for the "slack" part of the latter).)doc"; + +static const char* + __doc_operations_research_RoutingDimension_SetupSlackAndDependentTransitCosts = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_ShortestTransitionSlack = + R"doc(It makes sense to use the function only for self-dependent dimension. +For such dimensions the value of the slack of a node determines the +transition cost of the next transit. Provided that 1. cumul[node] is +fixed, 2. next[node] and next[next[node]] (if exists) are fixed, the +value of slack[node] for which cumul[next[node]] + transit[next[node]] +is minimized can be found in O(1) using this function.)doc"; + +static const char* __doc_operations_research_RoutingDimension_SlackVar = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_SoftBound = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_SoftBound_bound = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_SoftBound_coefficient = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_SoftBound_var = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_TransitVar = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_base_dimension = + R"doc(Returns the parent in the dependency tree if any or nullptr otherwise.)doc"; + +static const char* __doc_operations_research_RoutingDimension_base_dimension_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_break_constraints_are_initialized = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_capacity_vars = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_class_evaluators = + R"doc(Values in class_evaluators_ correspond to the evaluators in +RoutingModel::transit_evaluators_ for each vehicle class.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_class_transit_evaluator = + R"doc(Returns the callback evaluating the transit value between two node +indices for a given vehicle class.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_cumul_var_piecewise_linear_cost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_cumul_var_soft_lower_bound = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_cumul_var_soft_upper_bound = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_cumuls = + R"doc(Like CumulVar(), TransitVar(), SlackVar() but return the whole +variable vectors instead (indexed by int64_t var index).)doc"; + +static const char* __doc_operations_research_RoutingDimension_cumuls_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_dependent_transits = R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_fixed_transits = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_fixed_transits_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_forbidden_intervals = + R"doc(Returns forbidden intervals for each node.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_forbidden_intervals_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_global_optimizer_offset = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_global_span_cost_coefficient = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_global_span_cost_coefficient_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_local_optimizer_offset_for_vehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_model = + R"doc(Returns the model on which the dimension was created.)doc"; + +static const char* __doc_operations_research_RoutingDimension_model_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_name = + R"doc(Returns the name of the dimension.)doc"; + +static const char* __doc_operations_research_RoutingDimension_name_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_node_precedences = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_operator_assign = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_path_precedence_graph = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_pickup_to_delivery_limits_per_pair_index = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_slacks = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_slacks_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_state_dependent_class_evaluators = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_state_dependent_vehicle_to_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_transit_evaluator = + R"doc(Returns the callback evaluating the transit value between two node +indices for a given vehicle.)doc"; + +static const char* __doc_operations_research_RoutingDimension_transits = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_transits_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_break_distance_duration = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_break_intervals = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_capacities = + R"doc(Returns the capacities for all vehicles.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_capacities_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_post_travel_evaluators = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_pre_travel_evaluators = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_quadratic_cost_soft_span_upper_bound = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_slack_cost_coefficients = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_slack_cost_coefficients_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_soft_span_upper_bound = + R"doc(nullptr if not defined.)doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_span_cost_coefficients = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_span_cost_coefficients_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_span_upper_bounds = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_span_upper_bounds_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingDimension_vehicle_to_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingDimension_vehicle_to_class_2 = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModelVisitor = + R"doc(Routing model visitor.)doc"; + +static const char* __doc_operations_research_RoutingModel_ActiveVar = + R"doc(Returns the active variable of the node corresponding to index.)doc"; + +static const char* __doc_operations_research_RoutingModel_ActiveVehicleVar = + R"doc(Returns the active variable of the vehicle. It will be equal to 1 iff +the route of the vehicle is not empty, 0 otherwise.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddAtSolutionCallback = + R"doc(Adds a callback called each time a solution is found during the +search. This is a shortcut to creating a monitor to call the callback +on AtSolution() and adding it with AddSearchMonitor. If +track_unchecked_neighbors is true, the callback will also be called on +AcceptUncheckedNeighbor() events, which is useful to grab solutions +obtained when solver_parameters.check_solution_period > 1 (aka +fastLS).)doc"; + +static const char* __doc_operations_research_RoutingModel_AddConstantDimension = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddConstantDimensionWithSlack = + R"doc(Creates a dimension where the transit variable is constrained to be +equal to 'value'; 'capacity' is the upper bound of the cumul +variables. 'name' is the name used to reference the dimension; this +name is used to get cumul and transit variables from the routing +model. Returns a pair consisting of an index to the registered unary +transit callback and a bool denoting whether the dimension has been +created. It is false if a dimension with the same name has already +been created (and doesn't create the new dimension but still register +a new callback).)doc"; + +static const char* __doc_operations_research_RoutingModel_AddDimension = + R"doc(Creates a dimension where the transit variable is constrained to be +equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the +slack variable and 'capacity' is the upper bound of the cumul +variables. 'name' is the name used to reference the dimension; this +name is used to get cumul and transit variables from the routing +model. Returns false if a dimension with the same name has already +been created (and doesn't create the new dimension). Takes ownership +of the callback 'evaluator'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionDependentDimensionWithVehicleCapacity = + R"doc(Creates a dimension with transits depending on the cumuls of another +dimension. 'pure_transits' are the per-vehicle fixed transits as +above. 'dependent_transits' is a vector containing for each vehicle an +index to a registered state dependent transit callback. +'base_dimension' indicates the dimension from which the cumul variable +is taken. If 'base_dimension' is nullptr, then the newly created +dimension is self-based.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionDependentDimensionWithVehicleCapacity_2 = + R"doc(As above, but pure_transits are taken to be zero evaluators.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionDependentDimensionWithVehicleCapacity_3 = + R"doc(Homogeneous versions of the functions above.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionDependentDimensionWithVehicleCapacity_4 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionDependentDimensionWithVehicleCapacityInternal = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionWithCapacityInternal = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionWithVehicleCapacity = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionWithVehicleTransitAndCapacity = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AddDimensionWithVehicleTransits = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_AddDisjunction = + R"doc(Adds a disjunction constraint on the indices: exactly +'max_cardinality' of the indices are active. Start and end indices of +any vehicle cannot be part of a disjunction. + +If a penalty is given, at most 'max_cardinality' of the indices can be +active, and if less are active, 'penalty' is payed per inactive index. +This is equivalent to adding the constraint: p + Sum(i)active[i] == +max_cardinality where p is an integer variable, and the following cost +to the cost function: p * penalty. 'penalty' must be positive to make +the disjunction optional; a negative penalty will force +'max_cardinality' indices of the disjunction to be performed, and +therefore p == 0. Note: passing a vector with a single index will +model an optional index with a penalty cost if it is not visited.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddHardTypeIncompatibility = + R"doc(Incompatibilities: Two nodes with "hard" incompatible types cannot +share the same route at all, while with a "temporal" incompatibility +they can't be on the same route at the same time.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddIntervalToAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_AddLocalSearchFilter = + R"doc(Adds a custom local search filter to the list of filters used to speed +up local search by pruning unfeasible variable assignments. Calling +this method after the routing model has been closed (CloseModel() or +Solve() has been called) has no effect. The routing model does not +take ownership of the filter.)doc"; + +static const char* __doc_operations_research_RoutingModel_AddLocalSearchOperator = + R"doc(Adds a local search operator to the set of operators used to solve the +vehicle routing problem.)doc"; + +static const char* __doc_operations_research_RoutingModel_AddMatrixDimension = + R"doc(Creates a dimension where the transit variable is constrained to be +equal to 'values[i][next(i)]' for node i; 'capacity' is the upper +bound of the cumul variables. 'name' is the name used to reference the +dimension; this name is used to get cumul and transit variables from +the routing model. Returns a pair consisting of an index to the +registered transit callback and a bool denoting whether the dimension +has been created. It is false if a dimension with the same name has +already been created (and doesn't create the new dimension but still +register a new callback).)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddNoCycleConstraintInternal = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_AddPickupAndDelivery = + R"doc(Notifies that index1 and index2 form a pair of nodes which should +belong to the same route. This methods helps the search find better +solutions, especially in the local search phase. It should be called +each time you have an equality constraint linking the vehicle +variables of two node (including for instance pickup and delivery +problems): Solver* const solver = routing.solver(); int64_t index1 = +manager.NodeToIndex(node1); int64_t index2 = +manager.NodeToIndex(node2); +solver->AddConstraint(solver->MakeEquality( +routing.VehicleVar(index1), routing.VehicleVar(index2))); +routing.AddPickupAndDelivery(index1, index2);)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddPickupAndDeliverySets = + R"doc(Same as AddPickupAndDelivery but notifying that the performed node +from the disjunction of index 'pickup_disjunction' is on the same +route as the performed node from the disjunction of index +'delivery_disjunction'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddPickupAndDeliverySetsInternal = + R"doc(Sets up pickup and delivery sets.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddRequiredTypeAlternativesWhenAddingType = + R"doc(If type_D depends on type_R when adding type_D, any node_D of type_D +and VisitTypePolicy TYPE_ADDED_TO_VEHICLE or +TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED requires at least one type_R on +its vehicle at the time node_D is visited.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddRequiredTypeAlternativesWhenRemovingType = + R"doc(The following requirements apply when visiting dependent nodes that +remove their type from the route, i.e. type_R must be on the vehicle +when type_D of VisitTypePolicy ADDED_TYPE_REMOVED_FROM_VEHICLE, +TYPE_ON_VEHICLE_UP_TO_VISIT or TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED +is visited.)doc"; + +static const char* __doc_operations_research_RoutingModel_AddResourceGroup = + R"doc(Adds a resource group to the routing model and returns a pointer to +it.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddSameVehicleRequiredTypeAlternatives = + R"doc(Requirements: NOTE: As of 2019-04, cycles in the requirement graph are +not supported, and lead to the dependent nodes being skipped if +possible (otherwise the model is considered infeasible). The following +functions specify that "dependent_type" requires at least one of the +types in "required_type_alternatives". + +For same-vehicle requirements, a node of dependent type type_D +requires at least one node of type type_R among the required +alternatives on the same route.)doc"; + +static const char* __doc_operations_research_RoutingModel_AddSearchMonitor = + R"doc(Adds a search monitor to the search used to solve the routing model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddSoftSameVehicleConstraint = + R"doc(Adds a soft constraint to force a set of variable indices to be on the +same vehicle. If all nodes are not on the same vehicle, each extra +vehicle used adds 'cost' to the cost function.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddTemporalTypeIncompatibility = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_AddToAssignment = + R"doc(Adds an extra variable to the vehicle routing assignment.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddVariableMaximizedByFinalizer = + R"doc(Adds a variable to maximize in the solution finalizer (see above for +information on the solution finalizer).)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddVariableMinimizedByFinalizer = + R"doc(Adds a variable to minimize in the solution finalizer. The solution +finalizer is called each time a solution is found during the search +and allows to instantiate secondary variables (such as dimension cumul +variables).)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddVariableTargetToFinalizer = + R"doc(Add a variable to set the closest possible to the target value in the +solution finalizer.)doc"; + +static const char* __doc_operations_research_RoutingModel_AddVectorDimension = + R"doc(Creates a dimension where the transit variable is constrained to be +equal to 'values[i]' for node i; 'capacity' is the upper bound of the +cumul variables. 'name' is the name used to reference the dimension; +this name is used to get cumul and transit variables from the routing +model. Returns a pair consisting of an index to the registered unary +transit callback and a bool denoting whether the dimension has been +created. It is false if a dimension with the same name has already +been created (and doesn't create the new dimension but still register +a new callback).)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddWeightedVariableMaximizedByFinalizer = + R"doc(Adds a variable to maximize in the solution finalizer, with a weighted +priority: the higher the more priority it has.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddWeightedVariableMinimizedByFinalizer = + R"doc(Adds a variable to minimize in the solution finalizer, with a weighted +priority: the higher the more priority it has.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AddWeightedVariableTargetToFinalizer = + R"doc(Same as above with a weighted priority: the higher the cost, the more +priority it has to be set close to the target value.)doc"; + +static const char* __doc_operations_research_RoutingModel_AppendArcCosts = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_AppendAssignmentIfFeasible = + R"doc(Append an assignment to a vector of assignments if it is feasible.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AppendHomogeneousArcCosts = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ApplyLocks = + R"doc(Applies a lock chain to the next search. 'locks' represents an ordered +vector of nodes representing a partial route which will be fixed +during the next search; it will constrain next variables such that: +next[locks[i]] == locks[i+1]. + +Returns the next variable at the end of the locked chain; this +variable is not locked. An assignment containing the locks can be +obtained by calling PreAssignment().)doc"; + +static const char* + __doc_operations_research_RoutingModel_ApplyLocksToAllVehicles = + R"doc(Applies lock chains to all vehicles to the next search, such that +locks[p] is the lock chain for route p. Returns false if the locks do +not contain valid routes; expects that the routes do not contain the +depots, i.e. there are empty vectors in place of empty routes. If +close_routes is set to true, adds the end nodes to the route of each +vehicle and deactivates other nodes. An assignment containing the +locks can be obtained by calling PreAssignment().)doc"; + +static const char* + __doc_operations_research_RoutingModel_ArcIsMoreConstrainedThanArc = + R"doc(Returns whether the arc from->to1 is more constrained than from->to2, +taking into account, in order: - whether the destination node isn't an +end node - whether the destination node is mandatory - whether the +destination node is bound to the same vehicle as the source - the +"primary constrained" dimension (see SetPrimaryConstrainedDimension) +It then breaks ties using, in order: - the arc cost (taking +unperformed penalties into account) - the size of the vehicle vars of +"to1" and "to2" (lowest size wins) - the value: the lowest value of +the indices to1 and to2 wins. See the .cc for details. The more +constrained arc is typically preferable when building a first +solution. This method is intended to be used as a callback for the +BestValueByComparisonSelector value selector. Args: from: the variable +index of the source node to1: the variable index of the first +candidate destination node. to2: the variable index of the second +candidate destination node.)doc"; + +static const char* + __doc_operations_research_RoutingModel_AreRoutesInterdependent = + R"doc(Returns true if routes are interdependent. This means that any +modification to a route might impact another.)doc"; + +static const char* __doc_operations_research_RoutingModel_AssignmentToRoutes = + R"doc(Converts the solution in the given assignment to routes for all +vehicles. Expects that assignment contains a valid solution (i.e. +routes for all vehicles end with an end index for that vehicle).)doc"; + +static const char* __doc_operations_research_RoutingModel_CancelSearch = + R"doc(Cancels the current search.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CheckIfAssignmentIsFeasible = + R"doc(Checks if an assignment is feasible.)doc"; + +static const char* __doc_operations_research_RoutingModel_CheckLimit = + R"doc(Returns true if the search limit has been crossed with the given time +offset.)doc"; + +static const char* __doc_operations_research_RoutingModel_CloseModel = + R"doc(Closes the current routing model; after this method is called, no +modification to the model can be done, but RoutesToAssignment becomes +available. Note that CloseModel() is automatically called by Solve() +and other methods that produce solution. This is equivalent to calling +CloseModelWithParameters(DefaultRoutingSearchParameters()).)doc"; + +static const char* + __doc_operations_research_RoutingModel_CloseModelWithParameters = + R"doc(Same as above taking search parameters (as of 10/2015 some the +parameters have to be set when closing the model).)doc"; + +static const char* __doc_operations_research_RoutingModel_CloseVisitTypes = + R"doc("close" types.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CompactAndCheckAssignment = + R"doc(Same as CompactAssignment() but also checks the validity of the final +compact solution; if it is not valid, no attempts to repair it are +made (instead, the method returns nullptr).)doc"; + +static const char* __doc_operations_research_RoutingModel_CompactAssignment = + R"doc(Returns a compacted version of the given assignment, in which all +vehicles with id lower or equal to some N have non-empty routes, and +all vehicles with id greater than N have empty routes. Does not take +ownership of the returned object. If found, the cost of the compact +assignment is the same as in the original assignment and it preserves +the values of 'active' variables. Returns nullptr if a compact +assignment was not found. This method only works in homogenous mode, +and it only swaps equivalent vehicles (vehicles with the same start +and end nodes). When creating the compact assignment, the empty plan +is replaced by the route assigned to the compatible vehicle with the +highest id. Note that with more complex constraints on vehicle +variables, this method might fail even if a compact solution exists. +This method changes the vehicle and dimension variables as necessary. +While compacting the solution, only basic checks on vehicle variables +are performed; if one of these checks fails no attempts to repair it +are made (instead, the method returns nullptr).)doc"; + +static const char* + __doc_operations_research_RoutingModel_CompactAssignmentInternal = + R"doc(See CompactAssignment. Checks the final solution if +check_compact_assignment is true.)doc"; + +static const char* __doc_operations_research_RoutingModel_ComputeCostClasses = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ComputeLowerBound = + R"doc(Computes a lower bound to the routing problem solving a linear +assignment problem. The routing model must be closed before calling +this method. Note that problems with node disjunction constraints +(including optional nodes) and non-homogenous costs are not supported +(the method returns 0 in these cases).)doc"; + +static const char* __doc_operations_research_RoutingModel_ComputeResourceClasses = + R"doc(Computes resource classes for all resource groups in the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ComputeVehicleClasses = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ComputeVehicleTypes = + R"doc(The following method initializes the vehicle_type_container_: - +Computes the vehicle types of vehicles and stores it in +type_index_of_vehicle. - The vehicle classes corresponding to each +vehicle type index are stored and sorted by fixed cost in +sorted_vehicle_classes_per_type. - The vehicles for each vehicle class +are stored in vehicles_per_vehicle_class.)doc"; + +static const char* __doc_operations_research_RoutingModel_ConcatenateOperators = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CostCacheElement = + R"doc(Storage of a cost cache element corresponding to a cost arc ending at +node 'index' and on the cost class 'cost_class'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CostCacheElement_cost = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostCacheElement_cost_class_index = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostCacheElement_index = + R"doc(This is usually an int64_t, but using an int here decreases the RAM +usage, and should be fine since in practice we never have more than +1<<31 vars. Note(user): on 2013-11, microbenchmarks on the arc costs +callbacks also showed a 2% speed-up thanks to using int rather than +int64_t.)doc"; + +static const char* __doc_operations_research_RoutingModel_CostClass = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CostClass_CostClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost = + R"doc(Only dimensions that have non-zero cost evaluator and a non-zero cost +coefficient (in this cost class) are listed here. Since we only need +their transit evaluator (the raw version that takes var index, not +Node Index) and their span cost coefficient, we just store those. This +is sorted by the natural operator < (and *not* by DimensionIndex).)doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost_dimension = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost_operator_lt = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost_slack_cost_coefficient = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost_span_cost_coefficient = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_DimensionCost_transit_evaluator_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CostClass_dimension_transit_evaluator_class_and_cost_coefficient = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CostClass_evaluator_index = + R"doc(Index of the arc cost evaluator, registered in the RoutingModel class.)doc"; + +static const char* __doc_operations_research_RoutingModel_CostVar = + R"doc(Returns the global cost variable which is being minimized.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CostsAreHomogeneousAcrossVehicles = + R"doc(Whether costs are homogeneous across all vehicles.)doc"; + +static const char* __doc_operations_research_RoutingModel_CreateCPOperator = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreateCPOperator_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateCPOperatorWithNeighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateCPOperatorWithNeighbors_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreateDisjunction = + R"doc(Returns nullptr if no penalty cost, otherwise returns penalty +variable.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateFirstSolutionDecisionBuilders = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateInsertionOperator = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateIntVarFilteredDecisionBuilder = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateLocalSearchFilters = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateLocalSearchParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateMakeInactiveOperator = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateNeighborhoodOperators = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreateOperator = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreateOperator_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateOperatorWithNeighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateOperatorWithNeighborsRatio = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateOperatorWithNeighborsRatio_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateOperatorWithNeighborsRatio_3 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreatePairOperator = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreatePairOperator_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_CreatePrimaryLocalSearchDecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_CreateSameVehicleCost = + R"doc(Returns the cost variable related to the soft same vehicle constraint +of index 'vehicle_index'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_CreateSolutionFinalizer = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_DebugOutputAssignment = + R"doc(Print some debugging information about an assignment, including the +feasible intervals of the CumulVar for dimension "dimension_to_print" +at each step of the routes. If "dimension_to_print" is omitted, all +dimensions will be printed.)doc"; + +static const char* + __doc_operations_research_RoutingModel_DetectImplicitPickupAndDeliveries = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_DimensionCumulOptimizers = + R"doc(Internal struct used to store the lp/mp versions of the local and +global cumul optimizers for a given dimension.)doc"; + +static const char* + __doc_operations_research_RoutingModel_DimensionCumulOptimizers_lp_optimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_DimensionCumulOptimizers_mp_optimizer = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_DisjunctionValues = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_DisjunctionValues_max_cardinality = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_DisjunctionValues_penalty = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_DoRestoreAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_End = + R"doc(Returns the variable index of the ending node of a vehicle route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_FastSolveFromAssignmentWithParameters = + R"doc(Improves a given assignment using unchecked local search. If +check_solution_in_cp is true the final solution will be checked with +the CP solver. As of 11/2023, only works with greedy descent.)doc"; + +static const char* __doc_operations_research_RoutingModel_FilterOptions = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_FilterOptions_filter_objective = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_FilterOptions_filter_with_cp_solver = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_FilterOptions_operator_eq = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_FinalizeAllowedVehicles = + R"doc(The following method looks at node-to-vehicle assignment feasibility +based on node transit values on unary dimensions: If the (absolute) +value of transit for a node is greater than the vehicle capacity on +any dimension, this node cannot be served by this vehicle and the +latter is thus removed from allowed_vehicles_[node].)doc"; + +static const char* __doc_operations_research_RoutingModel_FinalizeVisitTypes = + R"doc(This method scans the visit types and sets up the following members: - +single_nodes_of_type_[type] contains indices of nodes of visit type +"type" which are not part of any pickup/delivery pair. - +pair_indices_of_type_[type] is the set of "pair_index" such that +pickup_delivery_pairs_[pair_index] has at least one pickup or delivery +with visit type "type". - topologically_sorted_visit_types_ contains +the visit types in topological order based on required-->dependent +arcs from the visit type requirements.)doc"; + +static const char* + __doc_operations_research_RoutingModel_FindErrorInSearchParametersForModel = + R"doc(Checks that the current search parameters are valid for the current +model's specific settings.)doc"; + +static const char* __doc_operations_research_RoutingModel_FindNextActive = + R"doc(Returns the first active variable index in 'indices' starting from +index + 1.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ForEachNodeInDisjunctionWithMaxCardinalityFromIndex = + R"doc(Calls f for each variable index of indices in the same disjunctions as +the node corresponding to the variable index 'index'; only +disjunctions of cardinality 'cardinality' are considered.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetAllDimensionNames = + R"doc(Outputs the names of all dimensions added to the routing engine.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetAmortizedLinearCostFactorOfVehicles = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetAmortizedQuadraticCostFactorOfVehicles = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetArcCostForClass = + R"doc(Returns the cost of the segment between two nodes for a given cost +class. Input are variable indices of nodes and the cost class. Unlike +GetArcCostForVehicle(), if cost_class is kNoCost, then the returned +cost won't necessarily be zero: only some of the components of the +cost that depend on the cost class will be omited. See the code for +details.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetArcCostForClassInternal = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetArcCostForFirstSolution = + R"doc(Returns the cost of the arc in the context of the first solution +strategy. This is typically a simplification of the actual cost; see +the .cc.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetArcCostForVehicle = + R"doc(Returns the cost of the transit arc between two nodes for a given +vehicle. Input are variable indices of node. This returns 0 if vehicle +< 0.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetAutomaticFirstSolutionStrategy = + R"doc(Returns the automatic first solution strategy selected.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetBinCapacities = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetCostClassIndexOfVehicle = + R"doc(Get the cost class index of the given vehicle.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetCostClassesCount = + R"doc(Returns the number of different cost classes in the model.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetCumulBounds = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetDeliveryPositions = + R"doc(Returns the pickup and delivery positions where the node is a +delivery.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetDepot = + R"doc(Returns the variable index of the first starting or ending node of all +routes. If all routes start and end at the same node (single depot), +this is the node returned.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetDimensionIndex = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetDimensionOrDie = + R"doc(Returns a dimension from its name. Dies if the dimension does not +exist.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionResourceGroupIndex = + R"doc(Returns the index of the resource group attached to the dimension. +DCHECKS that there's exactly one resource group for this dimension.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionResourceGroupIndices = + R"doc(Returns the indices of resource groups for this dimension. This method +can only be called after the model has been closed.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionTransitCostSum = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetDimensions = + R"doc(Returns all dimensions of the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionsWithGlobalCumulOptimizers = + R"doc(Returns the dimensions which have +[global|local]_dimension_optimizers_.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionsWithLocalCumulOptimizers = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDimensionsWithSoftOrSpanCosts = + R"doc(Returns dimensions with soft or vehicle span costs.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetDisjunctionIndices = + R"doc(Returns the indices of the disjunctions to which an index belongs.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDisjunctionMaxCardinality = + R"doc(Returns the maximum number of possible active nodes of the node +disjunction of index 'index'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetDisjunctionNodeIndices = + R"doc(Returns the variable indices of the nodes in the disjunction of index +'index'.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetDisjunctionPenalty = + R"doc(Returns the penalty of the node disjunction of index 'index'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetFilteredFirstSolutionDecisionBuilderOrNull = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetFirstSolutionDecisionBuilder = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetFixedCostOfVehicle = + R"doc(Returns the route fixed cost taken into account if the route of the +vehicle is not empty, aka there's at least one node on the route other +than the first and last nodes.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetGlobalCumulOptimizerIndex = + R"doc(Returns the internal global/local optimizer index for the given +dimension if any, and -1 otherwise.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetHardTypeIncompatibilitiesOfType = + R"doc(Returns visit types incompatible with a given type.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetHomogeneousCost = + R"doc(Returns the cost of the segment between two nodes supposing all +vehicle costs are the same (returns the cost for the first vehicle +otherwise).)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetImplicitUniquePickupAndDeliveryPairs = + R"doc(Returns implicit pickup and delivery pairs currently in the model. +Pairs are implicit if they are not linked by a pickup and delivery +constraint but that for a given unary dimension, the first element of +the pair has a positive demand d, and the second element has a demand +of -d.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetLocalCumulOptimizerIndex = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMaximumNumberOfActiveVehicles = + R"doc(Returns the maximum number of active vehicles.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableCPInterrupt = + R"doc(Returns the atomic to stop the CP solver.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableCPSatInterrupt = + R"doc(Returns the atomic to stop the CP-SAT solver.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetMutableDimension = + R"doc(Returns a dimension from its name. Returns nullptr if the dimension +does not exist.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableGlobalCumulLPOptimizer = + R"doc(Returns the global/local dimension cumul optimizer for a given +dimension, or nullptr if there is none.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableGlobalCumulMPOptimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableLocalCumulLPOptimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetMutableLocalCumulMPOptimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNeighborhoodOperators = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetNextVarMax = + R"doc(Get the current maximum of the next variable associated to index.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetNextVarMin = + R"doc(Get the current minimum of the next variable associated to index.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNonZeroCostClassesCount = + R"doc(Ditto, minus the 'always zero', built-in cost class.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNumOfSingletonNodes = + R"doc(Returns the number of non-start/end nodes which do not appear in a +pickup/delivery pair.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNumberOfDecisionsInFirstSolution = + R"doc(Returns statistics on first solution search, number of decisions sent +to filters, number of decisions rejected by filters.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNumberOfDisjunctions = + R"doc(Returns the number of node disjunctions in the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNumberOfRejectsInFirstSolution = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetNumberOfVisitTypes = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateAssignment = + R"doc(Set of auxiliary methods used to setup the search.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateCumulativeLimit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateFirstSolutionLargeNeighborhoodSearchLimit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateLargeNeighborhoodSearchLimit = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetOrCreateLimit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateLocalSearchFilterManager = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateLocalSearchLimit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateNodeNeighborsByCostClass = + R"doc(Returns neighbors of all nodes for every cost class. The result is +cached and is computed once. The number of neighbors considered is +based on a ratio of non-vehicle nodes, specified by neighbors_ratio, +with a minimum of min-neighbors node considered.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateNodeNeighborsByCostClass_2 = + R"doc(Returns parameters.num_neighbors neighbors of all nodes for every cost +class. The result is cached and is computed once.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetOrCreateTmpAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetPairIndicesOfType = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetPathsMetadata = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetPerfectBinaryDisjunctions = + R"doc(Returns the list of all perfect binary disjunctions, as pairs of +variable indices: a disjunction is "perfect" when its variables do not +appear in any other disjunction. Each pair is sorted (lowest variable +index first), and the output vector is also sorted (lowest pairs +first).)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetPickupAndDeliveryDisjunctions = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetPickupAndDeliveryPairs = + R"doc(Returns pickup and delivery pairs currently in the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetPickupAndDeliveryPolicyOfVehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetPickupPositions = + R"doc(Returns the pickup and delivery positions where the node is a pickup.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetPrimaryConstrainedDimension = + R"doc(Get the primary constrained dimension, or an empty string if it is +unset.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetResourceGroup = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetResourceGroups = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetRoutesFromAssignment = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetSameVehicleIndicesOfIndex = + R"doc(Returns variable indices of nodes constrained to be on the same route.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetSearchMonitors = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetSingleNodesOfType = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetTemporalTypeIncompatibilitiesOfType = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetTopologicallySortedVisitTypes = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetUnaryDimensions = + R"doc(Returns dimensions for which all transit evaluators are unary.)doc"; + +static const char* + __doc_operations_research_RoutingModel_GetVehicleClassIndexOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetVehicleClassesCount = + R"doc(Returns the number of different vehicle classes in the model.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetVehicleOfClass = + R"doc(Returns a vehicle of the given vehicle class, and -1 if there are no +vehicles for this class.)doc"; + +static const char* __doc_operations_research_RoutingModel_GetVehicleStartClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_GetVehicleTypeContainer = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetVisitType = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_GetVisitTypePolicy = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_HasDimension = + R"doc(Returns true if a dimension exists for a given dimension name.)doc"; + +static const char* __doc_operations_research_RoutingModel_HasGlobalCumulOptimizer = + R"doc(Returns whether the given dimension has global/local cumul optimizers.)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasHardTypeIncompatibilities = + R"doc(Returns true iff any hard (resp. temporal) type incompatibilities have +been added to the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasLocalCumulOptimizer = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_HasMandatoryDisjunctions = + R"doc(Returns true if the model contains mandatory disjunctions (ones with +kNoPenalty as penalty).)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasMaxCardinalityConstrainedDisjunctions = + R"doc(Returns true if the model contains at least one disjunction which is +constrained by its max_cardinality.)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasSameVehicleTypeRequirements = + R"doc(Returns true iff any same-route (resp. temporal) type requirements +have been added to the model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasTemporalTypeIncompatibilities = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_HasTemporalTypeRequirements = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_HasTypeRegulations = + R"doc(Returns true iff the model has any incompatibilities or requirements +set on node types.)doc"; + +static const char* + __doc_operations_research_RoutingModel_HasVehicleWithCostClassIndex = + R"doc(Returns true iff the model contains a vehicle with the given +cost_class_index.)doc"; + +static const char* + __doc_operations_research_RoutingModel_IgnoreDisjunctionsAlreadyForcedToZero = + R"doc(SPECIAL: Makes the solver ignore all the disjunctions whose active +variables are all trivially zero (i.e. Max() == 0), by setting their +max_cardinality to 0. This can be useful when using the +BaseBinaryDisjunctionNeighborhood operators, in the context of arc- +based routing.)doc"; + +static const char* + __doc_operations_research_RoutingModel_InitSameVehicleGroups = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_Initialize = + R"doc(Internal methods.)doc"; + +static const char* + __doc_operations_research_RoutingModel_InitializeDimensionInternal = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_IsDelivery = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_IsEnd = + R"doc(Returns true if 'index' represents the last node of a route.)doc"; + +static const char* __doc_operations_research_RoutingModel_IsMatchingModel = + R"doc(Returns true if a vehicle/node matching problem is detected.)doc"; + +static const char* __doc_operations_research_RoutingModel_IsPickup = + R"doc(Returns whether the node is a pickup (resp. delivery).)doc"; + +static const char* __doc_operations_research_RoutingModel_IsStart = + R"doc(Returns true if 'index' represents the first node of a route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_IsVehicleAllowedForIndex = + R"doc(Returns true if a vehicle is allowed to visit a given node.)doc"; + +static const char* __doc_operations_research_RoutingModel_IsVehicleUsed = + R"doc(Returns true if the route of 'vehicle' is non empty in 'assignment'.)doc"; + +static const char* + __doc_operations_research_RoutingModel_IsVehicleUsedWhenEmpty = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_LogSolution = + R"doc(Log a solution.)doc"; + +static const char* + __doc_operations_research_RoutingModel_MakeGreedyDescentLSOperator = + R"doc(Perhaps move it to constraint_solver.h. MakeGreedyDescentLSOperator +creates a local search operator that tries to improve the initial +assignment by moving a logarithmically decreasing step away in each +possible dimension.)doc"; + +static const char* + __doc_operations_research_RoutingModel_MakeGuidedSlackFinalizer = + R"doc(MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a +dimension using a callback to choose which values to start with. The +finalizer works only when all next variables in the model have been +fixed. It has the following two characteristics: 1. It follows the +routes defined by the nexts variables when choosing a variable to make +a decision on. 2. When it comes to choose a value for the slack of +node i, the decision builder first calls the callback with argument i, +and supposingly the returned value is x it creates decisions slack[i] += x, slack[i] = x + 1, slack[i] = x - 1, slack[i] = x + 2, etc.)doc"; + +static const char* + __doc_operations_research_RoutingModel_MakeSelfDependentDimensionFinalizer = + R"doc(__SWIG__ MakeSelfDependentDimensionFinalizer is a finalizer for the +slacks of a self-dependent dimension. It makes an extensive use of the +caches of the state dependent transits. In detail, +MakeSelfDependentDimensionFinalizer returns a composition of a local +search decision builder with a greedy descent operator for the cumul +of the start of each route and a guided slack finalizer. Provided +there are no time windows and the maximum slacks are large enough, +once the cumul of the start of route is fixed, the guided finalizer +can find optimal values of the slacks for the rest of the route in +time proportional to the length of the route. Therefore the composed +finalizer generally works in time O(log(t)*n*m), where t is the latest +possible departute time, n is the number of nodes in the network and m +is the number of vehicles.)doc"; + +static const char* + __doc_operations_research_RoutingModel_MakeStateDependentTransit = + R"doc(Creates a cached StateDependentTransit from an std::function.)doc"; + +static const char* __doc_operations_research_RoutingModel_MutablePreAssignment = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_Next = + R"doc(Assignment inspection Returns the variable index of the node directly +after the node corresponding to 'index' in 'assignment'.)doc"; + +static const char* __doc_operations_research_RoutingModel_NextVar = + R"doc(!defined(SWIGPYTHON) Returns the next variable of the node +corresponding to index. Note that NextVar(index) == index is +equivalent to ActiveVar(index) == 0.)doc"; + +static const char* __doc_operations_research_RoutingModel_Nexts = + R"doc(Returns all next variables of the model, such that Nexts(i) is the +next variable of the node corresponding to i.)doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass_ComputeNeighbors = + R"doc(Computes num_neighbors neighbors of all nodes for every cost class in +routing_model.)doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass_GetNeighborsOfNodeForCostClass = + R"doc(Returns the neighbors of the given node for the given cost_class.)doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass_NodeNeighborsByCostClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass_all_nodes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsByCostClass_node_index_to_neighbors_by_cost_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsParameters_add_vehicle_starts_to_neighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsParameters_num_neighbors = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_NodeNeighborsParameters_operator_eq = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_OptimizeCumulsOfDimensionFromAssignmentWithCumulDependentTransits = + R"doc(This method optimizes the cumuls of the 'original_assignment' for the +given 'dimension'. The goal of the optimizer is to find an optimal +scheduling w.r.t the original costs in the model, while also +minimizing the "error" in the transit value considered between +consecutive nodes compared to the given piecewise linear formulations.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PackCumulsOfOptimizerDimensionsFromAssignment = + R"doc(For every dimension in the model with an optimizer in +local/global_dimension_optimizers_, this method tries to pack the +cumul values of the dimension, such that: - The cumul costs (span +costs, soft lower and upper bound costs, etc) are minimized. - The +cumuls of the ends of the routes are minimized for this given minimal +cumul cost. - Given these minimal end cumuls, the route start cumuls +are maximized. Returns the assignment resulting from allocating these +packed cumuls with the solver, and nullptr if these cumuls could not +be set by the solver.)doc"; + +static const char* __doc_operations_research_RoutingModel_PickupAndDeliveryPolicy = + R"doc(Types of precedence policy applied to pickup and delivery pairs.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PickupAndDeliveryPolicy_PICKUP_AND_DELIVERY_FIFO = + R"doc(Deliveries must be performed in the same order as pickups.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PickupAndDeliveryPolicy_PICKUP_AND_DELIVERY_LIFO = + R"doc(Deliveries must be performed in reverse order of pickups.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PickupAndDeliveryPolicy_PICKUP_AND_DELIVERY_NO_ORDER = + R"doc(Any precedence is accepted.)doc"; + +static const char* __doc_operations_research_RoutingModel_PickupDeliveryPosition = + R"doc(The position of a node in the set of pickup and delivery pairs.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PickupDeliveryPosition_alternative_index = + R"doc(The index of the node in the vector of pickup (resp. delivery) +alternatives of the pair.)doc"; + +static const char* + __doc_operations_research_RoutingModel_PickupDeliveryPosition_pd_pair_index = + R"doc(The index of the pickup and delivery pair within which the node +appears.)doc"; + +static const char* __doc_operations_research_RoutingModel_PreAssignment = + R"doc(Returns an assignment used to fix some of the variables of the +problem. In practice, this assignment locks partial routes of the +problem. This can be used in the context of locking the parts of the +routes which have already been driven in online routing problems.)doc"; + +static const char* __doc_operations_research_RoutingModel_QuietCloseModel = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_QuietCloseModelWithParameters = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ReadAssignment = + R"doc(Reads an assignment from a file and returns the current solution. +Returns nullptr if the file cannot be opened or if the assignment is +not valid.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ReadAssignmentFromRoutes = + R"doc(Restores the routes as the current solution. Returns nullptr if the +solution cannot be restored (routes do not contain a valid solution). +Note that calling this method will run the solver to assign values to +the dimension variables; this may take considerable amount of time, +especially when using dimensions with slack.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RegisterStateDependentTransitCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RegisterTransitCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RegisterTransitMatrix = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RegisterUnaryTransitCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RegisterUnaryTransitVector = + R"doc(Registers 'callback' and returns its index. The sign parameter allows +to notify the solver that the callback only return values of the given +sign. This can help the solver, but passing an incorrect sign may +crash in non-opt compilation mode, and yield incorrect results in opt.)doc"; + +static const char* __doc_operations_research_RoutingModel_RemainingTime = + R"doc(Returns the time left in the search limit.)doc"; + +static const char* __doc_operations_research_RoutingModel_ReplaceUnusedVehicle = + R"doc(Replaces the route of unused_vehicle with the route of active_vehicle +in compact_assignment. Expects that unused_vehicle is a vehicle with +an empty route and that the route of active_vehicle is non-empty. Also +expects that 'assignment' contains the original assignment, from which +compact_assignment was created. Returns true if the vehicles were +successfully swapped; otherwise, returns false.)doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceGroup = + R"doc(A ResourceGroup defines a set of available Resources with attributes +on one or multiple dimensions. For every ResourceGroup in the model, +each (used) vehicle in the solution which requires a resource (see +NotifyVehicleRequiresResource()) from this group must be assigned to +exactly 1 resource, and each resource can in turn be assigned to at +most 1 vehicle requiring it. This vehicle-to-resource assignment will +apply the corresponding Attributes to the dimensions affected by the +resource group. NOTE: As of 2021/07, each ResourceGroup can only +affect a single RoutingDimension at a time, i.e. all Resources in a +group must apply attributes to the same single dimension.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_AddResource = + R"doc(Adds a Resource with the given attributes for the corresponding +dimension. Returns the index of the added resource in resources_.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes = + R"doc(Attributes for a dimension.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_Attributes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_Attributes_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_end_domain = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_end_domain_2 = + R"doc(end_domain_.Min() <= cumul[End(v)] <= end_domain_.Max())doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_start_domain = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Attributes_start_domain_2 = + R"doc(The following domains constrain the dimension start/end cumul of the +vehicle assigned to this resource: start_domain_.Min() <= +cumul[Start(v)] <= start_domain_.Max())doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_ClearAllowedResourcesForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_ComputeResourceClasses = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetAffectedDimensionIndices = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetDimensionAttributesForClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResource = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResourceClassIndex = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResourceClassesCount = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResourceIndicesInClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResourceIndicesPerClass = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResources = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetResourcesMarkedAllowedForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_GetVehiclesRequiringAResource = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceGroup_Index = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_IsResourceAllowedForVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_NotifyVehicleRequiresAResource = + R"doc(Notifies that the given vehicle index requires a resource from this +group if the vehicle is used (i.e. if its route is non-empty or +vehicle_used_when_empty_[vehicle] is true).)doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource = + R"doc(A Resource sets attributes (costs/constraints) for a set of +dimensions.)doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_ResourceGroup = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_GetDefaultAttributes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_GetDimensionAttributes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_Resource = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_SetDimensionAttributes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_dimension_attributes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_Resource_model = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_SetAllowedResourcesForVehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceGroup_Size = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_VehicleRequiresAResource = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_affected_dimension_indices = + R"doc(All indices of dimensions affected by this resource group.)doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceGroup_index = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceGroup_model = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_resource_class_indices = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_resource_indices_per_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_resources = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_vehicle_requires_resource = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_ResourceGroup_vehicles_requiring_resource = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceVar = + R"doc(Returns the resource variable for the given vehicle index in the given +resource group. If a vehicle doesn't require a resource from the +corresponding resource group, then ResourceVar(v, r_g) == -1.)doc"; + +static const char* __doc_operations_research_RoutingModel_ResourceVars = + R"doc(Returns vehicle resource variables for a given resource group, such +that ResourceVars(r_g)[v] is the resource variable for vehicle 'v' in +resource group 'r_g'.)doc"; + +static const char* __doc_operations_research_RoutingModel_RestoreAssignment = + R"doc(Restores an assignment as a solution in the routing model and returns +the new solution. Returns nullptr if the assignment is not valid.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteCanBeUsedByVehicle = + R"doc(Checks that all nodes on the route starting at start_index (using the +solution stored in assignment) can be visited by the given vehicle.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo = + R"doc(Contains the information needed by the solver to optimize a +dimension's cumuls with travel-start dependent transit values.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_DebugString = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo = + R"doc(Contains the information for a single transition on the route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_DebugString = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_PiecewiseLinearFormulation = + R"doc(The following struct defines a piecewise linear formulation, with +int64_t values for the "anchor" x and y values, and potential double +values for the slope of each linear function.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_PiecewiseLinearFormulation_DebugString = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_PiecewiseLinearFormulation_x_anchors = + R"doc(The set of *increasing* anchor cumul values for the interpolation.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_PiecewiseLinearFormulation_y_anchors = + R"doc(The y values used for the interpolation: For any x anchor value, let i +be an index such that x_anchors[i] ≤ x < x_anchors[i+1], then the y +value for x is y_anchors[i] * (1-λ) + y_anchors[i+1] * λ, with λ = (x +- x_anchors[i]) / (x_anchors[i+1] - x_anchors[i]).)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_compressed_travel_value_lower_bound = + R"doc(The hard lower bound of the compressed travel value that will be +enforced by the scheduling module.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_post_travel_transit_value = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_pre_travel_transit_value = + R"doc(The parts of the transit which occur pre/post travel between the +nodes. The total transit between the two nodes i and j is = +pre_travel_transit_value + travel(i, j) + post_travel_transit_value.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_travel_compression_cost = + R"doc(travel_compression_cost models the cost of the difference between the +(real) travel value Tᵣ given by travel_start_dependent_travel and the +compressed travel value considered in the scheduling.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_travel_start_dependent_travel = + R"doc(Models the (real) travel value Tᵣ, for this transition based on the +departure value of the travel.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_TransitionInfo_travel_value_upper_bound = + R"doc(The hard upper bound of the (real) travel value Tᵣ (see above). This +value should be chosen so as to prevent the overall cost of the model +(dimension costs + travel_compression_cost) to overflow.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_transition_info = + R"doc(For each node #i on the route, transition_info[i] contains the +relevant information for the travel between nodes #i and #(i + 1) on +the route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RouteDimensionTravelInfo_travel_cost_coefficient = + R"doc(The cost per unit of travel for this vehicle.)doc"; + +static const char* __doc_operations_research_RoutingModel_RoutesToAssignment = + R"doc(Fills an assignment from a specification of the routes of the +vehicles. The routes are specified as lists of variable indices that +appear on the routes of the vehicles. The indices of the outer vector +in 'routes' correspond to vehicles IDs, the inner vector contains the +variable indices on the routes for the given vehicle. The inner +vectors must not contain the start and end indices, as these are +determined by the routing model. Sets the value of NextVars in the +assignment, adding the variables to the assignment if necessary. The +method does not touch other variables in the assignment. The method +can only be called after the model is closed. With +ignore_inactive_indices set to false, this method will fail (return +nullptr) in case some of the route contain indices that are +deactivated in the model; when set to true, these indices will be +skipped. Returns true if routes were successfully loaded. However, +such assignment still might not be a valid solution to the routing +problem due to more complex constraints; it is advisible to call +solver()->CheckSolution() afterwards.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator = + R"doc(Local search move operator usable in routing.)doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_CROSS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_CROSS_EXCHANGE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_EXCHANGE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_EXCHANGE_PAIR = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_EXCHANGE_RELOCATE_PAIR = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_EXCHANGE_SUBTRIP = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_EXTENDED_SWAP_ACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_FULL_PATH_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_GLOBAL_CHEAPEST_INSERTION_CLOSE_NODES_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_GLOBAL_CHEAPEST_INSERTION_EXPENSIVE_CHAIN_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_GLOBAL_CHEAPEST_INSERTION_PATH_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_INACTIVE_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LIGHT_RELOCATE_PAIR = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LIN_KERNIGHAN = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LOCAL_CHEAPEST_INSERTION_CLOSE_NODES_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LOCAL_CHEAPEST_INSERTION_EXPENSIVE_CHAIN_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LOCAL_CHEAPEST_INSERTION_PATH_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_LOCAL_SEARCH_OPERATOR_COUNTER = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_MAKE_ACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_MAKE_ACTIVE_AND_RELOCATE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_MAKE_CHAIN_INACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_MAKE_INACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_NODE_PAIR_SWAP = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_OR_OPT = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_PATH_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_AND_MAKE_ACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_EXPENSIVE_CHAIN = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_NEIGHBORS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_PAIR = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_PATH_GLOBAL_CHEAPEST_INSERTION_INSERT_UNPERFORMED = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_RELOCATE_SUBTRIP = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_SHORTEST_PATH_SWAP_ACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_SWAP_ACTIVE = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_TSP_LNS = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_TSP_OPT = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_RoutingLocalSearchOperator_TWO_OPT = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_RoutingModel = + R"doc(Constructor taking an index manager. The version which does not take +RoutingModelParameters is equivalent to passing +DefaultRoutingModelParameters().)doc"; + +static const char* __doc_operations_research_RoutingModel_RoutingModel_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_RoutingModel_3 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SafeGetCostClassInt64OfVehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SecondaryOptimizer = + R"doc(Class used to solve a secondary model within a first solution +strategy.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_SecondaryOptimizer = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_Solve = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_call_count = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_model = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_search_parameters = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_solve_period = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_state = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SecondaryOptimizer_var_to_index = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetAllowedVehiclesForIndex = + R"doc(Sets the vehicles which can visit a given node. If the node is in a +disjunction, this will not prevent it from being unperformed. +Specifying an empty vector of vehicles has no effect (all vehicles +will be allowed to visit the node).)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetAmortizedCostFactorsOfAllVehicles = + R"doc(The following methods set the linear and quadratic cost factors of +vehicles (must be positive values). The default value of these +parameters is zero for all vehicles. + +When set, the cost_ of the model will contain terms aiming at reducing +the number of vehicles used in the model, by adding the following to +the objective for every vehicle v: INDICATOR(v used in the model) * +[linear_cost_factor_of_vehicle_[v] - +quadratic_cost_factor_of_vehicle_[v]*(square of length of route v)] +i.e. for every used vehicle, we add the linear factor as fixed cost, +and subtract the square of the route length multiplied by the +quadratic factor. This second term aims at making the routes as dense +as possible. + +Sets the linear and quadratic cost factor of all vehicles.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetAmortizedCostFactorsOfVehicle = + R"doc(Sets the linear and quadratic cost factor of the given vehicle.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetArcCostEvaluatorOfAllVehicles = + R"doc(Sets the cost function of the model such that the cost of a segment of +a route between node 'from' and 'to' is evaluator(from, to), whatever +the route or vehicle performing the route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetArcCostEvaluatorOfVehicle = + R"doc(Sets the cost function for a given vehicle route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetAssignmentFromOtherModelAssignment = + R"doc(Given a "source_model" and its "source_assignment", resets +"target_assignment" with the IntVar variables (nexts_, and +vehicle_vars_ if costs aren't homogeneous across vehicles) of "this" +model, with the values set according to those in "other_assignment". +The objective_element of target_assignment is set to this->cost_.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetFirstSolutionEvaluator = + R"doc(Takes ownership of evaluator.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetFixedCostOfAllVehicles = + R"doc(Sets the fixed cost of all vehicle routes. It is equivalent to calling +SetFixedCostOfVehicle on all vehicle routes.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetFixedCostOfVehicle = + R"doc(Sets the fixed cost of one vehicle route.)doc"; + +static const char* __doc_operations_research_RoutingModel_SetIndexNeighborFinder = + R"doc(Sets the sweep arranger to be used by routing heuristics; ownership of +the arranger is taken.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetMaximumNumberOfActiveVehicles = + R"doc(Constrains the maximum number of active vehicles, aka the number of +vehicles which do not have an empty route. For instance, this can be +used to limit the number of routes in the case where there are fewer +drivers than vehicles and that the fleet of vehicle is heterogeneous.)doc"; + +static const char* __doc_operations_research_RoutingModel_SetNextVarRange = + R"doc(e.g. intersection with a set of values, removing a set of values, +membership test... on a per-need basis. Restricts the range of the +next variable associated to index.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetOptimizedWithCumulDependentTransits = + R"doc(Notifies that the given dimension's cumuls can be optimized with +cumul-dependent transits.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetPathEnergyCostOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetPathEnergyCostsOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetPickupAndDeliveryPolicyOfAllVehicles = + R"doc(Sets the Pickup and delivery policy of all vehicles. It is equivalent +to calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SetPickupAndDeliveryPolicyOfVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetPrimaryConstrainedDimension = + R"doc(Set the given dimension as "primary constrained". As of August 2013, +this is only used by ArcIsMoreConstrainedThanArc(). "dimension" must +be the name of an existing dimension, or be empty, in which case there +will not be a primary dimension after this call.)doc"; + +static const char* __doc_operations_research_RoutingModel_SetSameVehicleGroup = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetSecondaryModel = + R"doc(Sets a secondary solver (routing model + parameters) which can be used +to run sub-solves while building a first solution.)doc"; + +static const char* __doc_operations_research_RoutingModel_SetSweepArranger = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetTabuVarsCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetVehicleUsedWhenEmpty = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetVisitType = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetupAssignmentCollector = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetupDecisionBuilders = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_SetupImprovementLimit = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetupMetaheuristics = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetupSearch = + R"doc(Sets up search objects, such as decision builders and monitors.)doc"; + +static const char* __doc_operations_research_RoutingModel_SetupSearchMonitors = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_SetupTrace = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_Size = + R"doc(Returns the number of next variables in the model.)doc"; + +static const char* __doc_operations_research_RoutingModel_Solve = + R"doc(Solves the current routing model; closes the current model. This is +equivalent to calling +SolveWithParameters(DefaultRoutingSearchParameters()) or +SolveFromAssignmentWithParameters(assignment, +DefaultRoutingSearchParameters()).)doc"; + +static const char* + __doc_operations_research_RoutingModel_SolveFromAssignmentWithParameters = + R"doc(Same as above, except that if assignment is not null, it will be used +as the initial solution.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SolveFromAssignmentsWithParameters = + R"doc(Same as above but will try all assignments in order as first solutions +until one succeeds.)doc"; + +static const char* __doc_operations_research_RoutingModel_SolveMatchingModel = + R"doc(Solve matching problem with min-cost flow and store result in +assignment.)doc"; + +static const char* + __doc_operations_research_RoutingModel_SolveWithIteratedLocalSearch = + R"doc(Solves the current routing model by using an Iterated Local Search +approach.)doc"; + +static const char* __doc_operations_research_RoutingModel_SolveWithParameters = + R"doc(Solves the current routing model with the given parameters. If +'solutions' is specified, it will contain the k best solutions found +during the search (from worst to best, including the one returned by +this method), where k corresponds to the +'number_of_solutions_to_collect' in 'search_parameters'. Note that the +Assignment returned by the method and the ones in solutions are owned +by the underlying solver and should not be deleted.)doc"; + +static const char* __doc_operations_research_RoutingModel_Start = + R"doc(Model inspection. Returns the variable index of the starting node of a +vehicle route.)doc"; + +static const char* + __doc_operations_research_RoutingModel_StateDependentTransit = + R"doc(What follows is relevant for models with time/state dependent +transits. Such transits, say from node A to node B, are functions f: +int64_t->int64_t of the cumuls of a dimension. The user is free to +implement the abstract RangeIntToIntFunction interface, but it is +expected that the implementation of each method is quite fast. For +performance-related reasons, StateDependentTransit keeps an additional +pointer to a RangeMinMaxIndexFunction, with similar functionality to +RangeIntToIntFunction, for g(x) = f(x)+x, where f is the transit from +A to B. In most situations the best solutions are problem-specific, +but in case of doubt the user may use the MakeStateDependentTransit +function from the routing library, which works out-of-the-box, with +very good running time, but memory inefficient in some situations.)doc"; + +static const char* + __doc_operations_research_RoutingModel_StateDependentTransitCallback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_StateDependentTransit_transit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_StateDependentTransit_transit_plus_identity = + R"doc(f(x))doc"; + +static const char* + __doc_operations_research_RoutingModel_StoreDimensionCumulOptimizers = + R"doc(Creates global and local cumul optimizers for the dimensions needing +them, and stores them in the corresponding +[local|global]_dimension_optimizers_ vectors. This function also +computes and stores the "offsets" for these dimensions, used in the +local/global optimizers to simplify LP computations. + +Note on the offsets computation: The global/local cumul offsets are +used by the respective optimizers to have smaller numbers, and +therefore better numerical behavior in the LP. These offsets are used +as a minimum value for the cumuls over the route (or globally), i.e. a +value we consider all cumuls to be greater or equal to. When transits +are all positive, the cumuls of every node on a route is necessarily +greater than the cumul of its start. Therefore, the local offset for a +vehicle can be set to the minimum of its start node's cumul, and for +the global optimizers, to the min start cumul over all vehicles. +However, to be able to distinguish between infeasible nodes (i.e. +nodes for which the cumul upper bound is less than the min cumul of +the vehicle's start), we set the offset to "min_start_cumul" - 1. By +doing so, all infeasible nodes described above will have bounds of [0, +0]. Example: Start cumul bounds: [11, 20] --> offset = 11 - 1 = 10. +Two nodes with cumul bounds. Node1: [5, 10], Node2: [7, 20] After +applying the offset to the above windows, they become: Vehicle: [1, +10]. Node1: [0, 0] (infeasible). Node2: [0, 10]. + +On the other hand, when transits on a route can be negative, no +assumption can be made on the cumuls of nodes wrt the start cumuls, +and the offset is therefore set to 0.)doc"; + +static const char* __doc_operations_research_RoutingModel_TimeBuffer = + R"doc(Returns the time buffer to safely return a solution.)doc"; + +static const char* + __doc_operations_research_RoutingModel_TopologicallySortVisitTypes = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_TransitCallback = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_TransitEvaluatorSign = + R"doc(Represents the sign of values returned by a transit evaluator.)doc"; + +static const char* + __doc_operations_research_RoutingModel_TransitEvaluatorSign_kTransitEvaluatorSignNegativeOrZero = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_TransitEvaluatorSign_kTransitEvaluatorSignPositiveOrZero = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_TransitEvaluatorSign_kTransitEvaluatorSignUnknown = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_UnaryTransitCallbackOrNull = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_UnperformedPenalty = + R"doc(Get the "unperformed" penalty of a node. This is only well defined if +the node is only part of a single Disjunction, and that disjunction +has a penalty. For forced active nodes returns max int64_t. In all other +cases, this returns 0.)doc"; + +static const char* + __doc_operations_research_RoutingModel_UnperformedPenaltyOrValue = + R"doc(Same as above except that it returns default_value instead of 0 when +penalty is not well defined (default value is passed as first argument +to simplify the usage of the method in a callback).)doc"; + +static const char* + __doc_operations_research_RoutingModel_UpdateSearchFromParametersIfNeeded = + R"doc(Updates search objects if parameters have changed.)doc"; + +static const char* __doc_operations_research_RoutingModel_UpdateTimeLimit = + R"doc(Updates the time limit of the search limit.)doc"; + +static const char* __doc_operations_research_RoutingModel_UsesLightPropagation = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ValuedNodes = + R"doc(Structure storing a value for a set of variable indices. Is used to +store data for index disjunctions (variable indices, max_cardinality +and penalty when unperformed).)doc"; + +static const char* __doc_operations_research_RoutingModel_ValuedNodes_indices = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ValuedNodes_value = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_VariableValuePair = + R"doc(Struct used to store a variable value.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VariableValuePair_value = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VariableValuePair_var_index = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_VehicleIndex = + R"doc(Returns the vehicle of the given start/end index, and -1 if the given +index is not a vehicle start/end.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleRouteConsideredVar = + R"doc(Returns the variable specifying whether or not the given vehicle route +is considered for costs and constraints. It will be equal to 1 iff the +route of the vehicle is not empty OR vehicle_used_when_empty_[vehicle] +is true.)doc"; + +static const char* __doc_operations_research_RoutingModel_VehicleTypeContainer = + R"doc(Struct used to sort and store vehicles by their type. Two vehicles +have the same "vehicle type" iff they have the same cost class and +start/end nodes.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_NumTypes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_Type = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_VehicleClassEntry = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_VehicleClassEntry_fixed_cost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_VehicleClassEntry_operator_lt = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_VehicleClassEntry_vehicle_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_sorted_vehicle_classes_per_type = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_type_index_of_vehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_VehicleTypeContainer_vehicles_per_vehicle_class = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_VehicleVar = + R"doc(Returns the vehicle variable of the node corresponding to index. Note +that VehicleVar(index) == -1 is equivalent to ActiveVar(index) == 0.)doc"; + +static const char* __doc_operations_research_RoutingModel_VehicleVars = + R"doc(Returns all vehicle variables of the model, such that VehicleVars(i) +is the vehicle variable of the node corresponding to i.)doc"; + +static const char* __doc_operations_research_RoutingModel_VisitTypePolicy = + R"doc(Set the node visit types and incompatibilities/requirements between +the types (see below). + +NOTE: Before adding any incompatibilities and/or requirements on +types: 1) All corresponding node types must have been set. 2) +CloseVisitTypes() must be called so all containers are resized +accordingly. + +The following enum is used to describe how a node with a given type +'T' impacts the number of types 'T' on the route when visited, and +thus determines how temporal incompatibilities and requirements take +effect.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VisitTypePolicy_ADDED_TYPE_REMOVED_FROM_VEHICLE = + R"doc(When visited, one instance of type 'T' previously added to the route +(TYPE_ADDED_TO_VEHICLE), if any, is removed from the vehicle. If the +type was not previously added to the route or all added instances have +already been removed, this visit has no effect on the types.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VisitTypePolicy_TYPE_ADDED_TO_VEHICLE = + R"doc(When visited, the number of types 'T' on the vehicle increases by one.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VisitTypePolicy_TYPE_ON_VEHICLE_UP_TO_VISIT = + R"doc(With the following policy, the visit enforces that type 'T' is +considered on the route from its start until this node is visited.)doc"; + +static const char* + __doc_operations_research_RoutingModel_VisitTypePolicy_TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED = + R"doc(The visit doesn't have an impact on the number of types 'T' on the +route, as it's (virtually) added and removed directly. This policy can +be used for visits which are part of an incompatibility or requirement +set without affecting the type count on the route.)doc"; + +static const char* __doc_operations_research_RoutingModel_WriteAssignment = + R"doc(Writes the current solution to a file containing an AssignmentProto. +Returns false if the file cannot be opened or if there is no current +solution.)doc"; + +static const char* __doc_operations_research_RoutingModel_active = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_assignment = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_at_solution_monitors = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_automatic_first_solution_strategy = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_bin_capacities = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_cache_callbacks = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_closed = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_collect_assignments = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_collect_one_assignment = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_collect_secondary_ls_assignments = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_cost = + R"doc(Costs)doc"; + +static const char* __doc_operations_research_RoutingModel_cost_cache = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_cost_class_index_of_vehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_cost_classes = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_costs_are_homogeneous_across_vehicles = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_cumulative_limit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_dimension_cumuls_optimized_with_cumul_dependent_transits = + R"doc(Whether or not a given dimension's cumuls could be optimized with +cumul-dependent transits. This is false by default for all dimensions, +and can be set to true specifically for a dimension through +SetOptimizedWithCumulDependentTransits().)doc"; + +static const char* + __doc_operations_research_RoutingModel_dimension_local_optimizer_for_cumul_dependent_transits = + R"doc(When dimension_cumuls_optimized_with_cumul_dependent_transits_[d] = +true for a dimension which doesn't require an LP/MP optimizer based on +the constraints, we create and store a local MP optimizer required for +optimizing with cumul-dependent transits.)doc"; + +static const char* + __doc_operations_research_RoutingModel_dimension_name_to_index = + R"doc(Dimensions)doc"; + +static const char* + __doc_operations_research_RoutingModel_dimension_resource_group_indices = + R"doc(Stores the set of resource groups related to each dimension.)doc"; + +static const char* __doc_operations_research_RoutingModel_dimensions = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_disjunctions = + R"doc(Disjunctions)doc"; + +static const char* + __doc_operations_research_RoutingModel_enable_deep_serialization = + R"doc(Returns the value of the internal enable_deep_serialization_ +parameter.)doc"; + +static const char* + __doc_operations_research_RoutingModel_enable_deep_serialization_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_extra_filters = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_extra_intervals = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_extra_operators = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_extra_vars = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_finalizer_variables = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_first_solution_decision_builders = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_first_solution_evaluator = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_first_solution_evaluator_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_first_solution_filtered_decision_builders = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_first_solution_lns_limit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_fixed_cost_of_vehicle = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_global_dimension_optimizers = + R"doc(TODO(user): Define a new Dimension[Global|Local]OptimizerIndex +type and use it to define ITIVectors and for the dimension to +optimizer index mappings below.)doc"; + +static const char* + __doc_operations_research_RoutingModel_global_optimizer_index = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_has_hard_type_incompatibilities = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_has_same_vehicle_type_requirements = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_has_temporal_type_incompatibilities = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_has_temporal_type_requirements = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_has_vehicle_with_zero_cost_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_implicit_pickup_delivery_pairs_without_alternatives = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_improve_db = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_index_neighbor_finder = + R"doc(Returns the index neighbor finder to be used by routing heuristics.)doc"; + +static const char* + __doc_operations_research_RoutingModel_index_neighbor_finder_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_index_to_delivery_positions = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_index_to_disjunctions = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_index_to_equivalence_class = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_index_to_pickup_positions = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_index_to_type_policy = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_index_to_visit_type = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_interrupt_cp = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_interrupt_cp_sat = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_is_bound_to_end = + R"doc(is_bound_to_end_[i] will be true iff the path starting at var #i is +fully bound and reaches the end of a route, i.e. either: - IsEnd(i) is +true - or nexts_[i] is bound and is_bound_to_end_[nexts_[i].Value()] +is true.)doc"; + +static const char* + __doc_operations_research_RoutingModel_is_bound_to_end_ct_added = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_limit = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_linear_cost_factor_of_vehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_lns_limit = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_local_dimension_optimizers = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_local_optimizer_index = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_local_optimum_reached = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_local_search_filter_managers = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_local_search_operators = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_ls_limit = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_manager = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_max_active_vehicles = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_metaheuristic = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_monitors = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_monitors_after_setup = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_monitors_before_setup = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_nexts = + R"doc(Decision variables: indexed by int64_t var index.)doc"; + +static const char* __doc_operations_research_RoutingModel_no_cycle_constraint = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_node_neighbors_by_cost_class_per_size = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_nodes = + R"doc(Sizes and indices Returns the number of nodes in the model.)doc"; + +static const char* __doc_operations_research_RoutingModel_nodes_2 = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_num_vehicle_classes = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_num_visit_types = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_objective_lower_bound = + R"doc(Returns the current lower bound found by internal solvers during the +search.)doc"; + +static const char* + __doc_operations_research_RoutingModel_objective_lower_bound_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_operator_assign = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_optimized_dimensions_assignment_collector = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_pair_indices_of_type = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_paths_metadata = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_pickup_delivery_disjunctions = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_pickup_delivery_pairs = + R"doc(Pickup and delivery)doc"; + +static const char* __doc_operations_research_RoutingModel_preassignment = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_primary_constrained_dimension = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_primary_ls_operator = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_quadratic_cost_factor_of_vehicle = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_resource_groups = + R"doc(Resource Groups. If resource_groups_ is not empty, then for each group +of resources, each (used) vehicle must be assigned to exactly 1 +resource, and each resource can in turn be assigned to at most 1 +vehicle.)doc"; + +static const char* __doc_operations_research_RoutingModel_resource_vars = + R"doc(Resource variables, indexed first by resource group index and then by +vehicle index. A resource variable can have a negative value of -1, +iff the corresponding vehicle doesn't require a resource from this +resource group, OR if the vehicle is unused (i.e. no visits on its +route and vehicle_used_when_empty_[v] is false).)doc"; + +static const char* __doc_operations_research_RoutingModel_restore_assignment = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_restore_tmp_assignment = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_same_vehicle_costs = + R"doc(Same vehicle costs)doc"; + +static const char* __doc_operations_research_RoutingModel_same_vehicle_group = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_same_vehicle_groups = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_search_log = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_search_parameters = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_secondary_ls_db = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_secondary_ls_monitors = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_secondary_ls_operator = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_secondary_model = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_secondary_optimizer = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_secondary_parameters = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_single_nodes_of_type = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_solve_db = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_solver = + R"doc(Returns the underlying constraint solver. Can be used to add extra +constraints and/or modify search algorithms.)doc"; + +static const char* __doc_operations_research_RoutingModel_solver_2 = + R"doc(Model)doc"; + +static const char* __doc_operations_research_RoutingModel_start_end_count = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_state_dependent_transit_evaluators = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_state_dependent_transit_evaluators_cache = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_status = + R"doc(Returns the current status of the routing model.)doc"; + +static const char* __doc_operations_research_RoutingModel_status_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_sweep_arranger = + R"doc(Returns the sweep arranger to be used by routing heuristics.)doc"; + +static const char* __doc_operations_research_RoutingModel_sweep_arranger_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_tabu_var_callback = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_time_buffer = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_tmp_assignment = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_topologically_sorted_visit_types = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_transit_evaluator_sign = R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_transit_evaluators = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_unary_transit_evaluators = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_vehicle_active = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_amortized_cost_factors_set = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_class_index_of_vehicle = + R"doc(Index by source index.)doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_pickup_delivery_policy = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_route_considered = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_start_class_callback = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_to_transit_cost = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_type_container = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingModel_vehicle_used_when_empty = + R"doc(vehicle_used_when_empty_[vehicle] determines if "vehicle" should be +taken into account for costs (arc costs, span costs, etc.) and +constraints (eg. resources) even when the route of the vehicle is +empty (i.e. goes straight from its start to its end). + +NOTE1: A vehicle's fixed cost is added iff the vehicle serves nodes on +its route, regardless of this variable's value. + +NOTE2: The default value for this boolean is 'false' for all vehicles, +i.e. by default empty routes will not contribute to the cost nor be +considered for constraints.)doc"; + +static const char* __doc_operations_research_RoutingModel_vehicle_vars = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingModel_vehicles = + R"doc(Returns the number of vehicle routes in the model.)doc"; + +static const char* __doc_operations_research_RoutingModel_vehicles_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts = R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_SimpleBoundCosts = + R"doc()doc"; + +static const char* + __doc_operations_research_SimpleBoundCosts_SimpleBoundCosts_2 = R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_Size = + R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_bound_cost = + R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_bound_cost_2 = + R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_bound_costs = + R"doc()doc"; + +static const char* __doc_operations_research_SimpleBoundCosts_operator_assign = + R"doc()doc"; + +static const char* __doc_operations_research_SolveModelWithSat = + R"doc(Attempts to solve the model using the cp-sat solver. As of 5/2019, +will solve the TSP corresponding to the model if it has a single +vehicle. Therefore the resulting solution might not actually be +feasible. Will return false if a solution could not be found.)doc"; + +static const char* __doc_operations_research_SweepArranger = R"doc()doc"; + +static const char* __doc_operations_research_TravelBounds = R"doc()doc"; + +static const char* __doc_operations_research_TravelBounds_max_travels = + R"doc()doc"; + +static const char* __doc_operations_research_TravelBounds_min_travels = + R"doc()doc"; + +static const char* __doc_operations_research_TravelBounds_post_travels = + R"doc()doc"; + +static const char* __doc_operations_research_TravelBounds_pre_travels = + R"doc()doc"; + +static const char* __doc_operations_research_TypeIncompatibilityChecker = + R"doc(Checker for type incompatibilities.)doc"; + +static const char* + __doc_operations_research_TypeIncompatibilityChecker_CheckTypeRegulations = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeIncompatibilityChecker_HasRegulationsToCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeIncompatibilityChecker_TypeIncompatibilityChecker = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeIncompatibilityChecker_check_hard_incompatibilities = + R"doc(NOTE(user): As temporal incompatibilities are always verified with +this checker, we only store 1 boolean indicating whether or not hard +incompatibilities are also verified.)doc"; + +static const char* __doc_operations_research_TypeRegulationsChecker = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_CheckTypeRegulations = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_CheckVehicle = R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_FinalizeCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_HasRegulationsToCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_InitializeCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_OnInitializeCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypeCurrentlyOnRoute = + R"doc(Returns true iff there's at least one instance of the given type on +the route when scanning the route at the given position 'pos'. This is +the case iff we have at least one added but non-removed instance of +the type, or if +occurrences_of_type_[type].last_type_on_vehicle_up_to_visit is greater +than 'pos'.)doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypeOccursOnRoute = + R"doc(Returns true iff any occurrence of the given type was seen on the +route, i.e. iff the added count for this type is positive, or if a +node of this type and policy TYPE_ON_VEHICLE_UP_TO_VISIT is visited on +the route (see TypePolicyOccurrence.last_type_on_vehicle_up_to_visit).)doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypePolicyOccurrence = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypePolicyOccurrence_num_type_added_to_vehicle = + R"doc(Number of TYPE_ADDED_TO_VEHICLE and +TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED node type policies seen on the +route.)doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypePolicyOccurrence_num_type_removed_from_vehicle = + R"doc(Number of ADDED_TYPE_REMOVED_FROM_VEHICLE (effectively removing a type +from the route) and TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED node type +policies seen on the route. This number is always <= +num_type_added_to_vehicle, as a type is only actually removed if it +was on the route before.)doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypePolicyOccurrence_position_of_last_type_on_vehicle_up_to_visit = + R"doc(Position of the last node of policy TYPE_ON_VEHICLE_UP_TO_VISIT +visited on the route. If positive, the type is considered on the +vehicle from the start of the route until this position.)doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_TypeRegulationsChecker = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_current_route_visits = + R"doc()doc"; + +static const char* __doc_operations_research_TypeRegulationsChecker_model = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsChecker_occurrences_of_type = + R"doc()doc"; + +static const char* __doc_operations_research_TypeRegulationsConstraint = + R"doc(The following constraint ensures that incompatibilities and +requirements between types are respected. + +It verifies both "hard" and "temporal" incompatibilities. Two nodes +with hard incompatible types cannot be served by the same vehicle at +all, while with a temporal incompatibility they can't be on the same +route at the same time. The VisitTypePolicy of a node determines how +visiting it impacts the type count on the route. + +For example, for - three temporally incompatible types T1 T2 and T3 - +2 pairs of nodes a1/r1 and a2/r2 of type T1 and T2 respectively, with +- a1 and a2 of VisitTypePolicy TYPE_ADDED_TO_VEHICLE - r1 and r2 of +policy ADDED_TYPE_REMOVED_FROM_VEHICLE - 3 nodes A, UV and AR of type +T3, respectively with type policies TYPE_ADDED_TO_VEHICLE, +TYPE_ON_VEHICLE_UP_TO_VISIT and TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED +the configurations UV --> a1 --> r1 --> a2 --> r2, a1 --> r1 --> a2 +--> r2 --> A and a1 --> r1 --> AR --> a2 --> r2 are acceptable, +whereas the configurations a1 --> a2 --> r1 --> ..., or A --> a1 --> +r1 --> ..., or a1 --> r1 --> UV --> ... are not feasible. + +It also verifies same-vehicle and temporal type requirements. A node +of type T_d with a same-vehicle requirement for type T_r needs to be +served by the same vehicle as a node of type T_r. Temporal +requirements, on the other hand, can take effect either when the +dependent type is being added to the route or when it's removed from +it, which is determined by the dependent node's VisitTypePolicy. In +the above example: - If T3 is required on the same vehicle as T1, A, +AR or UV must be on the same vehicle as a1. - If T2 is required when +adding T1, a2 must be visited *before* a1, and if r2 is also visited +on the route, it must be *after* a1, i.e. T2 must be on the vehicle +when a1 is visited: ... --> a2 --> ... --> a1 --> ... --> r2 --> ... - +If T3 is required when removing T1, T3 needs to be on the vehicle when +r1 is visited: ... --> A --> ... --> r1 --> ... OR ... --> r1 --> ... +--> UV --> ...)doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_CheckRegulationsOnVehicle = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_InitialPropagate = + R"doc()doc"; + +static const char* __doc_operations_research_TypeRegulationsConstraint_Post = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_PropagateNodeRegulations = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_TypeRegulationsConstraint = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_incompatibility_checker = + R"doc()doc"; + +static const char* __doc_operations_research_TypeRegulationsConstraint_model = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_requirement_checker = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRegulationsConstraint_vehicle_demons = + R"doc()doc"; + +static const char* __doc_operations_research_TypeRequirementChecker = + R"doc(Checker for type requirements.)doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_CheckRequiredTypesCurrentlyOnRoute = + R"doc(Verifies that for each set in required_type_alternatives, at least one +of the required types is on the route at position 'pos'.)doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_CheckTypeRegulations = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_FinalizeCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_HasRegulationsToCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_OnInitializeCheck = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_TypeRequirementChecker = + R"doc()doc"; + +static const char* + __doc_operations_research_TypeRequirementChecker_types_with_same_vehicle_requirements_on_route = + R"doc()doc"; + +#if defined(__GNUG__) +#pragma GCC diagnostic pop +#endif diff --git a/ortools/routing/python/routing_index_manager_doc.h b/ortools/routing/python/routing_index_manager_doc.h new file mode 100644 index 0000000000..c3232fb7b2 --- /dev/null +++ b/ortools/routing/python/routing_index_manager_doc.h @@ -0,0 +1,146 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + This file contains docstrings for use in the Python bindings. + Do not edit! They were automatically extracted by pybind11_mkdoc. + */ + +#define __EXPAND(x) x +#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT +#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) +#define __CAT1(a, b) a##b +#define __CAT2(a, b) __CAT1(a, b) +#define __DOC1(n1) __doc_##n1 +#define __DOC2(n1, n2) __doc_##n1##_##n2 +#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 +#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 +#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 +#define __DOC6(n1, n2, n3, n4, n5, n6) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 +#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 +#define DOC(...) \ + __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) + +#if defined(__GNUG__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +static const char* __doc_operations_research_RoutingIndexManager = + R"doc(Manager for any NodeIndex <-> variable index conversion. The routing +solver uses variable indices internally and through its API. These +variable indices are tricky to manage directly because one Node can +correspond to a multitude of variables, depending on the number of +times they appear in the model, and if they're used as start and/or +end points. This class aims to simplify variable index usage, allowing +users to use NodeIndex instead. + +Usage: + +``` +{.cpp} + auto starts_ends = ...; /// These are NodeIndex. + RoutingIndexManager manager(10, 4, starts_ends); // 10 nodes, 4 vehicles. + RoutingModel model(manager); +``` + +Then, use 'manager.NodeToIndex(node)' whenever model requires a +variable index. + +Note: the mapping between node indices and variables indices is +subject to change so no assumption should be made on it. The only +guarantee is that indices range between 0 and n-1, where n = number of +vehicles * 2 (for start and end nodes) + number of non-start or end +nodes.)doc"; + +static const char* __doc_operations_research_RoutingIndexManager_GetEndIndex = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_GetIndexToNodeMap = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_GetStartIndex = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_IndexToNode = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_IndicesToNodes = R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_Initialize = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_NodeToIndex = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_NodesToIndices = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_RoutingIndexManager = + R"doc(Creates a NodeIndex to variable index mapping for a problem containing +'num_nodes', 'num_vehicles' and the given starts and ends for each +vehicle. If used, any start/end arrays have to have exactly +'num_vehicles' elements.)doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_RoutingIndexManager_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_RoutingIndexManager_3 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_index_to_node = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_node_to_index = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_num_indices = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_num_nodes = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_num_nodes_2 = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_num_unique_depots = + R"doc(complete.)doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_num_unique_depots_2 = + R"doc()doc"; + +static const char* __doc_operations_research_RoutingIndexManager_num_vehicles = + R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_num_vehicles_2 = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_vehicle_to_end = R"doc()doc"; + +static const char* + __doc_operations_research_RoutingIndexManager_vehicle_to_start = + R"doc()doc"; + +#if defined(__GNUG__) +#pragma GCC diagnostic pop +#endif diff --git a/ortools/routing/python/routing_model.cc b/ortools/routing/python/routing_model.cc new file mode 100644 index 0000000000..35d5b4e4b2 --- /dev/null +++ b/ortools/routing/python/routing_model.cc @@ -0,0 +1,106 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "ortools/constraint_solver/constraint_solver.h" +#include "ortools/constraint_solver/routing.h" +#include "ortools/constraint_solver/routing_index_manager.h" +#include "ortools/constraint_solver/routing_parameters.h" +#include "ortools/constraint_solver/solver_parameters.pb.h" +#include "ortools/routing/python/routing_doc.h" +#include "ortools/routing/python/routing_index_manager_doc.h" +#include "ortools/routing/python/routing_parameters_doc.h" +#include "pybind11/cast.h" +#include "pybind11/functional.h" +#include "pybind11/gil.h" +#include "pybind11/pybind11.h" +#include "pybind11/stl.h" +#include "pybind11_protobuf/native_proto_caster.h" + +using ::operations_research::DefaultRoutingSearchParameters; +using ::operations_research::RoutingIndexManager; +using ::operations_research::RoutingModel; +using ::pybind11::arg; + +PYBIND11_MODULE(routing_model, m) { + pybind11_protobuf::ImportNativeProtoCasters(); + + pybind11::module::import( + "ortools.constraint_solver.python.constraint_solver"); + + m.def("default_routing_search_parameters", &DefaultRoutingSearchParameters, + DOC(operations_research, DefaultRoutingSearchParameters)); + + pybind11::class_( + m, "RoutingIndexManager", DOC(operations_research, RoutingIndexManager)) + .def(pybind11::init([](int num_nodes, int num_vehicles, int depot) { + return new RoutingIndexManager( + num_nodes, num_vehicles, + RoutingIndexManager::NodeIndex(depot)); + }), + DOC(operations_research, RoutingIndexManager, RoutingIndexManager)) + .def("num_nodes", &RoutingIndexManager::num_nodes, + DOC(operations_research, RoutingIndexManager, num_nodes)) + .def("num_vehicles", &RoutingIndexManager::num_vehicles, + DOC(operations_research, RoutingIndexManager, num_vehicles)) + .def( + "index_to_node", + [](RoutingIndexManager* routing_manager, int64_t index) { + return routing_manager->IndexToNode(index).value(); + }, + DOC(operations_research, RoutingIndexManager, IndexToNode)) + .def( + "node_to_index", + [](RoutingIndexManager* routing_manager, int node) { + return routing_manager->NodeToIndex( + RoutingIndexManager::NodeIndex(node)); + }, + DOC(operations_research, RoutingIndexManager, NodeToIndex)) + .def("get_start_index", &RoutingIndexManager::GetStartIndex, + DOC(operations_research, RoutingIndexManager, GetStartIndex)) + .def("get_end_index", &RoutingIndexManager::GetEndIndex, + DOC(operations_research, RoutingIndexManager, GetEndIndex)); + + pybind11::class_(m, "RoutingModel") + .def(pybind11::init([](const RoutingIndexManager& routing_index_manager) { + return new RoutingModel(routing_index_manager); + })) + .def("register_transit_callback", + [](RoutingModel* routing_model, + std::function transit_callback) { + return routing_model->RegisterTransitCallback( + std::move(transit_callback)); + }) + .def("set_arc_cost_evaluator_of_all_vehicles", + &RoutingModel::SetArcCostEvaluatorOfAllVehicles, + arg("transit_callback_index")) + .def("solve", &RoutingModel::Solve, + pybind11::return_value_policy::reference_internal, + arg("assignment") = nullptr) + .def("solve_with_parameters", &RoutingModel::SolveWithParameters, + pybind11::return_value_policy::reference_internal, + arg("search_parameters"), arg("solutions") = nullptr) + .def("status", &RoutingModel::status) + .def("start", &RoutingModel::Start, arg("vehicle")) + .def("end", &RoutingModel::End, arg("vehicle")) + .def("is_start", &RoutingModel::IsStart, arg("index")) + .def("is_end", &RoutingModel::IsEnd, arg("index")) + .def("next", &RoutingModel::Next, arg("assignment"), arg("index")) + .def("next_var", &RoutingModel::NextVar, + pybind11::return_value_policy::reference_internal, arg("index")) + .def("get_arc_cost_for_vehicle", &RoutingModel::GetArcCostForVehicle, + arg("from_index"), arg("to_index"), arg("vehicle")); +} diff --git a/ortools/routing/python/routing_parameters_doc.h b/ortools/routing/python/routing_parameters_doc.h new file mode 100644 index 0000000000..38de7837cc --- /dev/null +++ b/ortools/routing/python/routing_parameters_doc.h @@ -0,0 +1,65 @@ +// Copyright 2010-2024 Google LLC +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/* + This file contains docstrings for use in the Python bindings. + Do not edit! They were automatically extracted by pybind11_mkdoc. + */ + +#define __EXPAND(x) x +#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT +#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) +#define __CAT1(a, b) a##b +#define __CAT2(a, b) __CAT1(a, b) +#define __DOC1(n1) __doc_##n1 +#define __DOC2(n1, n2) __doc_##n1##_##n2 +#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 +#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 +#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 +#define __DOC6(n1, n2, n3, n4, n5, n6) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 +#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ + __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 +#define DOC(...) \ + __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) + +#if defined(__GNUG__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + +static const char* __doc_operations_research_DefaultRoutingModelParameters = + R"doc()doc"; + +static const char* __doc_operations_research_DefaultRoutingSearchParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_DefaultSecondaryRoutingSearchParameters = + R"doc()doc"; + +static const char* + __doc_operations_research_FindErrorInRoutingSearchParameters = + R"doc(Returns an empty std::string if the routing search parameters are +valid, and a non-empty, human readable error description if they're +not.)doc"; + +static const char* + __doc_operations_research_FindErrorsInRoutingSearchParameters = + R"doc(Returns a list of std::string describing the errors in the routing +search parameters. Returns an empty vector if the parameters are +valid.)doc"; + +#if defined(__GNUG__) +#pragma GCC diagnostic pop +#endif diff --git a/ortools/routing/samples/BUILD.bazel b/ortools/routing/samples/BUILD.bazel index 4386ad8982..83e648522b 100644 --- a/ortools/routing/samples/BUILD.bazel +++ b/ortools/routing/samples/BUILD.bazel @@ -37,7 +37,7 @@ cc_binary( deps = [ "//ortools/base", "//ortools/constraint_solver:routing", - "//ortools/constraint_solver:routing_enums_cc_proto", + "//ortools/routing:enums_cc_proto", "//ortools/routing/parsers:cvrptw_lib", "@com_google_absl//absl/strings", ], diff --git a/ortools/routing/samples/cvrp_disjoint_tw.cc b/ortools/routing/samples/cvrp_disjoint_tw.cc index d16da26daf..02bfcc802c 100644 --- a/ortools/routing/samples/cvrp_disjoint_tw.cc +++ b/ortools/routing/samples/cvrp_disjoint_tw.cc @@ -36,7 +36,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw.cc b/ortools/routing/samples/cvrptw.cc index 32ba7b4554..d07534fabe 100644 --- a/ortools/routing/samples/cvrptw.cc +++ b/ortools/routing/samples/cvrptw.cc @@ -34,7 +34,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_soft_capacity.cc b/ortools/routing/samples/cvrptw_soft_capacity.cc index 8d0f91071a..defd4c6302 100644 --- a/ortools/routing/samples/cvrptw_soft_capacity.cc +++ b/ortools/routing/samples/cvrptw_soft_capacity.cc @@ -33,7 +33,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_breaks.cc b/ortools/routing/samples/cvrptw_with_breaks.cc index 52cecec566..2f57cf4f90 100644 --- a/ortools/routing/samples/cvrptw_with_breaks.cc +++ b/ortools/routing/samples/cvrptw_with_breaks.cc @@ -38,10 +38,10 @@ #include "ortools/base/logging.h" #include "ortools/base/types.h" #include "ortools/constraint_solver/routing.h" -#include "ortools/constraint_solver/routing_enums.pb.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/enums.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_precedences.cc b/ortools/routing/samples/cvrptw_with_precedences.cc index dedf0ba2e6..fdfd73b487 100644 --- a/ortools/routing/samples/cvrptw_with_precedences.cc +++ b/ortools/routing/samples/cvrptw_with_precedences.cc @@ -35,8 +35,8 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" #include "ortools/graph/graph_builder.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_refueling.cc b/ortools/routing/samples/cvrptw_with_refueling.cc index b48db7b9d3..4c47cae256 100644 --- a/ortools/routing/samples/cvrptw_with_refueling.cc +++ b/ortools/routing/samples/cvrptw_with_refueling.cc @@ -32,7 +32,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_resources.cc b/ortools/routing/samples/cvrptw_with_resources.cc index a5d57e8863..e9e0692807 100644 --- a/ortools/routing/samples/cvrptw_with_resources.cc +++ b/ortools/routing/samples/cvrptw_with_resources.cc @@ -34,7 +34,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_stop_times_and_resources.cc b/ortools/routing/samples/cvrptw_with_stop_times_and_resources.cc index 19f734435b..fb1b607005 100644 --- a/ortools/routing/samples/cvrptw_with_stop_times_and_resources.cc +++ b/ortools/routing/samples/cvrptw_with_stop_times_and_resources.cc @@ -33,7 +33,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" using operations_research::Assignment; diff --git a/ortools/routing/samples/cvrptw_with_time_dependent_costs.cc b/ortools/routing/samples/cvrptw_with_time_dependent_costs.cc index d57e087ad8..4017cdc7e6 100644 --- a/ortools/routing/samples/cvrptw_with_time_dependent_costs.cc +++ b/ortools/routing/samples/cvrptw_with_time_dependent_costs.cc @@ -32,7 +32,7 @@ #include "ortools/constraint_solver/routing.h" #include "ortools/constraint_solver/routing_index_manager.h" #include "ortools/constraint_solver/routing_parameters.h" -#include "ortools/constraint_solver/routing_parameters.pb.h" +#include "ortools/routing/parameters.pb.h" #include "ortools/routing/parsers/cvrptw_lib.h" #include "ortools/util/range_query_function.h" #include "ortools/util/step_function.h" diff --git a/ortools/routing/samples/tsp.py b/ortools/routing/samples/tsp.py new file mode 100644 index 0000000000..b2ee240be8 --- /dev/null +++ b/ortools/routing/samples/tsp.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python3 +# Copyright 2010-2024 Google LLC +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START program] +"""Simple Travelling Salesman Problem. + +A description of the problem can be found here: +http://en.wikipedia.org/wiki/Travelling_salesperson_problem. +""" + +# [START import] +from ortools.routing import enums_pb2 +from ortools.routing import parameters_pb2 +from ortools.routing.python import routing_model + +FirstSolutionStrategy = enums_pb2.FirstSolutionStrategy +RoutingSearchStatus = enums_pb2.RoutingSearchStatus +# [END import] + + +# [START data_model] +def create_data_model(): + """Stores the data for the problem.""" + data = {} + # Locations in block units + locations = [ + # fmt:off + (4, 4), # depot + (2, 0), (8, 0), # locations to visit + (0, 1), (1, 1), + (5, 2), (7, 2), + (3, 3), (6, 3), + (5, 5), (8, 5), + (1, 6), (2, 6), + (3, 7), (6, 7), + (0, 8), (7, 8) + # fmt:on + ] + # Convert locations in meters using a city block dimension of 114m x 80m. + data["locations"] = [(l[0] * 114, l[1] * 80) for l in locations] + data["num_vehicles"] = 1 + data["depot"] = 0 + return data + # [END data_model] + + +# [START distance_callback] +def create_distance_callback(data, manager): + """Creates callback to return distance between points.""" + distances_ = {} + index_manager_ = manager + # precompute distance between location to have distance callback in O(1) + for from_counter, from_node in enumerate(data["locations"]): + distances_[from_counter] = {} + for to_counter, to_node in enumerate(data["locations"]): + if from_counter == to_counter: + distances_[from_counter][to_counter] = 0 + else: + distances_[from_counter][to_counter] = abs( + from_node[0] - to_node[0] + ) + abs(from_node[1] - to_node[1]) + + def distance_callback(from_index, to_index): + """Returns the manhattan distance between the two nodes.""" + # Convert from routing variable Index to distance matrix NodeIndex. + from_node = index_manager_.index_to_node(from_index) + to_node = index_manager_.index_to_node(to_index) + return distances_[from_node][to_node] + + return distance_callback + # [END distance_callback] + + +# [START solution_printer] +def print_solution(manager, routing, solution): + """Prints assignment on console.""" + status = routing.status() + print(f"Status: {RoutingSearchStatus.Value.Name(status)}") + if ( + status != RoutingSearchStatus.ROUTING_OPTIMAL + and status != RoutingSearchStatus.ROUTING_SUCCESS + ): + print("No solution found!") + return + print(f"Objective: {solution.objective_value()}") + index = routing.start(0) + plan_output = "Route for vehicle 0:\n" + route_distance = 0 + while not routing.is_end(index): + plan_output += f" {manager.index_to_node(index)} ->" + previous_index = index + index = solution.value(routing.next_var(index)) + route_distance += routing.get_arc_cost_for_vehicle(previous_index, index, 0) + plan_output += f" {manager.index_to_node(index)}\n" + plan_output += f"Distance of the route: {route_distance}m\n" + print(plan_output) + # [END solution_printer] + + +def main(): + """Entry point of the program.""" + # Instantiate the data problem. + # [START data] + data = create_data_model() + # [END data] + + # Create the routing index manager. + # [START index_manager] + manager = routing_model.RoutingIndexManager( + len(data["locations"]), data["num_vehicles"], data["depot"] + ) + # [END index_manager] + + # Create Routing Model. + # [START routing_model] + routing = routing_model.RoutingModel(manager) + # [END routing_model] + + # Create and register a transit callback. + # [START transit_callback] + distance_callback = create_distance_callback(data, manager) + transit_callback_index = routing.register_transit_callback(distance_callback) + # [END transit_callback] + + # Define cost of each arc. + # [START arc_cost] + routing.set_arc_cost_evaluator_of_all_vehicles(transit_callback_index) + # [END arc_cost] + + # Setting first solution heuristic. + # [START parameters] + search_parameters: parameters_pb2.RoutingSearchParameters = ( + routing_model.default_routing_search_parameters() + ) + search_parameters.first_solution_strategy = FirstSolutionStrategy.PATH_CHEAPEST_ARC + # [END parameters] + + # Solve the problem. + # [START solve] + solution = routing.solve() + # solution = routing.solve_with_parameters(search_parameters) + # [END solve] + + # Print solution on console. + # [START print_solution] + print_solution(manager, routing, solution) + # [END print_solution] + + +if __name__ == "__main__": + main() +# [END program]