Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class RoutingCPSatWrapper
Note: This documentation is automatically generated.
Method |
AddMaximumConstraint | Return type: void Arguments: int max_var, std::vector<int> vars |
AddObjectiveConstraint | Return type: void |
AddProductConstraint | Return type: void Arguments: int product_var, std::vector<int> vars |
Clear | Return type: void |
ClearObjective | Return type: void |
CreateNewConstraint | Return type: int Arguments: int64_t lower_bound, int64_t upper_bound |
CreateNewPositiveVariable | Return type: int |
GetObjectiveCoefficient | Return type: double Arguments: int index |
GetObjectiveValue | Return type: int64_t |
GetValue | Return type: double Arguments: int index |
GetVariableLowerBound | Return type: int64_t Arguments: int index |
GetVariableUpperBound | Return type: int64_t Arguments: int index |
IsCPSATSolver | Return type: bool |
NumVariables | Return type: int |
RoutingCPSatWrapper | |
~RoutingCPSatWrapper | |
SetCoefficient | Return type: void Arguments: int ct_index, int index, double coefficient |
SetEnforcementLiteral | Return type: void Arguments: int ct, int condition |
SetObjectiveCoefficient | Return type: void Arguments: int index, double coefficient |
SetParameters | Return type: void Arguments: const std::string& /*parameters*/ NOTE: This function is not implemented for the CP-SAT solver.
|
SetVariableBounds | Return type: bool Arguments: int index, int64_t lower_bound,
int64_t upper_bound |
SetVariableDisjointBounds | Return type: void Arguments: int index, const std::vector<int64_t>& starts,
const std::vector<int64_t>& ends |
SetVariableName | Return type: void Arguments: int index, absl::string_view name |
SolutionIsInteger | Return type: bool |
Solve | Return type: DimensionSchedulingStatus Arguments: absl::Duration duration_limit |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eRoutingCPSatWrapper\u003c/code\u003e provides an interface to interact with the CP-SAT solver for scheduling and routing problems.\u003c/p\u003e\n"],["\u003cp\u003eIt allows creating and managing variables, setting constraints, and defining objectives.\u003c/p\u003e\n"],["\u003cp\u003eUsers can add specific constraints like maximum, product, and objective constraints to the solver.\u003c/p\u003e\n"],["\u003cp\u003eMethods are available to retrieve solution values, variable bounds, and objective information.\u003c/p\u003e\n"],["\u003cp\u003eIt facilitates solving the problem with a specified time limit and checking the integrality of the solution.\u003c/p\u003e\n"]]],["The `RoutingCPSatWrapper` class provides methods for managing constraints and variables in a CP-SAT solver. Key actions include adding maximum and product constraints, setting objective and variable coefficients/bounds, creating new constraints and variables, clearing objective or all data, setting enforcement literals, and obtaining values of objectives and variables. It also allows to check for an integer solution, and to solve the problem, returning the solution's status. Methods for managing variable names, parameters, and disjoint bounds are available.\n"],null,["# RoutingCPSatWrapper\n\nC++ Reference: class RoutingCPSatWrapper\n========================================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| [`AddMaximumConstraint`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L535) | Return type: `void ` Arguments: `int max_var, std::vector\u003cint\u003e vars` \u003cbr /\u003e |\n| [`AddObjectiveConstraint`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L522) | Return type: `void ` \u003cbr /\u003e |\n| [`AddProductConstraint`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L546) | Return type: `void ` Arguments: `int product_var, std::vector\u003cint\u003e vars` \u003cbr /\u003e |\n| [`Clear`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L438) | Return type: `void ` \u003cbr /\u003e |\n| [`ClearObjective`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L503) | Return type: `void ` \u003cbr /\u003e |\n| [`CreateNewConstraint`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L507) | Return type: `int ` Arguments: `int64_t lower_bound, int64_t upper_bound` \u003cbr /\u003e |\n| [`CreateNewPositiveVariable`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L443) | Return type: `int ` \u003cbr /\u003e |\n| [`GetObjectiveCoefficient`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L498) | Return type: `double ` Arguments: `int index` \u003cbr /\u003e |\n| [`GetObjectiveValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L583) | Return type: `int64_t ` \u003cbr /\u003e |\n| [`GetValue`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L586) | Return type: `double ` Arguments: `int index` \u003cbr /\u003e |\n| [`GetVariableLowerBound`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L481) | Return type: `int64_t ` Arguments: `int index` \u003cbr /\u003e |\n| [`GetVariableUpperBound`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L484) | Return type: `int64_t ` Arguments: `int index` \u003cbr /\u003e |\n| [`IsCPSATSolver`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L521) | Return type: `bool ` \u003cbr /\u003e |\n| [`NumVariables`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L506) | Return type: `int ` \u003cbr /\u003e |\n| [`RoutingCPSatWrapper`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L427) | \u003cbr /\u003e |\n| [`~RoutingCPSatWrapper`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L437) | \u003cbr /\u003e |\n| [`SetCoefficient`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L514) | Return type: `void ` Arguments: `int ct_index, int index, double coefficient` \u003cbr /\u003e |\n| [`SetEnforcementLiteral`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L557) | Return type: `void ` Arguments: `int ct, int condition` \u003cbr /\u003e |\n| [`SetObjectiveCoefficient`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L488) | Return type: `void ` Arguments: `int index, double coefficient` \u003cbr /\u003e |\n| [`SetParameters`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L592) | Return type: `void ` Arguments: `const std::string& /*parameters*/` NOTE: This function is not implemented for the CP-SAT solver. |\n| [`SetVariableBounds`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L453) | Return type: `bool ` Arguments: `int index, int64_t lower_bound, int64_t upper_bound` \u003cbr /\u003e |\n| [`SetVariableDisjointBounds`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L464) | Return type: `void ` Arguments: `int index, const std::vector\u003cint64_t\u003e& starts, const std::vector\u003cint64_t\u003e& ends` \u003cbr /\u003e |\n| [`SetVariableName`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L450) | Return type: `void ` Arguments: `int index, absl::string_view name` \u003cbr /\u003e |\n| [`SolutionIsInteger`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L589) | Return type: `bool ` \u003cbr /\u003e |\n| [`Solve`](https://github.com/google/or-tools/blob/v9.4/ortools/constraint_solver/routing_lp_scheduling.h#L561) | Return type: `DimensionSchedulingStatus ` Arguments: `absl::Duration duration_limit` \u003cbr /\u003e |"]]