Google OR-Tools: operations_research::Solver Class Reference
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.
Definition at line 259 of file constraint_solver.h.
#include <constraint_solver.h>
Public Member Functions | |
| Solver (const std::string &name) | |
| Solver API. | |
| Solver (const std::string &name, const ConstraintSolverParameters ¶meters) | |
| Solver (const Solver &)=delete | |
| Solver & | operator= (const Solver &)=delete |
| ~Solver () | |
| ConstraintSolverParameters | parameters () const |
| Stored Parameters. | |
| const ConstraintSolverParameters & | const_parameters () const |
| template<class T> | |
| void | SaveValue (T *o) |
| reversibility | |
| template<typename T> | |
| T * | RevAlloc (T *object) |
| template<typename T> | |
| T * | RevAllocArray (T *object) |
| void | AddConstraint (Constraint *c) |
| Adds the constraint 'c' to the model. | |
| void | AddCastConstraint (CastConstraint *constraint, IntVar *target_var, IntExpr *expr) |
| bool | SolveAndCommit (DecisionBuilder *db, const std::vector< SearchMonitor * > &monitors) |
| bool | SolveAndCommit (DecisionBuilder *db) |
| bool | SolveAndCommit (DecisionBuilder *db, SearchMonitor *m1) |
| bool | SolveAndCommit (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2) |
| bool | SolveAndCommit (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2, SearchMonitor *m3) |
| bool | CheckAssignment (Assignment *solution) |
| Checks whether the given assignment satisfies all relevant constraints. | |
| bool | CheckConstraint (Constraint *ct) |
| SolverState | state () const |
| State of the solver. | |
| void | Fail () |
| Abandon the current branch in the search tree. A backtrack will follow. | |
| void | AddBacktrackAction (Action a, bool fast) |
| std::string | DebugString () const |
| !defined(SWIG) | |
| absl::Time | Now () const |
| int64_t | wall_time () const |
| int64_t | branches () const |
| The number of branches explored since the creation of the solver. | |
| int64_t | solutions () const |
| The number of solutions found since the start of the search. | |
| int64_t | unchecked_solutions () const |
| The number of unchecked solutions found by local search. | |
| int64_t | demon_runs (DemonPriority p) const |
| The number of demons executed during search for a given priority. | |
| int64_t | failures () const |
| The number of failures encountered since the creation of the solver. | |
| int64_t | neighbors () const |
| The number of neighbors created. | |
| void | ClearNeighbors () |
| void | IncrementNeighbors () |
| int64_t | filtered_neighbors () const |
| The number of filtered neighbors (neighbors accepted by filters). | |
| int64_t | accepted_neighbors () const |
| The number of accepted neighbors. | |
| uint64_t | stamp () const |
| uint64_t | fail_stamp () const |
| The fail_stamp() is incremented after each backtrack. | |
| void | set_context (absl::string_view context) |
| Sets the current context of the search. | |
| const std::string & | context () const |
| Gets the current context of the search. | |
| OptimizationDirection | optimization_direction () const |
| The direction of optimization, getter and setter. | |
| void | set_optimization_direction (OptimizationDirection direction) |
| void | SetGuidedLocalSearchPenaltyCallback (std::function< int64_t(int64_t, int64_t, int64_t)> penalty_callback) |
| int64_t | GetGuidedLocalSearchPenalty (int64_t i, int64_t j, int64_t k) const |
| IntVar * | MakeIntVar (int64_t min, int64_t max, const std::string &name) |
| MakeIntVar will create the best range based int var for the bounds given. | |
| IntVar * | MakeIntVar (const std::vector< int64_t > &values, const std::string &name) |
| MakeIntVar will create a variable with the given sparse domain. | |
| IntVar * | MakeIntVar (const std::vector< int > &values, const std::string &name) |
| MakeIntVar will create a variable with the given sparse domain. | |
| IntVar * | MakeIntVar (int64_t min, int64_t max) |
| MakeIntVar will create the best range based int var for the bounds given. | |
| IntVar * | MakeIntVar (const std::vector< int64_t > &values) |
| MakeIntVar will create a variable with the given sparse domain. | |
| IntVar * | MakeIntVar (const std::vector< int > &values) |
| MakeIntVar will create a variable with the given sparse domain. | |
| IntVar * | MakeBoolVar (const std::string &name) |
| MakeBoolVar will create a variable with a {0, 1} domain. | |
| IntVar * | MakeBoolVar () |
| MakeBoolVar will create a variable with a {0, 1} domain. | |
| IntVar * | MakeIntConst (int64_t val, const std::string &name) |
| IntConst will create a constant expression. | |
| IntVar * | MakeIntConst (int64_t val) |
| IntConst will create a constant expression. | |
| void | MakeIntVarArray (int var_count, int64_t vmin, int64_t vmax, const std::string &name, std::vector< IntVar * > *vars) |
| void | MakeIntVarArray (int var_count, int64_t vmin, int64_t vmax, std::vector< IntVar * > *vars) |
| IntVar ** | MakeIntVarArray (int var_count, int64_t vmin, int64_t vmax, const std::string &name) |
| Same but allocates an array and returns it. | |
| void | MakeBoolVarArray (int var_count, const std::string &name, std::vector< IntVar * > *vars) |
| void | MakeBoolVarArray (int var_count, std::vector< IntVar * > *vars) |
| IntVar ** | MakeBoolVarArray (int var_count, const std::string &name) |
| Same but allocates an array and returns it. | |
| IntExpr * | MakeSum (IntExpr *left, IntExpr *right) |
| left + right. | |
| IntExpr * | MakeSum (IntExpr *expr, int64_t value) |
| expr + value. | |
| IntExpr * | MakeSum (const std::vector< IntVar * > &vars) |
| sum of all vars. | |
| IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coefs) |
| scalar product | |
| IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int > &coefs) |
| scalar product | |
| IntExpr * | MakeDifference (IntExpr *left, IntExpr *right) |
| left - right | |
| IntExpr * | MakeDifference (int64_t value, IntExpr *expr) |
| value - expr | |
| IntExpr * | MakeOpposite (IntExpr *expr) |
| -expr | |
| IntExpr * | MakeProd (IntExpr *left, IntExpr *right) |
| left * right | |
| IntExpr * | MakeProd (IntExpr *expr, int64_t value) |
| expr * value | |
| IntExpr * | MakeDiv (IntExpr *expr, int64_t value) |
| expr / value (integer division) | |
| IntExpr * | MakeDiv (IntExpr *numerator, IntExpr *denominator) |
| numerator / denominator (integer division). Terms need to be positive. | |
| IntExpr * | MakeAbs (IntExpr *expr) |
| expr | |
| IntExpr * | MakeSquare (IntExpr *expr) |
| expr * expr | |
| IntExpr * | MakePower (IntExpr *expr, int64_t n) |
| expr ^ n (n > 0) | |
| IntExpr * | MakeElement (const std::vector< int64_t > &values, IntVar *index) |
| values[index] | |
| IntExpr * | MakeElement (const std::vector< int > &values, IntVar *index) |
| values[index] | |
| IntExpr * | MakeElement (IndexEvaluator1 values, IntVar *index) |
| IntExpr * | MakeMonotonicElement (IndexEvaluator1 values, bool increasing, IntVar *index) |
| IntExpr * | MakeElement (IndexEvaluator2 values, IntVar *index1, IntVar *index2) |
| 2D version of function-based element expression, values(expr1, expr2). | |
| IntExpr * | MakeElement (const std::vector< IntVar * > &vars, IntVar *index) |
| vars[expr] | |
| IntExpr * | MakeElement (Int64ToIntVar vars, int64_t range_start, int64_t range_end, IntVar *argument) |
| vars(argument) | |
| template<typename F> | |
| Constraint * | MakeLightElement (F values, IntVar *const var, IntVar *const index, std::function< bool()> deep_serialize=nullptr) |
| template<typename F> | |
| Constraint * | MakeLightElement (F values, IntVar *const var, IntVar *const index1, IntVar *const index2, std::function< bool()> deep_serialize=nullptr) |
| template<typename F> | |
| Constraint * | MakeLightElement (F values, IntVar *const var, IntVar *const index1, IntVar *const index2, IntVar *const index3) |
| IntExpr * | MakeIndexExpression (const std::vector< IntVar * > &vars, int64_t value) |
| Constraint * | MakeIfThenElseCt (IntVar *condition, IntExpr *then_expr, IntExpr *else_expr, IntVar *target_var) |
| Special cases with arrays of size two. | |
| IntExpr * | MakeMin (const std::vector< IntVar * > &vars) |
| std::min(vars) | |
| IntExpr * | MakeMin (IntExpr *left, IntExpr *right) |
| std::min (left, right) | |
| IntExpr * | MakeMin (IntExpr *expr, int64_t value) |
| std::min(expr, value) | |
| IntExpr * | MakeMin (IntExpr *expr, int value) |
| std::min(expr, value) | |
| IntExpr * | MakeMax (const std::vector< IntVar * > &vars) |
| std::max(vars) | |
| IntExpr * | MakeMax (IntExpr *left, IntExpr *right) |
| std::max(left, right) | |
| IntExpr * | MakeMax (IntExpr *expr, int64_t value) |
| std::max(expr, value) | |
| IntExpr * | MakeMax (IntExpr *expr, int value) |
| std::max(expr, value) | |
| IntExpr * | MakeConvexPiecewiseExpr (IntExpr *expr, int64_t early_cost, int64_t early_date, int64_t late_date, int64_t late_cost) |
| Convex piecewise function. | |
| IntExpr * | MakeSemiContinuousExpr (IntExpr *expr, int64_t fixed_charge, int64_t step) |
| IntExpr * | MakePiecewiseLinearExpr (IntExpr *expr, const PiecewiseLinearFunction &f) |
| expressions. | |
| IntExpr * | MakeModulo (IntExpr *x, int64_t mod) |
| Modulo expression x % mod (with the python convention for modulo). | |
| IntExpr * | MakeModulo (IntExpr *x, IntExpr *mod) |
| Modulo expression x % mod (with the python convention for modulo). | |
| IntExpr * | MakeConditionalExpression (IntVar *condition, IntExpr *expr, int64_t unperformed_value) |
| Conditional Expr condition ? expr : unperformed_value. | |
| Constraint * | MakeTrueConstraint () |
| This constraint always succeeds. | |
| Constraint * | MakeFalseConstraint () |
| This constraint always fails. | |
| Constraint * | MakeFalseConstraint (const std::string &explanation) |
| Constraint * | MakeIsEqualCstCt (IntExpr *var, int64_t value, IntVar *boolvar) |
| boolvar == (var == value) | |
| IntVar * | MakeIsEqualCstVar (IntExpr *var, int64_t value) |
| status var of (var == value) | |
| Constraint * | MakeIsEqualCt (IntExpr *v1, IntExpr *v2, IntVar *b) |
| b == (v1 == v2) | |
| IntVar * | MakeIsEqualVar (IntExpr *v1, IntExpr *v2) |
| status var of (v1 == v2) | |
| Constraint * | MakeEquality (IntExpr *left, IntExpr *right) |
| left == right | |
| Constraint * | MakeEquality (IntExpr *expr, int64_t value) |
| expr == value | |
| Constraint * | MakeEquality (IntExpr *expr, int value) |
| expr == value | |
| Constraint * | MakeIsDifferentCstCt (IntExpr *var, int64_t value, IntVar *boolvar) |
| boolvar == (var != value) | |
| IntVar * | MakeIsDifferentCstVar (IntExpr *var, int64_t value) |
| status var of (var != value) | |
| IntVar * | MakeIsDifferentVar (IntExpr *v1, IntExpr *v2) |
| status var of (v1 != v2) | |
| Constraint * | MakeIsDifferentCt (IntExpr *v1, IntExpr *v2, IntVar *b) |
| b == (v1 != v2) | |
| Constraint * | MakeNonEquality (IntExpr *left, IntExpr *right) |
| left != right | |
| Constraint * | MakeNonEquality (IntExpr *expr, int64_t value) |
| expr != value | |
| Constraint * | MakeNonEquality (IntExpr *expr, int value) |
| expr != value | |
| Constraint * | MakeIsLessOrEqualCstCt (IntExpr *var, int64_t value, IntVar *boolvar) |
| boolvar == (var <= value) | |
| IntVar * | MakeIsLessOrEqualCstVar (IntExpr *var, int64_t value) |
| status var of (var <= value) | |
| IntVar * | MakeIsLessOrEqualVar (IntExpr *left, IntExpr *right) |
| status var of (left <= right) | |
| Constraint * | MakeIsLessOrEqualCt (IntExpr *left, IntExpr *right, IntVar *b) |
| b == (left <= right) | |
| Constraint * | MakeLessOrEqual (IntExpr *left, IntExpr *right) |
| left <= right | |
| Constraint * | MakeLessOrEqual (IntExpr *expr, int64_t value) |
| expr <= value | |
| Constraint * | MakeLessOrEqual (IntExpr *expr, int value) |
| expr <= value | |
| Constraint * | MakeIsGreaterOrEqualCstCt (IntExpr *var, int64_t value, IntVar *boolvar) |
| boolvar == (var >= value) | |
| IntVar * | MakeIsGreaterOrEqualCstVar (IntExpr *var, int64_t value) |
| status var of (var >= value) | |
| IntVar * | MakeIsGreaterOrEqualVar (IntExpr *left, IntExpr *right) |
| status var of (left >= right) | |
| Constraint * | MakeIsGreaterOrEqualCt (IntExpr *left, IntExpr *right, IntVar *b) |
| b == (left >= right) | |
| Constraint * | MakeGreaterOrEqual (IntExpr *left, IntExpr *right) |
| left >= right | |
| Constraint * | MakeGreaterOrEqual (IntExpr *expr, int64_t value) |
| expr >= value | |
| Constraint * | MakeGreaterOrEqual (IntExpr *expr, int value) |
| expr >= value | |
| Constraint * | MakeIsGreaterCstCt (IntExpr *v, int64_t c, IntVar *b) |
| b == (v > c) | |
| IntVar * | MakeIsGreaterCstVar (IntExpr *var, int64_t value) |
| status var of (var > value) | |
| IntVar * | MakeIsGreaterVar (IntExpr *left, IntExpr *right) |
| status var of (left > right) | |
| Constraint * | MakeIsGreaterCt (IntExpr *left, IntExpr *right, IntVar *b) |
| b == (left > right) | |
| Constraint * | MakeGreater (IntExpr *left, IntExpr *right) |
| left > right | |
| Constraint * | MakeGreater (IntExpr *expr, int64_t value) |
| expr > value | |
| Constraint * | MakeGreater (IntExpr *expr, int value) |
| expr > value | |
| Constraint * | MakeIsLessCstCt (IntExpr *v, int64_t c, IntVar *b) |
| b == (v < c) | |
| IntVar * | MakeIsLessCstVar (IntExpr *var, int64_t value) |
| status var of (var < value) | |
| IntVar * | MakeIsLessVar (IntExpr *left, IntExpr *right) |
| status var of (left < right) | |
| Constraint * | MakeIsLessCt (IntExpr *left, IntExpr *right, IntVar *b) |
| b == (left < right) | |
| Constraint * | MakeLess (IntExpr *left, IntExpr *right) |
| left < right | |
| Constraint * | MakeLess (IntExpr *expr, int64_t value) |
| expr < value | |
| Constraint * | MakeLess (IntExpr *expr, int value) |
| expr < value | |
| Constraint * | MakeSumLessOrEqual (const std::vector< IntVar * > &vars, int64_t cst) |
| Variation on arrays. | |
| Constraint * | MakeSumGreaterOrEqual (const std::vector< IntVar * > &vars, int64_t cst) |
| Constraint * | MakeSumEquality (const std::vector< IntVar * > &vars, int64_t cst) |
| Constraint * | MakeSumEquality (const std::vector< IntVar * > &vars, IntVar *var) |
| Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coefficients, int64_t cst) |
| Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, int64_t cst) |
| Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coefficients, IntVar *target) |
| Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, IntVar *target) |
| Constraint * | MakeScalProdGreaterOrEqual (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coeffs, int64_t cst) |
| Constraint * | MakeScalProdGreaterOrEqual (const std::vector< IntVar * > &vars, const std::vector< int > &coeffs, int64_t cst) |
| Constraint * | MakeScalProdLessOrEqual (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coefficients, int64_t cst) |
| Constraint * | MakeScalProdLessOrEqual (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, int64_t cst) |
| Constraint * | MakeMinEquality (const std::vector< IntVar * > &vars, IntVar *min_var) |
| Constraint * | MakeMaxEquality (const std::vector< IntVar * > &vars, IntVar *max_var) |
| Constraint * | MakeElementEquality (const std::vector< int64_t > &vals, IntVar *index, IntVar *target) |
| Constraint * | MakeElementEquality (const std::vector< int > &vals, IntVar *index, IntVar *target) |
| Constraint * | MakeElementEquality (const std::vector< IntVar * > &vars, IntVar *index, IntVar *target) |
| Constraint * | MakeElementEquality (const std::vector< IntVar * > &vars, IntVar *index, int64_t target) |
| Constraint * | MakeAbsEquality (IntVar *var, IntVar *abs_var) |
| Creates the constraint abs(var) == abs_var. | |
| Constraint * | MakeIndexOfConstraint (const std::vector< IntVar * > &vars, IntVar *index, int64_t target) |
| Demon * | MakeConstraintInitialPropagateCallback (Constraint *ct) |
| Demon * | MakeDelayedConstraintInitialPropagateCallback (Constraint *ct) |
| Demon * | MakeActionDemon (Action action) |
| Creates a demon from a callback. | |
| Demon * | MakeClosureDemon (Closure closure) |
| Creates a demon from a closure. | |
| Constraint * | MakeBetweenCt (IntExpr *expr, int64_t l, int64_t u) |
| (l <= expr <= u) | |
| Constraint * | MakeNotBetweenCt (IntExpr *expr, int64_t l, int64_t u) |
| Constraint * | MakeIsBetweenCt (IntExpr *expr, int64_t l, int64_t u, IntVar *b) |
| b == (l <= expr <= u) | |
| IntVar * | MakeIsBetweenVar (IntExpr *v, int64_t l, int64_t u) |
| Constraint * | MakeMemberCt (IntExpr *expr, const std::vector< int64_t > &values) |
| Constraint * | MakeMemberCt (IntExpr *expr, const std::vector< int > &values) |
| Constraint * | MakeNotMemberCt (IntExpr *expr, const std::vector< int64_t > &values) |
| expr not in set. | |
| Constraint * | MakeNotMemberCt (IntExpr *expr, const std::vector< int > &values) |
| Constraint * | MakeNotMemberCt (IntExpr *expr, std::vector< int64_t > starts, std::vector< int64_t > ends) |
| expr should not be in the list of forbidden intervals [start[i]..end[i]]. | |
| Constraint * | MakeNotMemberCt (IntExpr *expr, std::vector< int > starts, std::vector< int > ends) |
| expr should not be in the list of forbidden intervals [start[i]..end[i]]. | |
| Constraint * | MakeNotMemberCt (IntExpr *expr, SortedDisjointIntervalList intervals) |
| expr should not be in the list of forbidden intervals. | |
| Constraint * | MakeIsMemberCt (IntExpr *expr, const std::vector< int64_t > &values, IntVar *boolvar) |
| boolvar == (expr in set) | |
| Constraint * | MakeIsMemberCt (IntExpr *expr, const std::vector< int > &values, IntVar *boolvar) |
| IntVar * | MakeIsMemberVar (IntExpr *expr, const std::vector< int64_t > &values) |
| IntVar * | MakeIsMemberVar (IntExpr *expr, const std::vector< int > &values) |
| Constraint * | MakeAtMost (std::vector< IntVar * > vars, int64_t value, int64_t max_count) |
| |{i | vars[i] == value}| <= max_count | |
| Constraint * | MakeCount (const std::vector< IntVar * > &vars, int64_t value, int64_t max_count) |
| |{i | vars[i] == value}| == max_count | |
| Constraint * | MakeCount (const std::vector< IntVar * > &vars, int64_t value, IntVar *max_count) |
| |{i | vars[i] == value}| == max_count | |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values, const std::vector< IntVar * > &cards) |
| Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. | |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int > &values, const std::vector< IntVar * > &cards) |
| Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. | |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &cards) |
| Aggregated version of count: |{i | v[i] == j}| == cards[j]. | |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, int64_t card_min, int64_t card_max, int64_t card_size) |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int64_t > &card_min, const std::vector< int64_t > &card_max) |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int > &card_min, const std::vector< int > &card_max) |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values, const std::vector< int64_t > &card_min, const std::vector< int64_t > &card_max) |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int > &values, const std::vector< int > &card_min, const std::vector< int > &card_max) |
| Constraint * | MakeDeviation (const std::vector< IntVar * > &vars, IntVar *deviation_var, int64_t total_sum) |
| Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars) |
| Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars, bool stronger_propagation) |
| Constraint * | MakeAllDifferentExcept (const std::vector< IntVar * > &vars, int64_t escape_value) |
| Constraint * | MakeSortingConstraint (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &sorted) |
| Constraint * | MakeLexicalLess (const std::vector< IntVar * > &left, const std::vector< IntVar * > &right) |
| Constraint * | MakeLexicalLessOrEqual (const std::vector< IntVar * > &left, const std::vector< IntVar * > &right) |
| Constraint * | MakeLexicalLessOrEqualWithOffsets (std::vector< IntVar * > left, std::vector< IntVar * > right, std::vector< int64_t > offsets) |
| Constraint * | MakeIsLexicalLessOrEqualWithOffsetsCt (std::vector< IntVar * > left, std::vector< IntVar * > right, std::vector< int64_t > offsets, IntVar *boolvar) |
| Constraint * | MakeInversePermutationConstraint (const std::vector< IntVar * > &left, const std::vector< IntVar * > &right) |
| Constraint * | MakeIndexOfFirstMaxValueConstraint (IntVar *index, const std::vector< IntVar * > &vars) |
| Constraint * | MakeIndexOfFirstMinValueConstraint (IntVar *index, const std::vector< IntVar * > &vars) |
| Constraint * | MakeNullIntersect (const std::vector< IntVar * > &first_vars, const std::vector< IntVar * > &second_vars) |
| Constraint * | MakeNullIntersectExcept (const std::vector< IntVar * > &first_vars, const std::vector< IntVar * > &second_vars, int64_t escape_value) |
| Constraint * | MakeNoCycle (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, IndexFilter1 sink_handler=nullptr) |
| Constraint * | MakeNoCycle (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, IndexFilter1 sink_handler, bool assume_paths) |
| Constraint * | MakeCircuit (const std::vector< IntVar * > &nexts) |
| Force the "nexts" variable to create a complete Hamiltonian path. | |
| Constraint * | MakeSubCircuit (const std::vector< IntVar * > &nexts) |
| Constraint * | MakePathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, const std::vector< IntVar * > &transits) |
| Constraint * | MakeDelayedPathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, const std::vector< IntVar * > &transits) |
| Constraint * | MakePathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, IndexEvaluator2 transit_evaluator) |
| Constraint * | MakePathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, const std::vector< IntVar * > &slacks, IndexEvaluator2 transit_evaluator) |
| Constraint * | MakePathConnected (std::vector< IntVar * > nexts, std::vector< int64_t > sources, std::vector< int64_t > sinks, std::vector< IntVar * > status) |
| Check whether more propagation is needed. | |
| Constraint * | MakePathPrecedenceConstraint (std::vector< IntVar * > nexts, const std::vector< std::pair< int, int > > &precedences) |
| Constraint * | MakePathPrecedenceConstraint (std::vector< IntVar * > nexts, const std::vector< std::pair< int, int > > &precedences, absl::Span< const int > lifo_path_starts, absl::Span< const int > fifo_path_starts) |
| Constraint * | MakePathTransitPrecedenceConstraint (std::vector< IntVar * > nexts, std::vector< IntVar * > transits, const std::vector< std::pair< int, int > > &precedences) |
| Constraint * | MakePathEnergyCostConstraint (PathEnergyCostConstraintSpecification specification) |
| Constraint * | MakeMapDomain (IntVar *var, const std::vector< IntVar * > &actives) |
| Constraint * | MakeAllowedAssignments (const std::vector< IntVar * > &vars, const IntTupleSet &tuples) |
| Constraint * | MakeTransitionConstraint (const std::vector< IntVar * > &vars, const IntTupleSet &transition_table, int64_t initial_state, const std::vector< int64_t > &final_states) |
| Constraint * | MakeTransitionConstraint (const std::vector< IntVar * > &vars, const IntTupleSet &transition_table, int64_t initial_state, const std::vector< int > &final_states) |
| Constraint * | MakeNonOverlappingBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< IntVar * > &x_size, const std::vector< IntVar * > &y_size) |
| Constraint * | MakeNonOverlappingBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, absl::Span< const int64_t > x_size, absl::Span< const int64_t > y_size) |
| Constraint * | MakeNonOverlappingBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, absl::Span< const int > x_size, absl::Span< const int > y_size) |
| Constraint * | MakeNonOverlappingNonStrictBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< IntVar * > &x_size, const std::vector< IntVar * > &y_size) |
| Constraint * | MakeNonOverlappingNonStrictBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, absl::Span< const int64_t > x_size, absl::Span< const int64_t > y_size) |
| Constraint * | MakeNonOverlappingNonStrictBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, absl::Span< const int > x_size, absl::Span< const int > y_size) |
| Pack * | MakePack (const std::vector< IntVar * > &vars, int number_of_bins) |
| IntervalVar * | MakeFixedDurationIntervalVar (int64_t start_min, int64_t start_max, int64_t duration, bool optional, const std::string &name) |
| void | MakeFixedDurationIntervalVarArray (int count, int64_t start_min, int64_t start_max, int64_t duration, bool optional, absl::string_view name, std::vector< IntervalVar * > *array) |
| IntervalVar * | MakeFixedDurationIntervalVar (IntVar *start_variable, int64_t duration, const std::string &name) |
| IntervalVar * | MakeFixedDurationIntervalVar (IntVar *start_variable, int64_t duration, IntVar *performed_variable, const std::string &name) |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, int64_t duration, absl::string_view name, std::vector< IntervalVar * > *array) |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, absl::Span< const int64_t > durations, absl::string_view name, std::vector< IntervalVar * > *array) |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, absl::Span< const int > durations, absl::string_view name, std::vector< IntervalVar * > *array) |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, absl::Span< const int64_t > durations, const std::vector< IntVar * > &performed_variables, absl::string_view name, std::vector< IntervalVar * > *array) |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, absl::Span< const int > durations, const std::vector< IntVar * > &performed_variables, absl::string_view name, std::vector< IntervalVar * > *array) |
| IntervalVar * | MakeFixedInterval (int64_t start, int64_t duration, const std::string &name) |
| Creates a fixed and performed interval. | |
| IntervalVar * | MakeIntervalVar (int64_t start_min, int64_t start_max, int64_t duration_min, int64_t duration_max, int64_t end_min, int64_t end_max, bool optional, const std::string &name) |
| void | MakeIntervalVarArray (int count, int64_t start_min, int64_t start_max, int64_t duration_min, int64_t duration_max, int64_t end_min, int64_t end_max, bool optional, absl::string_view name, std::vector< IntervalVar * > *array) |
| IntervalVar * | MakeMirrorInterval (IntervalVar *interval_var) |
| IntervalVar * | MakeFixedDurationStartSyncedOnStartIntervalVar (IntervalVar *interval_var, int64_t duration, int64_t offset) |
| IntervalVar * | MakeFixedDurationStartSyncedOnEndIntervalVar (IntervalVar *interval_var, int64_t duration, int64_t offset) |
| IntervalVar * | MakeFixedDurationEndSyncedOnStartIntervalVar (IntervalVar *interval_var, int64_t duration, int64_t offset) |
| IntervalVar * | MakeFixedDurationEndSyncedOnEndIntervalVar (IntervalVar *interval_var, int64_t duration, int64_t offset) |
| IntervalVar * | MakeIntervalRelaxedMin (IntervalVar *interval_var) |
| IntervalVar * | MakeIntervalRelaxedMax (IntervalVar *interval_var) |
| Constraint * | MakeIntervalVarRelation (IntervalVar *t, UnaryIntervalRelation r, int64_t d) |
| Constraint * | MakeIntervalVarRelation (IntervalVar *t1, BinaryIntervalRelation r, IntervalVar *t2) |
| This method creates a relation between two interval vars. | |
| Constraint * | MakeIntervalVarRelationWithDelay (IntervalVar *t1, BinaryIntervalRelation r, IntervalVar *t2, int64_t delay) |
| Constraint * | MakeTemporalDisjunction (IntervalVar *t1, IntervalVar *t2, IntVar *alt) |
| Constraint * | MakeTemporalDisjunction (IntervalVar *t1, IntervalVar *t2) |
| DisjunctiveConstraint * | MakeDisjunctiveConstraint (const std::vector< IntervalVar * > &intervals, const std::string &name) |
| DisjunctiveConstraint * | MakeStrictDisjunctiveConstraint (const std::vector< IntervalVar * > &intervals, const std::string &name) |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int64_t > &demands, int64_t capacity, const std::string &name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int > &demands, int64_t capacity, const std::string &name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int64_t > &demands, IntVar *capacity, absl::string_view name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int > &demands, IntVar *capacity, const std::string &name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< IntVar * > &demands, int64_t capacity, const std::string &name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< IntVar * > &demands, IntVar *capacity, const std::string &name) |
| Intervals and demands should be vectors of equal size. | |
| Constraint * | MakeCover (const std::vector< IntervalVar * > &vars, IntervalVar *target_var) |
| Constraint * | MakeEquality (IntervalVar *var1, IntervalVar *var2) |
| This constraints states that the two interval variables are equal. | |
| Assignment * | MakeAssignment () |
| This method creates an empty assignment. | |
| Assignment * | MakeAssignment (const Assignment *a) |
| This method creates an assignment which is a copy of 'a'. | |
| SolutionCollector * | MakeFirstSolutionCollector (const Assignment *assignment) |
| Collect the first solution of the search. | |
| SolutionCollector * | MakeFirstSolutionCollector () |
| SolutionCollector * | MakeLastSolutionCollector (const Assignment *assignment) |
| Collect the last solution of the search. | |
| SolutionCollector * | MakeLastSolutionCollector () |
| SolutionCollector * | MakeBestValueSolutionCollector (const Assignment *assignment, bool maximize) |
| SolutionCollector * | MakeBestLexicographicValueSolutionCollector (const Assignment *assignment, std::vector< bool > maximize) |
| SolutionCollector * | MakeBestValueSolutionCollector (bool maximize) |
| SolutionCollector * | MakeBestLexicographicValueSolutionCollector (std::vector< bool > maximize) |
| SolutionCollector * | MakeNBestValueSolutionCollector (const Assignment *assignment, int solution_count, bool maximize) |
| SolutionCollector * | MakeNBestValueSolutionCollector (int solution_count, bool maximize) |
| SolutionCollector * | MakeNBestLexicographicValueSolutionCollector (const Assignment *assignment, int solution_count, std::vector< bool > maximize) |
| SolutionCollector * | MakeNBestLexicographicValueSolutionCollector (int solution_count, std::vector< bool > maximize) |
| SolutionCollector * | MakeAllSolutionCollector (const Assignment *assignment) |
| Collect all solutions of the search. | |
| SolutionCollector * | MakeAllSolutionCollector () |
| OptimizeVar * | MakeMinimize (IntVar *v, int64_t step) |
| Creates a minimization objective. | |
| OptimizeVar * | MakeMaximize (IntVar *v, int64_t step) |
| Creates a maximization objective. | |
| OptimizeVar * | MakeOptimize (bool maximize, IntVar *v, int64_t step) |
| Creates a objective with a given sense (true = maximization). | |
| OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &sub_objectives, const std::vector< int64_t > &weights, int64_t step) |
| OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &sub_objectives, const std::vector< int > &weights, int64_t step) |
| OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &sub_objectives, const std::vector< int64_t > &weights, int64_t step) |
| Creates a maximization weigthed objective. | |
| OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &sub_objectives, const std::vector< int > &weights, int64_t step) |
| Creates a maximization weigthed objective. | |
| OptimizeVar * | MakeWeightedOptimize (bool maximize, const std::vector< IntVar * > &sub_objectives, const std::vector< int64_t > &weights, int64_t step) |
| Creates a weighted objective with a given sense (true = maximization). | |
| OptimizeVar * | MakeWeightedOptimize (bool maximize, const std::vector< IntVar * > &sub_objectives, const std::vector< int > &weights, int64_t step) |
| Creates a weighted objective with a given sense (true = maximization). | |
| OptimizeVar * | MakeLexicographicOptimize (std::vector< bool > maximize, std::vector< IntVar * > variables, std::vector< int64_t > steps) |
| ObjectiveMonitor * | MakeTabuSearch (bool maximize, IntVar *objective, int64_t step, const std::vector< IntVar * > &vars, int64_t keep_tenure, int64_t forbid_tenure, double tabu_factor) |
| MetaHeuristics which try to get the search out of local optima. | |
| ObjectiveMonitor * | MakeLexicographicTabuSearch (const std::vector< bool > &maximize, std::vector< IntVar * > objectives, std::vector< int64_t > steps, const std::vector< IntVar * > &vars, int64_t keep_tenure, int64_t forbid_tenure, double tabu_factor) |
| ObjectiveMonitor * | MakeGenericTabuSearch (bool maximize, IntVar *v, int64_t step, const std::vector< IntVar * > &tabu_vars, int64_t forbid_tenure) |
| ObjectiveMonitor * | MakeSimulatedAnnealing (bool maximize, IntVar *v, int64_t step, int64_t initial_temperature) |
| Creates a Simulated Annealing monitor. | |
| ObjectiveMonitor * | MakeLexicographicSimulatedAnnealing (const std::vector< bool > &maximize, std::vector< IntVar * > vars, std::vector< int64_t > steps, std::vector< int64_t > initial_temperatures) |
| ObjectiveMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *objective, IndexEvaluator2 objective_function, int64_t step, const std::vector< IntVar * > &vars, double penalty_factor, std::function< std::vector< std::pair< int64_t, int64_t > >(int64_t, int64_t)> get_equivalent_pairs=nullptr, bool reset_penalties_on_new_best_solution=false) |
| ObjectiveMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *objective, IndexEvaluator3 objective_function, int64_t step, const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, double penalty_factor, std::function< std::vector< std::pair< int64_t, int64_t > >(int64_t, int64_t)> get_equivalent_pairs=nullptr, bool reset_penalties_on_new_best_solution=false) |
| BaseObjectiveMonitor * | MakeRoundRobinCompoundObjectiveMonitor (std::vector< BaseObjectiveMonitor * > monitors, int num_max_local_optima_before_metaheuristic_switch) |
| SearchMonitor * | MakeLubyRestart (int scale_factor) |
| SearchMonitor * | MakeConstantRestart (int frequency) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeTimeLimit (absl::Duration time) |
| Creates a search limit that constrains the running time. | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeTimeLimit (int64_t time_in_ms) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeBranchesLimit (int64_t branches) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeFailuresLimit (int64_t failures) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeSolutionsLimit (int64_t solutions) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeLimit (absl::Duration time, int64_t branches, int64_t failures, int64_t solutions, bool smart_time_check=false, bool cumulative=false) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeLimit (const RegularLimitParameters &proto) |
| Creates a search limit from its protobuf description. | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeLimit (int64_t time, int64_t branches, int64_t failures, int64_t solutions, bool smart_time_check=false, bool cumulative=false) |
| RegularLimitParameters | MakeDefaultRegularLimitParameters () const |
| Creates a regular limit proto containing default values. | |
| ABSL_MUST_USE_RESULT SearchLimit * | MakeLimit (SearchLimit *limit_1, SearchLimit *limit_2) |
| ABSL_MUST_USE_RESULT ImprovementSearchLimit * | MakeImprovementLimit (IntVar *objective_var, bool maximize, double objective_scaling_factor, double objective_offset, double improvement_rate_coefficient, int improvement_rate_solutions_distance) |
| ABSL_MUST_USE_RESULT ImprovementSearchLimit * | MakeLexicographicImprovementLimit (std::vector< IntVar * > objective_vars, std::vector< bool > maximize, std::vector< double > objective_scaling_factors, std::vector< double > objective_offsets, double improvement_rate_coefficient, int improvement_rate_solutions_distance) |
| ABSL_MUST_USE_RESULT SearchLimit * | MakeCustomLimit (std::function< bool()> limiter) |
| SearchMonitor * | MakeSearchLog (int branch_period) |
| SearchMonitor * | MakeSearchLog (int branch_period, IntVar *var) |
| At each solution, this monitor also display the var value. | |
| SearchMonitor * | MakeSearchLog (int branch_period, std::function< std::string()> display_callback) |
| SearchMonitor * | MakeSearchLog (int branch_period, IntVar *var, std::function< std::string()> display_callback) |
| SearchMonitor * | MakeSearchLog (int branch_period, std::vector< IntVar * > vars, std::function< std::string()> display_callback) |
| SearchMonitor * | MakeSearchLog (int branch_period, OptimizeVar *opt_var) |
| SearchMonitor * | MakeSearchLog (int branch_period, OptimizeVar *opt_var, std::function< std::string()> display_callback) |
| SearchMonitor * | MakeSearchLog (SearchLogParameters parameters) |
| SearchMonitor * | MakeSearchTrace (const std::string &prefix) |
| SearchMonitor * | MakeEnterSearchCallback (std::function< void()> callback) |
| --— Callback-based search monitors --— | |
| SearchMonitor * | MakeExitSearchCallback (std::function< void()> callback) |
| SearchMonitor * | MakeAtSolutionCallback (std::function< void()> callback) |
| ModelVisitor * | MakePrintModelVisitor () |
| Prints the model. | |
| ModelVisitor * | MakeStatisticsModelVisitor () |
| Displays some nice statistics on the model. | |
| ModelVisitor * | MakeVariableDegreeVisitor (absl::flat_hash_map< const IntVar *, int > *map) |
| Compute the number of constraints a variable is attached to. | |
| SearchMonitor * | MakeSymmetryManager (const std::vector< SymmetryBreaker * > &visitors) |
| Symmetry Breaking. | |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *v1) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *v1, SymmetryBreaker *v2) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *v1, SymmetryBreaker *v2, SymmetryBreaker *v3) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *v1, SymmetryBreaker *v2, SymmetryBreaker *v3, SymmetryBreaker *v4) |
| Decision * | MakeAssignVariableValue (IntVar *var, int64_t val) |
| Decisions. | |
| Decision * | MakeVariableLessOrEqualValue (IntVar *var, int64_t value) |
| Decision * | MakeVariableGreaterOrEqualValue (IntVar *var, int64_t value) |
| Decision * | MakeSplitVariableDomain (IntVar *var, int64_t val, bool start_with_lower_half) |
| Decision * | MakeAssignVariableValueOrFail (IntVar *var, int64_t value) |
| Decision * | MakeAssignVariableValueOrDoNothing (IntVar *var, int64_t value) |
| Decision * | MakeAssignVariablesValues (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values) |
| Decision * | MakeAssignVariablesValuesOrDoNothing (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values) |
| Decision * | MakeAssignVariablesValuesOrFail (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values) |
| Decision * | MakeFailDecision () |
| Decision * | MakeDecision (Action apply, Action refute) |
| DecisionBuilder * | Compose (DecisionBuilder *db1, DecisionBuilder *db2) |
| DecisionBuilder * | Compose (DecisionBuilder *db1, DecisionBuilder *db2, DecisionBuilder *db3) |
| DecisionBuilder * | Compose (DecisionBuilder *db1, DecisionBuilder *db2, DecisionBuilder *db3, DecisionBuilder *db4) |
| DecisionBuilder * | Compose (const std::vector< DecisionBuilder * > &dbs) |
| DecisionBuilder * | Try (DecisionBuilder *db1, DecisionBuilder *db2) |
| DecisionBuilder * | Try (DecisionBuilder *db1, DecisionBuilder *db2, DecisionBuilder *db3) |
| DecisionBuilder * | Try (DecisionBuilder *db1, DecisionBuilder *db2, DecisionBuilder *db3, DecisionBuilder *db4) |
| DecisionBuilder * | Try (const std::vector< DecisionBuilder * > &dbs) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IntValueStrategy val_str) |
| Phases on IntVar arrays. | |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 var_evaluator, IntValueStrategy val_str) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IndexEvaluator2 value_evaluator) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, VariableValueComparator var_val1_val2_comparator) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 var_evaluator, IndexEvaluator2 value_evaluator) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IndexEvaluator2 value_evaluator, IndexEvaluator1 tie_breaker) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 var_evaluator, IndexEvaluator2 value_evaluator, IndexEvaluator1 tie_breaker) |
| DecisionBuilder * | MakeDefaultPhase (const std::vector< IntVar * > &vars) |
| DecisionBuilder * | MakeDefaultPhase (const std::vector< IntVar * > &vars, const DefaultPhaseParameters ¶meters) |
| DecisionBuilder * | MakePhase (IntVar *v0, IntVarStrategy var_str, IntValueStrategy val_str) |
| Shortcuts for small arrays. | |
| DecisionBuilder * | MakePhase (IntVar *v0, IntVar *v1, IntVarStrategy var_str, IntValueStrategy val_str) |
| DecisionBuilder * | MakePhase (IntVar *v0, IntVar *v1, IntVar *v2, IntVarStrategy var_str, IntValueStrategy val_str) |
| DecisionBuilder * | MakePhase (IntVar *v0, IntVar *v1, IntVar *v2, IntVar *v3, IntVarStrategy var_str, IntValueStrategy val_str) |
| Decision * | MakeScheduleOrPostpone (IntervalVar *var, int64_t est, int64_t *marker) |
| Decision * | MakeScheduleOrExpedite (IntervalVar *var, int64_t est, int64_t *marker) |
| Decision * | MakeRankFirstInterval (SequenceVar *sequence, int index) |
| Decision * | MakeRankLastInterval (SequenceVar *sequence, int index) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 eval, EvaluatorStrategy str) |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 eval, IndexEvaluator1 tie_breaker, EvaluatorStrategy str) |
| DecisionBuilder * | MakePhase (const std::vector< IntervalVar * > &intervals, IntervalStrategy str) |
| Scheduling phases. | |
| DecisionBuilder * | MakePhase (const std::vector< SequenceVar * > &sequences, SequenceStrategy str) |
| DecisionBuilder * | MakeDecisionBuilderFromAssignment (Assignment *assignment, DecisionBuilder *db, const std::vector< IntVar * > &vars) |
| DecisionBuilder * | MakeConstraintAdder (Constraint *ct) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db, SearchMonitor *monitor1) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db, SearchMonitor *monitor1, SearchMonitor *monitor2) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db, SearchMonitor *monitor1, SearchMonitor *monitor2, SearchMonitor *monitor3) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db, SearchMonitor *monitor1, SearchMonitor *monitor2, SearchMonitor *monitor3, SearchMonitor *monitor4) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *db, const std::vector< SearchMonitor * > &monitors) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step, SearchMonitor *monitor1) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step, SearchMonitor *monitor1, SearchMonitor *monitor2) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step, SearchMonitor *monitor1, SearchMonitor *monitor2, SearchMonitor *monitor3) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step, SearchMonitor *monitor1, SearchMonitor *monitor2, SearchMonitor *monitor3, SearchMonitor *monitor4) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *db, Assignment *solution, bool maximize, int64_t step, const std::vector< SearchMonitor * > &monitors) |
| DecisionBuilder * | MakeRestoreAssignment (Assignment *assignment) |
| DecisionBuilder * | MakeStoreAssignment (Assignment *assignment) |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, LocalSearchOperators op, std::function< const std::vector< int > &(int, int)> get_incoming_neighbors=nullptr, std::function< const std::vector< int > &(int, int)> get_outgoing_neighbors=nullptr) |
| Local Search Operators. | |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, LocalSearchOperators op, std::function< const std::vector< int > &(int, int)> get_incoming_neighbors=nullptr, std::function< const std::vector< int > &(int, int)> get_outgoing_neighbors=nullptr) |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, IndexEvaluator3 evaluator, EvaluatorLocalSearchOperators op) |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, IndexEvaluator3 evaluator, EvaluatorLocalSearchOperators op) |
| LocalSearchOperator * | MakeRandomLnsOperator (const std::vector< IntVar * > &vars, int number_of_variables) |
| LocalSearchOperator * | MakeRandomLnsOperator (const std::vector< IntVar * > &vars, int number_of_variables, int32_t seed) |
| LocalSearchOperator * | MakeMoveTowardTargetOperator (const Assignment &target) |
| LocalSearchOperator * | MakeMoveTowardTargetOperator (const std::vector< IntVar * > &variables, const std::vector< int64_t > &target_values) |
| LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops) |
| Example: | |
| LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, bool restart) |
| LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, std::function< int64_t(int, int)> evaluator) |
| LocalSearchOperator * | RandomConcatenateOperators (const std::vector< LocalSearchOperator * > &ops) |
| LocalSearchOperator * | RandomConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, int32_t seed) |
| LocalSearchOperator * | MultiArmedBanditConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, double memory_coefficient, double exploration_coefficient, bool maximize) |
| LocalSearchOperator * | MakeNeighborhoodLimit (LocalSearchOperator *op, int64_t limit) |
| DecisionBuilder * | MakeLocalSearchPhase (Assignment *assignment, LocalSearchPhaseParameters *parameters) |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< IntVar * > &vars, DecisionBuilder *first_solution, LocalSearchPhaseParameters *parameters) |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< IntVar * > &vars, DecisionBuilder *first_solution, DecisionBuilder *first_solution_sub_decision_builder, LocalSearchPhaseParameters *parameters) |
| Variant with a sub_decison_builder specific to the first solution. | |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< SequenceVar * > &vars, DecisionBuilder *first_solution, LocalSearchPhaseParameters *parameters) |
| Assignment * | RunUncheckedLocalSearch (const Assignment *initial_solution, LocalSearchFilterManager *filter_manager, LocalSearchOperator *ls_operator, const std::vector< SearchMonitor * > &monitors, RegularLimit *limit, absl::flat_hash_set< IntVar * > *touched=nullptr) |
| SolutionPool * | MakeDefaultSolutionPool () |
| Solution Pool. | |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder) |
| Local Search Phase Parameters. | |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder, RegularLimit *limit) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder, RegularLimit *limit, LocalSearchFilterManager *filter_manager) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *pool, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *pool, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder, RegularLimit *limit) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *pool, LocalSearchOperator *ls_operator, DecisionBuilder *sub_decision_builder, RegularLimit *limit, LocalSearchFilterManager *filter_manager) |
| LocalSearchFilter * | MakeAcceptFilter () |
| Local Search Filters. | |
| LocalSearchFilter * | MakeRejectFilter () |
| LocalSearchFilter * | MakeVariableDomainFilter () |
| IntVarLocalSearchFilter * | MakeSumObjectiveFilter (const std::vector< IntVar * > &vars, IndexEvaluator2 values, Solver::LocalSearchFilterBound filter_enum) |
| IntVarLocalSearchFilter * | MakeSumObjectiveFilter (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, IndexEvaluator3 values, Solver::LocalSearchFilterBound filter_enum) |
| void | TopPeriodicCheck () |
| int | TopProgressPercent () |
| void | PushState () |
| void | PopState () |
| int | SearchDepth () const |
| int | SearchLeftDepth () const |
| int | SolveDepth () const |
| void | SetBranchSelector (BranchSelector bs) |
| Sets the given branch selector on the current active search. | |
| DecisionBuilder * | MakeApplyBranchSelector (BranchSelector bs) |
| Creates a decision builder that will set the branch selector. | |
| template<class T> | |
| void | SaveAndSetValue (T *adr, T val) |
| All-in-one SaveAndSetValue. | |
| template<class T> | |
| void | SaveAndAdd (T *adr, T val) |
| All-in-one SaveAndAdd_value. | |
| int64_t | Rand64 (int64_t size) |
| Returns a random value between 0 and 'size' - 1;. | |
| int32_t | Rand32 (int32_t size) |
| Returns a random value between 0 and 'size' - 1;. | |
| void | ReSeed (int32_t seed) |
| Reseed the solver random generator. | |
| void | ExportProfilingOverview (const std::string &filename) |
| std::string | LocalSearchProfile () const |
| Returns local search profiling information in a human readable format. | |
| ConstraintSolverStatistics | GetConstraintSolverStatistics () const |
| Returns detailed cp search statistics. | |
| LocalSearchStatistics | GetLocalSearchStatistics () const |
| Returns detailed local search statistics. | |
| bool | CurrentlyInSolve () const |
| int | constraints () const |
| void | Accept (ModelVisitor *visitor) const |
| Accepts the given model visitor. | |
| Decision * | balancing_decision () const |
| void | set_fail_intercept (std::function< void()> fail_intercept) |
| Internal. | |
| void | clear_fail_intercept () |
| DemonProfiler * | demon_profiler () const |
| Access to demon profiler. | |
| void | SetUseFastLocalSearch (bool use_fast_local_search) |
| bool | UseFastLocalSearch () const |
| Returns true if fast local search is enabled. | |
| bool | HasName (const PropagationBaseObject *object) const |
| Returns whether the object has been named or not. | |
| Demon * | RegisterDemon (Demon *demon) |
| Adds a new demon and wraps it inside a DemonProfiler if necessary. | |
| IntExpr * | RegisterIntExpr (IntExpr *expr) |
| Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary. | |
| IntVar * | RegisterIntVar (IntVar *var) |
| Registers a new IntVar and wraps it inside a TraceIntVar if necessary. | |
| IntervalVar * | RegisterIntervalVar (IntervalVar *var) |
| Search * | ActiveSearch () const |
| Returns the active search, nullptr outside search. | |
| ModelCache * | Cache () const |
| Returns the cache of the model. | |
| bool | InstrumentsDemons () const |
| Returns whether we are instrumenting demons. | |
| bool | IsProfilingEnabled () const |
| Returns whether we are profiling the solver. | |
| bool | IsLocalSearchProfilingEnabled () const |
| Returns whether we are profiling local search. | |
| bool | InstrumentsVariables () const |
| Returns whether we are tracing variables. | |
| bool | NameAllVariables () const |
| Returns whether all variables should be named. | |
| std::string | model_name () const |
| Returns the name of the model. | |
| PropagationMonitor * | GetPropagationMonitor () const |
| Returns the propagation monitor. | |
| void | AddPropagationMonitor (PropagationMonitor *monitor) |
| LocalSearchMonitor * | GetLocalSearchMonitor () const |
| Returns the local search monitor. | |
| void | AddLocalSearchMonitor (LocalSearchMonitor *monitor) |
| void | SetSearchContext (Search *search, absl::string_view search_context) |
| std::string | SearchContext () const |
| std::string | SearchContext (const Search *search) const |
| bool | AcceptSolution (Search *search) const |
| Assignment * | GetOrCreateLocalSearchState () |
| Returns (or creates) an assignment representing the state of local search. | |
| void | ClearLocalSearchState () |
| Clears the local search state. | |
| bool | IsBooleanVar (IntExpr *expr, IntVar **inner_var, bool *is_negated) const |
| bool | IsProduct (IntExpr *expr, IntExpr **inner_expr, int64_t *coefficient) |
| IntExpr * | CastExpression (const IntVar *var) const |
| !defined(SWIG) | |
| void | FinishCurrentSearch () |
| Tells the solver to kill or restart the current search. | |
| void | RestartCurrentSearch () |
| void | ShouldFail () |
| void | CheckFail () |
| DecisionBuilder * | MakeProfiledDecisionBuilderWrapper (DecisionBuilder *db) |
| Activates profiling on a decision builder. | |
| bool | Solve (DecisionBuilder *db, const std::vector< SearchMonitor * > &monitors) |
| bool | Solve (DecisionBuilder *db) |
| bool | Solve (DecisionBuilder *db, SearchMonitor *m1) |
| bool | Solve (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2) |
| bool | Solve (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2, SearchMonitor *m3) |
| bool | Solve (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2, SearchMonitor *m3, SearchMonitor *m4) |
| void | NewSearch (DecisionBuilder *db, const std::vector< SearchMonitor * > &monitors) |
| void | NewSearch (DecisionBuilder *db) |
| void | NewSearch (DecisionBuilder *db, SearchMonitor *m1) |
| void | NewSearch (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2) |
| void | NewSearch (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2, SearchMonitor *m3) |
| void | NewSearch (DecisionBuilder *db, SearchMonitor *m1, SearchMonitor *m2, SearchMonitor *m3, SearchMonitor *m4) |
| bool | NextSolution () |
| void | RestartSearch () |
| void | EndSearch () |
Public Attributes | |
| std::vector< int64_t > | tmp_vector_ |
Static Public Attributes | |
| static constexpr int | kNumPriorities = 3 |
| Number of priorities for demons. | |
Friends | |
| class | BaseIntExpr |
| class | Constraint |
| class | DemonProfiler |
| class | FindOneNeighbor |
| class | IntVar |
| class | PropagationBaseObject |
| class | Queue |
| class | SearchMonitor |
| class | SearchLimit |
| class | RoutingModel |
| class | LocalSearch |
| class | LocalSearchProfiler |
| template<class> | |
| class | SimpleRevFIFO |
| template<class K, class V> | |
| class | RevImmutableMultiMap |
| void | InternalSaveBooleanVarValue (Solver *solver, IntVar *var) |
◆ Action
typedef std::function<void(Solver*)> operations_research::Solver::Action
◆ BranchSelector
◆ Closure
typedef std::function<void()> operations_research::Solver::Closure
◆ IndexEvaluator1
typedef std::function<int64_t(int64_t)> operations_research::Solver::IndexEvaluator1
◆ IndexEvaluator2
typedef std::function<int64_t(int64_t, int64_t)> operations_research::Solver::IndexEvaluator2
◆ IndexEvaluator3
typedef std::function<int64_t(int64_t, int64_t, int64_t)> operations_research::Solver::IndexEvaluator3
◆ IndexFilter1
typedef std::function<bool(int64_t)> operations_research::Solver::IndexFilter1
◆ Int64ToIntVar
typedef std::function<IntVar*(int64_t)> operations_research::Solver::Int64ToIntVar
◆ VariableIndexSelector
typedef std::function<int64_t(Solver* solver, const std::vector<IntVar*>& vars, int64_t first_unbound, int64_t last_unbound)> operations_research::Solver::VariableIndexSelector
◆ VariableValueComparator
typedef std::function<bool(int64_t, int64_t, int64_t)> operations_research::Solver::VariableValueComparator
◆ VariableValueSelector
typedef std::function<int64_t(const IntVar* v, int64_t id)> operations_research::Solver::VariableValueSelector
◆ BinaryIntervalRelation
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2.
Definition at line 660 of file constraint_solver.h.
◆ DecisionModification
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.
Definition at line 728 of file constraint_solver.h.
◆ DemonPriority
This enum represents the three possible priorities for a demon in the Solver queue.
- Note
- this is for advanced users only.
Definition at line 646 of file constraint_solver.h.
◆ EvaluatorLocalSearchOperators
This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create.
Definition at line 605 of file constraint_solver.h.
◆ EvaluatorStrategy
This enum is used by Solver::MakePhase to specify how to select variables and values during the search. In Solver::MakePhase(const std::vector<IntVar*>&, IntVarStrategy, IntValueStrategy), variables are selected first, and then the associated value. In Solver::MakePhase(const std::vector<IntVar*>& vars, IndexEvaluator2, EvaluatorStrategy), the selection is done scanning every pair <variable, possible value>. 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.
Definition at line 401 of file constraint_solver.h.
◆ IntervalStrategy
This enum describes the straregy used to select the next interval variable and its value to be fixed.
Definition at line 425 of file constraint_solver.h.
◆ IntValueStrategy
This enum describes the strategy used to select the next variable value to set.
Definition at line 361 of file constraint_solver.h.
◆ IntVarStrategy
This enum describes the strategy used to select the next branching variable at each node during the search.
Definition at line 280 of file constraint_solver.h.
◆ LocalSearchFilterBound
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.
Definition at line 633 of file constraint_solver.h.
◆ LocalSearchOperators
This enum is used in Solver::MakeOperator to specify the neighborhood to create.
| Enumerator | |
|---|---|
| TWOOPT | 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 |
| OROPT | 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). |
| RELOCATE | Relocate neighborhood with length of 1 (see OROPT comment). |
| EXCHANGE | 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 |
| CROSS | 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 |
| MAKEACTIVE | 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 |
| MAKEINACTIVE | 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 |
| MAKECHAININACTIVE | 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 |
| SWAPACTIVE | 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 |
| SWAPACTIVECHAIN | Operator which replaces a chain of active nodes 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 1 -> [5] -> 4 with 2 and 3 inactive |
| EXTENDEDSWAPACTIVE | 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 |
| PATHLNS | 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.
|
| FULLPATHLNS | Operator which relaxes one entire path and all inactive nodes, thus defining num_paths neighbors. |
| UNACTIVELNS | 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. |
| INCREMENT | 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. |
| DECREMENT | Operator which defines a neighborhood to decrement values. The behavior is the same as INCREMENT, except values are decremented instead of incremented. |
| SIMPLELNS | 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. |
Definition at line 440 of file constraint_solver.h.
◆ MarkerType
This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree.
| Enumerator | |
|---|---|
| SENTINEL | |
| SIMPLE_MARKER | |
| CHOICE_POINT | |
| REVERSIBLE_ACTION | |
Definition at line 754 of file constraint_solver.h.
◆ MonitorEvent
Search monitor events.
Definition at line 777 of file constraint_solver.h.
◆ OptimizationDirection
Optimization directions.
| Enumerator | |
|---|---|
| NOT_SET | |
| MAXIMIZATION | |
| MINIMIZATION | |
Definition at line 773 of file constraint_solver.h.
◆ SequenceStrategy
Used for scheduling. Not yet implemented.
| Enumerator | |
|---|---|
| SEQUENCE_DEFAULT | |
| SEQUENCE_SIMPLE | |
| CHOOSE_MIN_SLACK_RANK_FORWARD | |
| CHOOSE_RANDOM_RANK_FORWARD | |
Definition at line 416 of file constraint_solver.h.
◆ SolverState
This enum represents the state of the solver w.r.t. the search.
Definition at line 757 of file constraint_solver.h.
◆ UnaryIntervalRelation
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d.
Definition at line 693 of file constraint_solver.h.
◆ Solver() [1/3]
|
explicit |
◆ Solver() [2/3]
◆ Solver() [3/3]
|
delete |
| operations_research::Solver::~Solver | ( | ) |
◆ Accept()
| void operations_research::Solver::Accept | ( | ModelVisitor * | visitor | ) | const |
◆ accepted_neighbors()
|
inline |
◆ AcceptSolution()
| bool operations_research::Solver::AcceptSolution | ( | Search * | search | ) | const |
◆ ActiveSearch()
| Search * operations_research::Solver::ActiveSearch | ( | ) | const |
◆ AddBacktrackAction()
| void operations_research::Solver::AddBacktrackAction | ( | Action | a, |
| bool | fast ) |
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.
Definition at line 1622 of file constraint_solver.cc.
◆ AddCastConstraint()
| void operations_research::Solver::AddCastConstraint | ( | CastConstraint * | constraint, |
| IntVar * | target_var, | ||
| IntExpr * | expr ) |
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.
Definition at line 1714 of file constraint_solver.cc.
◆ AddConstraint()
| void operations_research::Solver::AddConstraint | ( | Constraint * | c | ) |
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(...));
Definition at line 1690 of file constraint_solver.cc.
◆ AddLocalSearchMonitor()
Adds the local search monitor to the solver. This is called internally when a propagation monitor is passed to the Solve() or NewSearch() method.
Definition at line 3232 of file constraint_solver.cc.
◆ AddPropagationMonitor()
Adds the propagation monitor to the solver. This is called internally when a propagation monitor is passed to the Solve() or NewSearch() method.
Definition at line 3154 of file constraint_solver.cc.
◆ balancing_decision()
|
inline |
◆ branches()
|
inline |
The number of branches explored since the creation of the solver.
Definition at line 1074 of file constraint_solver.h.
◆ Cache()
| ModelCache * operations_research::Solver::Cache | ( | ) | const |
◆ CastExpression()
!defined(SWIG)
Internal. If the variables is the result of expr->Var(), this method returns expr, nullptr otherwise.
Definition at line 2427 of file constraint_solver.cc.
◆ CheckAssignment()
| bool operations_research::Solver::CheckAssignment | ( | Assignment * | solution | ) |
Checks whether the given assignment satisfies all relevant constraints.
Definition at line 2293 of file constraint_solver.cc.
◆ CheckConstraint()
| bool operations_research::Solver::CheckConstraint | ( | Constraint * | ct | ) |
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.
Definition at line 2372 of file constraint_solver.cc.
◆ CheckFail()
|
inline |
◆ clear_fail_intercept()
|
inline |
◆ ClearLocalSearchState()
|
inline |
◆ ClearNeighbors()
|
inline |
Manipulate neighbors count; to be used for testing purposes only.
- Todo
- (user): Find a workaround to avoid exposing this.
Definition at line 1093 of file constraint_solver.h.
◆ Compose() [1/4]
◆ Compose() [2/4]
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 |
◆ Compose() [3/4]
◆ Compose() [4/4]
◆ ConcatenateOperators() [1/3]
Example:
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. 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].
Definition at line 2072 of file local_search.cc.
◆ ConcatenateOperators() [2/3]
◆ ConcatenateOperators() [3/3]
◆ const_parameters()
◆ constraints()
|
inline |
Counts the number of constraints that have been added to the solver before the search.
Definition at line 3145 of file constraint_solver.h.
◆ context()
|
inline |
◆ CurrentlyInSolve()
| bool operations_research::Solver::CurrentlyInSolve | ( | ) | const |
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.
Definition at line 1779 of file constraint_solver.cc.
◆ DebugString()
| std::string operations_research::Solver::DebugString | ( | ) | const |
◆ DefaultSolverParameters()
◆ demon_profiler()
|
inline |
◆ demon_runs()
|
inline |
The number of demons executed during search for a given priority.
Definition at line 1083 of file constraint_solver.h.
◆ EndSearch()
| void operations_research::Solver::EndSearch | ( | ) |
◆ ExportProfilingOverview()
| void operations_research::Solver::ExportProfilingOverview | ( | const std::string & | filename | ) |
Exports the profiling information in a human readable overview. The parameter profile_level used to create the solver must be set to true.
Definition at line 435 of file demon_profiler.cc.
◆ Fail()
| void operations_research::Solver::Fail | ( | ) |
Abandon the current branch in the search tree. A backtrack will follow.
Definition at line 2406 of file constraint_solver.cc.
◆ fail_stamp()
| uint64_t operations_research::Solver::fail_stamp | ( | ) | const |
◆ failures()
|
inline |
The number of failures encountered since the creation of the solver.
Definition at line 1086 of file constraint_solver.h.
◆ filtered_neighbors()
|
inline |
The number of filtered neighbors (neighbors accepted by filters).
Definition at line 1097 of file constraint_solver.h.
◆ FinishCurrentSearch()
| void operations_research::Solver::FinishCurrentSearch | ( | ) |
◆ GetConstraintSolverStatistics()
◆ GetGuidedLocalSearchPenalty()
|
inline |
◆ GetLocalSearchMonitor()
◆ GetLocalSearchStatistics()
◆ GetOrCreateLocalSearchState()
| Assignment * operations_research::Solver::GetOrCreateLocalSearchState | ( | ) |
Returns (or creates) an assignment representing the state of local search.
Definition at line 3259 of file constraint_solver.cc.
◆ GetPropagationMonitor()
◆ HasName()
| bool operations_research::Solver::HasName | ( | const PropagationBaseObject * | object | ) | const |
◆ IncrementNeighbors()
|
inline |
◆ InstrumentsDemons()
| bool operations_research::Solver::InstrumentsDemons | ( | ) | const |
◆ InstrumentsVariables()
| bool operations_research::Solver::InstrumentsVariables | ( | ) | const |
◆ IsBooleanVar()
| bool operations_research::Solver::IsBooleanVar | ( | IntExpr * | expr, |
| IntVar ** | inner_var, | ||
| bool * | is_negated ) const |
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).
Definition at line 7499 of file expressions.cc.
◆ IsLocalSearchProfilingEnabled()
| bool operations_research::Solver::IsLocalSearchProfilingEnabled | ( | ) | const |
◆ IsProduct()
| bool operations_research::Solver::IsProduct | ( | IntExpr * | expr, |
| IntExpr ** | inner_expr, | ||
| int64_t * | coefficient ) |
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.
Definition at line 7517 of file expressions.cc.
◆ IsProfilingEnabled()
| bool operations_research::Solver::IsProfilingEnabled | ( | ) | const |
◆ LocalSearchProfile()
| std::string operations_research::Solver::LocalSearchProfile | ( | ) | const |
Returns local search profiling information in a human readable format.
Definition at line 3759 of file local_search.cc.
◆ MakeAbs()
◆ MakeAbsEquality()
| Constraint * operations_research::Solver::MakeAbsEquality | ( | IntVar * | var, |
| IntVar * | abs_var ) |
Creates the constraint abs(var) == abs_var.
Definition at line 7036 of file expressions.cc.
◆ MakeAcceptFilter()
◆ MakeActionDemon()
| Demon * operations_research::Solver::MakeActionDemon | ( | Solver::Action | action | ) |
◆ MakeAllDifferent() [1/2]
| Constraint * operations_research::Solver::MakeAllDifferent | ( | const std::vector< IntVar * > & | vars | ) |
All variables are pairwise different. This corresponds to the stronger version of the propagation algorithm.
Definition at line 692 of file alldiff_cst.cc.
◆ MakeAllDifferent() [2/2]
| Constraint * operations_research::Solver::MakeAllDifferent | ( | const std::vector< IntVar * > & | vars, |
| bool | stronger_propagation ) |
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.
Definition at line 696 of file alldiff_cst.cc.
◆ MakeAllDifferentExcept()
| Constraint * operations_research::Solver::MakeAllDifferentExcept | ( | const std::vector< IntVar * > & | vars, |
| int64_t | escape_value ) |
All variables are pairwise different, unless they are assigned to the escape value.
Definition at line 722 of file alldiff_cst.cc.
◆ MakeAllowedAssignments()
| Constraint * operations_research::Solver::MakeAllowedAssignments | ( | const std::vector< IntVar * > & | vars, |
| const IntTupleSet & | tuples ) |
◆ MakeAllSolutionCollector() [1/2]
Collect all solutions of the search. The variables will need to be added later.
◆ MakeAllSolutionCollector() [2/2]
◆ MakeApplyBranchSelector()
◆ MakeAssignment() [1/2]
| Assignment * operations_research::Solver::MakeAssignment | ( | ) |
This method creates an empty assignment.
Definition at line 969 of file assignment.cc.
◆ MakeAssignment() [2/2]
This method creates an assignment which is a copy of 'a'.
Definition at line 971 of file assignment.cc.
◆ MakeAssignVariablesValues()
| Decision * operations_research::Solver::MakeAssignVariablesValues | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | values ) |
◆ MakeAssignVariablesValuesOrDoNothing()
| Decision * operations_research::Solver::MakeAssignVariablesValuesOrDoNothing | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | values ) |
◆ MakeAssignVariablesValuesOrFail()
| Decision * operations_research::Solver::MakeAssignVariablesValuesOrFail | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | values ) |
◆ MakeAssignVariableValue()
◆ MakeAssignVariableValueOrDoNothing()
| Decision * operations_research::Solver::MakeAssignVariableValueOrDoNothing | ( | IntVar * | var, |
| int64_t | value ) |
◆ MakeAssignVariableValueOrFail()
| Decision * operations_research::Solver::MakeAssignVariableValueOrFail | ( | IntVar * | var, |
| int64_t | value ) |
◆ MakeAtMost()
| Constraint * operations_research::Solver::MakeAtMost | ( | std::vector< IntVar * > | vars, |
| int64_t | value, | ||
| int64_t | max_count ) |
|{i | vars[i] == value}| <= max_count
Definition at line 956 of file count_cst.cc.
◆ MakeAtSolutionCallback()
| SearchMonitor * operations_research::Solver::MakeAtSolutionCallback | ( | std::function< void()> | callback | ) |
◆ MakeBestLexicographicValueSolutionCollector() [1/2]
| SolutionCollector * operations_research::Solver::MakeBestLexicographicValueSolutionCollector | ( | const Assignment * | assignment, |
| std::vector< bool > | maximize ) |
◆ MakeBestLexicographicValueSolutionCollector() [2/2]
| SolutionCollector * operations_research::Solver::MakeBestLexicographicValueSolutionCollector | ( | std::vector< bool > | maximize | ) |
◆ MakeBestValueSolutionCollector() [1/2]
| SolutionCollector * operations_research::Solver::MakeBestValueSolutionCollector | ( | bool | maximize | ) |
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.
◆ MakeBestValueSolutionCollector() [2/2]
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).
◆ MakeBetweenCt()
| Constraint * operations_research::Solver::MakeBetweenCt | ( | IntExpr * | expr, |
| int64_t | l, | ||
| int64_t | u ) |
◆ MakeBoolVar() [1/2]
| IntVar * operations_research::Solver::MakeBoolVar | ( | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 6438 of file expressions.cc.
◆ MakeBoolVar() [2/2]
| IntVar * operations_research::Solver::MakeBoolVar | ( | const std::string & | name | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 6434 of file expressions.cc.
◆ MakeBoolVarArray() [1/3]
| IntVar ** operations_research::Solver::MakeBoolVarArray | ( | int | var_count, |
| const std::string & | name ) |
Same but allocates an array and returns it.
Definition at line 6575 of file expressions.cc.
◆ MakeBoolVarArray() [2/3]
| void operations_research::Solver::MakeBoolVarArray | ( | int | var_count, |
| const std::string & | name, | ||
| std::vector< IntVar * > * | vars ) |
This method will append the vector vars with 'var_count' boolean variables having name "name<i>" where is the index of the variable.
Definition at line 6562 of file expressions.cc.
◆ MakeBoolVarArray() [3/3]
| void operations_research::Solver::MakeBoolVarArray | ( | int | var_count, |
| std::vector< IntVar * > * | vars ) |
This method will append the vector vars with 'var_count' boolean variables having no names.
Definition at line 6569 of file expressions.cc.
◆ MakeBranchesLimit()
| RegularLimit * operations_research::Solver::MakeBranchesLimit | ( | int64_t | branches | ) |
◆ MakeCircuit()
| Constraint * operations_research::Solver::MakeCircuit | ( | const std::vector< IntVar * > & | nexts | ) |
Force the "nexts" variable to create a complete Hamiltonian path.
Definition at line 641 of file graph_constraints.cc.
◆ MakeClosureDemon()
| Demon * operations_research::Solver::MakeClosureDemon | ( | Solver::Closure | closure | ) |
◆ MakeConditionalExpression()
| IntExpr * operations_research::Solver::MakeConditionalExpression | ( | IntVar * | condition, |
| IntExpr * | expr, | ||
| int64_t | unperformed_value ) |
Conditional Expr condition ? expr : unperformed_value.
Definition at line 7275 of file expressions.cc.
◆ MakeConstantRestart()
| SearchMonitor * operations_research::Solver::MakeConstantRestart | ( | int | frequency | ) |
◆ MakeConstraintAdder()
Returns a decision builder that will add the given constraint to the model.
Definition at line 2368 of file constraint_solver.cc.
◆ MakeConstraintInitialPropagateCallback()
| Demon * operations_research::Solver::MakeConstraintInitialPropagateCallback | ( | Constraint * | ct | ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 37 of file constraints.cc.
◆ MakeConvexPiecewiseExpr()
| IntExpr * operations_research::Solver::MakeConvexPiecewiseExpr | ( | IntExpr * | expr, |
| int64_t | early_cost, | ||
| int64_t | early_date, | ||
| int64_t | late_date, | ||
| int64_t | late_cost ) |
◆ MakeCount() [1/2]
| Constraint * operations_research::Solver::MakeCount | ( | const std::vector< IntVar * > & | vars, |
| int64_t | value, | ||
| int64_t | max_count ) |
|{i | vars[i] == value}| == max_count
Definition at line 32 of file count_cst.cc.
◆ MakeCount() [2/2]
| Constraint * operations_research::Solver::MakeCount | ( | const std::vector< IntVar * > & | vars, |
| int64_t | value, | ||
| IntVar * | max_count ) |
|{i | vars[i] == value}| == max_count
Definition at line 47 of file count_cst.cc.
◆ MakeCover()
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.
Definition at line 588 of file sched_constraints.cc.
◆ MakeCumulative() [1/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name ) |
Intervals and demands should be vectors of equal size.
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. 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.
Definition at line 2634 of file resource.cc.
◆ MakeCumulative() [2/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int > & | demands, | ||
| IntVar * | capacity, | ||
| const std::string & | name ) |
Intervals and demands should be vectors of equal size.
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. 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.
Definition at line 2652 of file resource.cc.
◆ MakeCumulative() [3/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int64_t > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name ) |
Intervals and demands should be vectors of equal size.
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. 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.
Definition at line 2620 of file resource.cc.
◆ MakeCumulative() [4/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int64_t > & | demands, | ||
| IntVar * | capacity, | ||
| absl::string_view | name ) |
Intervals and demands should be vectors of equal size.
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. 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.
Definition at line 2640 of file resource.cc.
◆ MakeCumulative() [5/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< IntVar * > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name ) |
Intervals and demands should be vectors of equal size.
This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. Demands should be positive.
Definition at line 2661 of file resource.cc.
◆ MakeCumulative() [6/6]
| Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< IntVar * > & | demands, | ||
| IntVar * | capacity, | ||
| const std::string & | name ) |
Intervals and demands should be vectors of equal size.
This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. Demands should be positive.
Definition at line 2679 of file resource.cc.
◆ MakeCustomLimit()
| SearchLimit * operations_research::Solver::MakeCustomLimit | ( | std::function< bool()> | limiter | ) |
◆ MakeDecision()
◆ MakeDecisionBuilderFromAssignment()
Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'.
◆ MakeDefaultPhase() [1/2]
| DecisionBuilder * operations_research::Solver::MakeDefaultPhase | ( | const std::vector< IntVar * > & | vars | ) |
◆ MakeDefaultPhase() [2/2]
◆ MakeDefaultRegularLimitParameters()
◆ MakeDefaultSolutionPool()
| SolutionPool * operations_research::Solver::MakeDefaultSolutionPool | ( | ) |
◆ MakeDelayedConstraintInitialPropagateCallback()
| Demon * operations_research::Solver::MakeDelayedConstraintInitialPropagateCallback | ( | Constraint * | ct | ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority.
Definition at line 42 of file constraints.cc.
◆ MakeDelayedPathCumul()
| Constraint * operations_research::Solver::MakeDelayedPathCumul | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| const std::vector< IntVar * > & | cumuls, | ||
| const std::vector< IntVar * > & | transits ) |
Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated.
Definition at line 1329 of file graph_constraints.cc.
◆ MakeDeviation()
| Constraint * operations_research::Solver::MakeDeviation | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | deviation_var, | ||
| int64_t | total_sum ) |
Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = #vars
Definition at line 414 of file deviation.cc.
◆ MakeDifference() [1/2]
◆ MakeDifference() [2/2]
◆ MakeDisjunctiveConstraint()
This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero duration can be scheduled anywhere.
Definition at line 2608 of file resource.cc.
◆ MakeDistribute() [1/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | card_min, | ||
| const std::vector< int > & | card_max ) |
Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j]
Definition at line 1053 of file count_cst.cc.
◆ MakeDistribute() [2/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | values, | ||
| const std::vector< int > & | card_min, | ||
| const std::vector< int > & | card_max ) |
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]
Definition at line 1076 of file count_cst.cc.
◆ MakeDistribute() [3/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | values, | ||
| const std::vector< IntVar * > & | cards ) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
Definition at line 994 of file count_cst.cc.
◆ MakeDistribute() [4/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | card_min, | ||
| const std::vector< int64_t > & | card_max ) |
Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j]
Definition at line 1033 of file count_cst.cc.
◆ MakeDistribute() [5/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | values, | ||
| const std::vector< int64_t > & | card_min, | ||
| const std::vector< int64_t > & | card_max ) |
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]
Definition at line 1059 of file count_cst.cc.
◆ MakeDistribute() [6/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | values, | ||
| const std::vector< IntVar * > & | cards ) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
Definition at line 965 of file count_cst.cc.
◆ MakeDistribute() [7/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | cards ) |
Aggregated version of count: |{i | v[i] == j}| == cards[j].
Definition at line 1000 of file count_cst.cc.
◆ MakeDistribute() [8/8]
| Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, |
| int64_t | card_min, | ||
| int64_t | card_max, | ||
| int64_t | card_size ) |
Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min <= |{i | v[i] == j}| <= card_max
Definition at line 1014 of file count_cst.cc.
◆ MakeDiv() [1/2]
◆ MakeDiv() [2/2]
numerator / denominator (integer division). Terms need to be positive.
Definition at line 6977 of file expressions.cc.
◆ MakeElement() [1/6]
| IntExpr * operations_research::Solver::MakeElement | ( | const std::vector< int > & | values, |
| IntVar * | index ) |
◆ MakeElement() [2/6]
| IntExpr * operations_research::Solver::MakeElement | ( | const std::vector< int64_t > & | values, |
| IntVar * | index ) |
◆ MakeElement() [3/6]
| IntExpr * operations_research::Solver::MakeElement | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | index ) |
◆ MakeElement() [4/6]
| IntExpr * operations_research::Solver::MakeElement | ( | Solver::IndexEvaluator1 | values, |
| IntVar * | index ) |
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).
Definition at line 862 of file element.cc.
◆ MakeElement() [5/6]
| IntExpr * operations_research::Solver::MakeElement | ( | Solver::IndexEvaluator2 | values, |
| IntVar * | index1, | ||
| IntVar * | index2 ) |
2D version of function-based element expression, values(expr1, expr2).
Definition at line 1112 of file element.cc.
◆ MakeElement() [6/6]
| IntExpr * operations_research::Solver::MakeElement | ( | Int64ToIntVar | vars, |
| int64_t | range_start, | ||
| int64_t | range_end, | ||
| IntVar * | argument ) |
◆ MakeElementEquality() [1/4]
| Constraint * operations_research::Solver::MakeElementEquality | ( | const std::vector< int > & | vals, |
| IntVar * | index, | ||
| IntVar * | target ) |
◆ MakeElementEquality() [2/4]
| Constraint * operations_research::Solver::MakeElementEquality | ( | const std::vector< int64_t > & | vals, |
| IntVar * | index, | ||
| IntVar * | target ) |
◆ MakeElementEquality() [3/4]
| Constraint * operations_research::Solver::MakeElementEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | index, | ||
| int64_t | target ) |
◆ MakeElementEquality() [4/4]
| Constraint * operations_research::Solver::MakeElementEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | index, | ||
| IntVar * | target ) |
◆ MakeEnterSearchCallback()
| SearchMonitor * operations_research::Solver::MakeEnterSearchCallback | ( | std::function< void()> | callback | ) |
◆ MakeEquality() [1/4]
This constraints states that the two interval variables are equal.
Definition at line 598 of file sched_constraints.cc.
◆ MakeEquality() [2/4]
◆ MakeEquality() [3/4]
| Constraint * operations_research::Solver::MakeEquality | ( | IntExpr * | expr, |
| int64_t | value ) |
◆ MakeEquality() [4/4]
◆ MakeExitSearchCallback()
| SearchMonitor * operations_research::Solver::MakeExitSearchCallback | ( | std::function< void()> | callback | ) |
◆ MakeFailDecision()
| Decision * operations_research::Solver::MakeFailDecision | ( | ) |
◆ MakeFailuresLimit()
| RegularLimit * operations_research::Solver::MakeFailuresLimit | ( | int64_t | failures | ) |
◆ MakeFalseConstraint() [1/2]
| Constraint * operations_research::Solver::MakeFalseConstraint | ( | ) |
◆ MakeFalseConstraint() [2/2]
| Constraint * operations_research::Solver::MakeFalseConstraint | ( | const std::string & | explanation | ) |
◆ MakeFirstSolutionCollector() [1/2]
Collect the first solution of the search. The variables will need to be added later.
◆ MakeFirstSolutionCollector() [2/2]
◆ MakeFixedDurationEndSyncedOnEndIntervalVar()
| IntervalVar * operations_research::Solver::MakeFixedDurationEndSyncedOnEndIntervalVar | ( | IntervalVar * | interval_var, |
| int64_t | duration, | ||
| int64_t | offset ) |
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.
Definition at line 2464 of file interval.cc.
◆ MakeFixedDurationEndSyncedOnStartIntervalVar()
| IntervalVar * operations_research::Solver::MakeFixedDurationEndSyncedOnStartIntervalVar | ( | IntervalVar * | interval_var, |
| int64_t | duration, | ||
| int64_t | offset ) |
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.
Definition at line 2457 of file interval.cc.
◆ MakeFixedDurationIntervalVar() [1/3]
| IntervalVar * operations_research::Solver::MakeFixedDurationIntervalVar | ( | int64_t | start_min, |
| int64_t | start_max, | ||
| int64_t | duration, | ||
| bool | optional, | ||
| const std::string & | name ) |
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.
Definition at line 2284 of file interval.cc.
◆ MakeFixedDurationIntervalVar() [2/3]
| IntervalVar * operations_research::Solver::MakeFixedDurationIntervalVar | ( | IntVar * | start_variable, |
| int64_t | duration, | ||
| const std::string & | name ) |
Creates a performed interval var with a fixed duration. The duration must be greater than 0.
Definition at line 2312 of file interval.cc.
◆ MakeFixedDurationIntervalVar() [3/3]
| IntervalVar * operations_research::Solver::MakeFixedDurationIntervalVar | ( | IntVar * | start_variable, |
| int64_t | duration, | ||
| IntVar * | performed_variable, | ||
| const std::string & | name ) |
Creates an interval var with a fixed duration, and performed_variable. The duration must be greater than 0.
Definition at line 2323 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [1/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| absl::Span< const int > | durations, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with interval variables built with the corresponding start variables.
Definition at line 2372 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [2/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| absl::Span< const int > | durations, | ||
| const std::vector< IntVar * > & | performed_variables, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with interval variables built with the corresponding start and performed variables.
Definition at line 2386 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [3/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| absl::Span< const int64_t > | durations, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with interval variables built with the corresponding start variables.
Definition at line 2358 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [4/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| absl::Span< const int64_t > | durations, | ||
| const std::vector< IntVar * > & | performed_variables, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with interval variables built with the corresponding start and performed variables.
Definition at line 2400 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [5/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| int64_t | duration, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with 'count' interval var built with the corresponding start variables.
Definition at line 2344 of file interval.cc.
◆ MakeFixedDurationIntervalVarArray() [6/6]
| void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | int | count, |
| int64_t | start_min, | ||
| int64_t | start_max, | ||
| int64_t | duration, | ||
| bool | optional, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with 'count' interval variables built with the corresponding parameters.
Definition at line 2299 of file interval.cc.
◆ MakeFixedDurationStartSyncedOnEndIntervalVar()
| IntervalVar * operations_research::Solver::MakeFixedDurationStartSyncedOnEndIntervalVar | ( | IntervalVar * | interval_var, |
| int64_t | duration, | ||
| int64_t | offset ) |
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.
Definition at line 2450 of file interval.cc.
◆ MakeFixedDurationStartSyncedOnStartIntervalVar()
| IntervalVar * operations_research::Solver::MakeFixedDurationStartSyncedOnStartIntervalVar | ( | IntervalVar * | interval_var, |
| int64_t | duration, | ||
| int64_t | offset ) |
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.
Definition at line 2443 of file interval.cc.
◆ MakeFixedInterval()
| IntervalVar * operations_research::Solver::MakeFixedInterval | ( | int64_t | start, |
| int64_t | duration, | ||
| const std::string & | name ) |
Creates a fixed and performed interval.
Definition at line 2279 of file interval.cc.
◆ MakeGenericTabuSearch()
| ObjectiveMonitor * operations_research::Solver::MakeGenericTabuSearch | ( | bool | maximize, |
| IntVar * | v, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | tabu_vars, | ||
| int64_t | forbid_tenure ) |
◆ MakeGreater() [1/3]
◆ MakeGreater() [2/3]
| Constraint * operations_research::Solver::MakeGreater | ( | IntExpr * | expr, |
| int64_t | value ) |
◆ MakeGreater() [3/3]
◆ MakeGreaterOrEqual() [1/3]
| Constraint * operations_research::Solver::MakeGreaterOrEqual | ( | IntExpr * | expr, |
| int | value ) |
◆ MakeGreaterOrEqual() [2/3]
| Constraint * operations_research::Solver::MakeGreaterOrEqual | ( | IntExpr * | expr, |
| int64_t | value ) |
◆ MakeGreaterOrEqual() [3/3]
◆ MakeGuidedLocalSearch() [1/2]
| ObjectiveMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, |
| IntVar * | objective, | ||
| Solver::IndexEvaluator2 | objective_function, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | vars, | ||
| double | penalty_factor, | ||
| std::function< std::vector< std::pair< int64_t, int64_t > >(int64_t, int64_t)> | get_equivalent_pairs = nullptr, | ||
| bool | reset_penalties_on_new_best_solution = false ) |
◆ MakeGuidedLocalSearch() [2/2]
| ObjectiveMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, |
| IntVar * | objective, | ||
| Solver::IndexEvaluator3 | objective_function, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | vars, | ||
| const std::vector< IntVar * > & | secondary_vars, | ||
| double | penalty_factor, | ||
| std::function< std::vector< std::pair< int64_t, int64_t > >(int64_t, int64_t)> | get_equivalent_pairs = nullptr, | ||
| bool | reset_penalties_on_new_best_solution = false ) |
◆ MakeIfThenElseCt()
| Constraint * operations_research::Solver::MakeIfThenElseCt | ( | IntVar * | condition, |
| IntExpr * | then_expr, | ||
| IntExpr * | else_expr, | ||
| IntVar * | target_var ) |
Special cases with arrays of size two.
Definition at line 1607 of file element.cc.
◆ MakeImprovementLimit()
| ImprovementSearchLimit * operations_research::Solver::MakeImprovementLimit | ( | IntVar * | objective_var, |
| bool | maximize, | ||
| double | objective_scaling_factor, | ||
| double | objective_offset, | ||
| double | improvement_rate_coefficient, | ||
| int | improvement_rate_solutions_distance ) |
◆ MakeIndexExpression()
| IntExpr * operations_research::Solver::MakeIndexExpression | ( | const std::vector< IntVar * > & | vars, |
| int64_t | value ) |
Returns the expression expr such that vars[expr] == value. It assumes that vars are all different.
Definition at line 1757 of file element.cc.
◆ MakeIndexOfConstraint()
| Constraint * operations_research::Solver::MakeIndexOfConstraint | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | index, | ||
| int64_t | target ) |
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.
Definition at line 1742 of file element.cc.
◆ MakeIndexOfFirstMaxValueConstraint()
| Constraint * operations_research::Solver::MakeIndexOfFirstMaxValueConstraint | ( | IntVar * | index, |
| const std::vector< IntVar * > & | vars ) |
Creates a constraint that binds the index variable to the index of the first variable with the maximum value.
Definition at line 598 of file constraints.cc.
◆ MakeIndexOfFirstMinValueConstraint()
| Constraint * operations_research::Solver::MakeIndexOfFirstMinValueConstraint | ( | IntVar * | index, |
| const std::vector< IntVar * > & | vars ) |
Creates a constraint that binds the index variable to the index of the first variable with the minimum value.
Definition at line 603 of file constraints.cc.
◆ MakeIntConst() [1/2]
| IntVar * operations_research::Solver::MakeIntConst | ( | int64_t | val | ) |
IntConst will create a constant expression.
Definition at line 6517 of file expressions.cc.
◆ MakeIntConst() [2/2]
| IntVar * operations_research::Solver::MakeIntConst | ( | int64_t | val, |
| const std::string & | name ) |
IntConst will create a constant expression.
Definition at line 6506 of file expressions.cc.
◆ MakeIntervalRelaxedMax()
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.
Definition at line 2254 of file interval.cc.
◆ MakeIntervalRelaxedMin()
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.
Definition at line 2263 of file interval.cc.
◆ MakeIntervalVar()
| IntervalVar * operations_research::Solver::MakeIntervalVar | ( | int64_t | start_min, |
| int64_t | start_max, | ||
| int64_t | duration_min, | ||
| int64_t | duration_max, | ||
| int64_t | end_min, | ||
| int64_t | end_max, | ||
| bool | optional, | ||
| const std::string & | name ) |
Creates an interval var by specifying the bounds on start, duration, and end.
Definition at line 2416 of file interval.cc.
◆ MakeIntervalVarArray()
| void operations_research::Solver::MakeIntervalVarArray | ( | int | count, |
| int64_t | start_min, | ||
| int64_t | start_max, | ||
| int64_t | duration_min, | ||
| int64_t | duration_max, | ||
| int64_t | end_min, | ||
| int64_t | end_max, | ||
| bool | optional, | ||
| absl::string_view | name, | ||
| std::vector< IntervalVar * > * | array ) |
This method fills the vector with 'count' interval var built with the corresponding parameters.
Definition at line 2425 of file interval.cc.
◆ MakeIntervalVarRelation() [1/2]
This method creates a relation between an interval var and a date.
Definition at line 112 of file timetabling.cc.
◆ MakeIntervalVarRelation() [2/2]
This method creates a relation between two interval vars.
Definition at line 231 of file timetabling.cc.
◆ MakeIntervalVarRelationWithDelay()
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.
Definition at line 237 of file timetabling.cc.
◆ MakeIntVar() [1/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6502 of file expressions.cc.
◆ MakeIntVar() [2/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int > & | values, |
| const std::string & | name ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6497 of file expressions.cc.
◆ MakeIntVar() [3/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int64_t > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6493 of file expressions.cc.
◆ MakeIntVar() [4/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int64_t > & | values, |
| const std::string & | name ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6442 of file expressions.cc.
◆ MakeIntVar() [5/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | int64_t | min, |
| int64_t | max ) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 6430 of file expressions.cc.
◆ MakeIntVar() [6/6]
| IntVar * operations_research::Solver::MakeIntVar | ( | int64_t | min, |
| int64_t | max, | ||
| const std::string & | name ) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 6414 of file expressions.cc.
◆ MakeIntVarArray() [1/3]
| IntVar ** operations_research::Solver::MakeIntVarArray | ( | int | var_count, |
| int64_t | vmin, | ||
| int64_t | vmax, | ||
| const std::string & | name ) |
Same but allocates an array and returns it.
Definition at line 6553 of file expressions.cc.
◆ MakeIntVarArray() [2/3]
| void operations_research::Solver::MakeIntVarArray | ( | int | var_count, |
| int64_t | vmin, | ||
| int64_t | vmax, | ||
| const std::string & | name, | ||
| std::vector< IntVar * > * | vars ) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having name "name<i>" where is the index of the variable.
Definition at line 6538 of file expressions.cc.
◆ MakeIntVarArray() [3/3]
| void operations_research::Solver::MakeIntVarArray | ( | int | var_count, |
| int64_t | vmin, | ||
| int64_t | vmax, | ||
| std::vector< IntVar * > * | vars ) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having no names.
Definition at line 6546 of file expressions.cc.
◆ MakeInversePermutationConstraint()
| Constraint * operations_research::Solver::MakeInversePermutationConstraint | ( | const std::vector< IntVar * > & | left, |
| const std::vector< IntVar * > & | right ) |
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.
Definition at line 593 of file constraints.cc.
◆ MakeIsBetweenCt()
| Constraint * operations_research::Solver::MakeIsBetweenCt | ( | IntExpr * | expr, |
| int64_t | l, | ||
| int64_t | u, | ||
| IntVar * | b ) |
◆ MakeIsBetweenVar()
◆ MakeIsDifferentCstCt()
| Constraint * operations_research::Solver::MakeIsDifferentCstCt | ( | IntExpr * | var, |
| int64_t | value, | ||
| IntVar * | boolvar ) |
◆ MakeIsDifferentCstVar()
status var of (var != value)
Definition at line 585 of file expr_cst.cc.
◆ MakeIsDifferentCt()
◆ MakeIsDifferentVar()
◆ MakeIsEqualCstCt()
| Constraint * operations_research::Solver::MakeIsEqualCstCt | ( | IntExpr * | var, |
| int64_t | value, | ||
| IntVar * | boolvar ) |
◆ MakeIsEqualCstVar()
status var of (var == value)
Definition at line 467 of file expr_cst.cc.
◆ MakeIsEqualCt()
◆ MakeIsEqualVar()
◆ MakeIsGreaterCstCt()
| Constraint * operations_research::Solver::MakeIsGreaterCstCt | ( | IntExpr * | v, |
| int64_t | c, | ||
| IntVar * | b ) |
◆ MakeIsGreaterCstVar()
status var of (var > value)
Definition at line 701 of file expr_cst.cc.
◆ MakeIsGreaterCt()
◆ MakeIsGreaterOrEqualCstCt()
| Constraint * operations_research::Solver::MakeIsGreaterOrEqualCstCt | ( | IntExpr * | var, |
| int64_t | value, | ||
| IntVar * | boolvar ) |
◆ MakeIsGreaterOrEqualCstVar()
status var of (var >= value)
Definition at line 684 of file expr_cst.cc.
◆ MakeIsGreaterOrEqualCt()
◆ MakeIsGreaterOrEqualVar()
◆ MakeIsGreaterVar()
◆ MakeIsLessCstCt()
| Constraint * operations_research::Solver::MakeIsLessCstCt | ( | IntExpr * | v, |
| int64_t | c, | ||
| IntVar * | b ) |
◆ MakeIsLessCstVar()
status var of (var < value)
Definition at line 801 of file expr_cst.cc.
◆ MakeIsLessCt()
◆ MakeIsLessOrEqualCstCt()
| Constraint * operations_research::Solver::MakeIsLessOrEqualCstCt | ( | IntExpr * | var, |
| int64_t | value, | ||
| IntVar * | boolvar ) |
◆ MakeIsLessOrEqualCstVar()
status var of (var <= value)
Definition at line 784 of file expr_cst.cc.
◆ MakeIsLessOrEqualCt()
◆ MakeIsLessOrEqualVar()
◆ MakeIsLessVar()
◆ MakeIsLexicalLessOrEqualWithOffsetsCt()
| Constraint * operations_research::Solver::MakeIsLexicalLessOrEqualWithOffsetsCt | ( | std::vector< IntVar * > | left, |
| std::vector< IntVar * > | right, | ||
| std::vector< int64_t > | offsets, | ||
| IntVar * | boolvar ) |
◆ MakeIsMemberCt() [1/2]
| Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntExpr * | expr, |
| const std::vector< int > & | values, | ||
| IntVar * | boolvar ) |
◆ MakeIsMemberCt() [2/2]
| Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntExpr * | expr, |
| const std::vector< int64_t > & | values, | ||
| IntVar * | boolvar ) |
◆ MakeIsMemberVar() [1/2]
| IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntExpr * | expr, |
| const std::vector< int > & | values ) |
◆ MakeIsMemberVar() [2/2]
| IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntExpr * | expr, |
| const std::vector< int64_t > & | values ) |
◆ MakeLastSolutionCollector() [1/2]
Collect the last solution of the search. The variables will need to be added later.
◆ MakeLastSolutionCollector() [2/2]
◆ MakeLess() [1/3]
◆ MakeLess() [2/3]
◆ MakeLess() [3/3]
◆ MakeLessOrEqual() [1/3]
| Constraint * operations_research::Solver::MakeLessOrEqual | ( | IntExpr * | expr, |
| int | value ) |
◆ MakeLessOrEqual() [2/3]
| Constraint * operations_research::Solver::MakeLessOrEqual | ( | IntExpr * | expr, |
| int64_t | value ) |
◆ MakeLessOrEqual() [3/3]
◆ MakeLexicalLess()
| Constraint * operations_research::Solver::MakeLexicalLess | ( | const std::vector< IntVar * > & | left, |
| const std::vector< IntVar * > & | right ) |
Creates a constraint that enforces that left is lexicographically less than right.
Definition at line 555 of file constraints.cc.
◆ MakeLexicalLessOrEqual()
| Constraint * operations_research::Solver::MakeLexicalLessOrEqual | ( | const std::vector< IntVar * > & | left, |
| const std::vector< IntVar * > & | right ) |
Creates a constraint that enforces that left is lexicographically less than or equal to right.
Definition at line 566 of file constraints.cc.
◆ MakeLexicalLessOrEqualWithOffsets()
| Constraint * operations_research::Solver::MakeLexicalLessOrEqualWithOffsets | ( | std::vector< IntVar * > | left, |
| std::vector< IntVar * > | right, | ||
| std::vector< int64_t > | offsets ) |
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.
Definition at line 572 of file constraints.cc.
◆ MakeLexicographicImprovementLimit()
| ImprovementSearchLimit * operations_research::Solver::MakeLexicographicImprovementLimit | ( | std::vector< IntVar * > | objective_vars, |
| std::vector< bool > | maximize, | ||
| std::vector< double > | objective_scaling_factors, | ||
| std::vector< double > | objective_offsets, | ||
| double | improvement_rate_coefficient, | ||
| int | improvement_rate_solutions_distance ) |
◆ MakeLexicographicOptimize()
| OptimizeVar * operations_research::Solver::MakeLexicographicOptimize | ( | std::vector< bool > | maximize, |
| std::vector< IntVar * > | variables, | ||
| std::vector< int64_t > | steps ) |
◆ MakeLexicographicSimulatedAnnealing()
| ObjectiveMonitor * operations_research::Solver::MakeLexicographicSimulatedAnnealing | ( | const std::vector< bool > & | maximize, |
| std::vector< IntVar * > | vars, | ||
| std::vector< int64_t > | steps, | ||
| std::vector< int64_t > | initial_temperatures ) |
◆ MakeLexicographicTabuSearch()
| ObjectiveMonitor * operations_research::Solver::MakeLexicographicTabuSearch | ( | const std::vector< bool > & | maximize, |
| std::vector< IntVar * > | objectives, | ||
| std::vector< int64_t > | steps, | ||
| const std::vector< IntVar * > & | vars, | ||
| int64_t | keep_tenure, | ||
| int64_t | forbid_tenure, | ||
| double | tabu_factor ) |
◆ MakeLightElement() [1/3]
template<typename F>
|
inline |
Light versions of function-based elements, in constraint version only, well-suited for use within Local Search. These constraints are "checking" constraints, only triggered on WhenBound events. They provide very little (or no) domain filtering. 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.
Definition at line 1278 of file constraint_solver.h.
◆ MakeLightElement() [2/3]
template<typename F>
|
inline |
Light three-dimension function-based element constraint ensuring var == values(index1, index2, index3). The constraint does not perform bound reduction of the resulting variable until the index variables are bound.
Definition at line 1304 of file constraint_solver.h.
◆ MakeLightElement() [3/3]
template<typename F>
|
inline |
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.
Definition at line 1291 of file constraint_solver.h.
◆ MakeLimit() [1/4]
| RegularLimit * operations_research::Solver::MakeLimit | ( | absl::Duration | time, |
| int64_t | branches, | ||
| int64_t | failures, | ||
| int64_t | solutions, | ||
| bool | smart_time_check = false, | ||
| bool | cumulative = false ) |
◆ MakeLimit() [2/4]
◆ MakeLimit() [3/4]
| RegularLimit * operations_research::Solver::MakeLimit | ( | int64_t | time, |
| int64_t | branches, | ||
| int64_t | failures, | ||
| int64_t | solutions, | ||
| bool | smart_time_check = false, | ||
| bool | cumulative = false ) |
◆ MakeLimit() [4/4]
| SearchLimit * operations_research::Solver::MakeLimit | ( | SearchLimit * | limit_1, |
| SearchLimit * | limit_2 ) |
◆ MakeLocalSearchPhase() [1/4]
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.
Definition at line 4749 of file local_search.cc.
◆ MakeLocalSearchPhase() [2/4]
Variant with a sub_decison_builder specific to the first solution.
Definition at line 4767 of file local_search.cc.
◆ MakeLocalSearchPhase() [3/4]
◆ MakeLocalSearchPhase() [4/4]
◆ MakeLocalSearchPhaseParameters() [1/6]
◆ MakeLocalSearchPhaseParameters() [2/6]
◆ MakeLocalSearchPhaseParameters() [3/6]
◆ MakeLocalSearchPhaseParameters() [4/6]
◆ MakeLocalSearchPhaseParameters() [5/6]
◆ MakeLocalSearchPhaseParameters() [6/6]
◆ MakeLubyRestart()
| SearchMonitor * operations_research::Solver::MakeLubyRestart | ( | int | scale_factor | ) |
◆ MakeMapDomain()
| Constraint * operations_research::Solver::MakeMapDomain | ( | IntVar * | var, |
| const std::vector< IntVar * > & | actives ) |
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);
Definition at line 550 of file constraints.cc.
◆ MakeMax() [1/4]
◆ MakeMax() [2/4]
◆ MakeMax() [3/4]
◆ MakeMax() [4/4]
◆ MakeMaxEquality()
| Constraint * operations_research::Solver::MakeMaxEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | max_var ) |
◆ MakeMaximize()
| OptimizeVar * operations_research::Solver::MakeMaximize | ( | IntVar * | v, |
| int64_t | step ) |
◆ MakeMemberCt() [1/2]
| Constraint * operations_research::Solver::MakeMemberCt | ( | IntExpr * | expr, |
| const std::vector< int > & | values ) |
◆ MakeMemberCt() [2/2]
| Constraint * operations_research::Solver::MakeMemberCt | ( | IntExpr * | expr, |
| const std::vector< int64_t > & | values ) |
expr in set. Propagation is lazy, i.e. this constraint does not creates holes in the domain of the variable.
Definition at line 1168 of file expr_cst.cc.
◆ MakeMin() [1/4]
◆ MakeMin() [2/4]
◆ MakeMin() [3/4]
◆ MakeMin() [4/4]
◆ MakeMinEquality()
| Constraint * operations_research::Solver::MakeMinEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | min_var ) |
◆ MakeMinimize()
| OptimizeVar * operations_research::Solver::MakeMinimize | ( | IntVar * | v, |
| int64_t | step ) |
◆ MakeMirrorInterval()
Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis.
Definition at line 2249 of file interval.cc.
◆ MakeModulo() [1/2]
Modulo expression x % mod (with the python convention for modulo).
Definition at line 7299 of file expressions.cc.
◆ MakeModulo() [2/2]
Modulo expression x % mod (with the python convention for modulo).
Definition at line 7310 of file expressions.cc.
◆ MakeMonotonicElement()
| IntExpr * operations_research::Solver::MakeMonotonicElement | ( | Solver::IndexEvaluator1 | values, |
| bool | increasing, | ||
| IntVar * | index ) |
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.
Definition at line 869 of file element.cc.
◆ MakeMoveTowardTargetOperator() [1/2]
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.
Definition at line 276 of file local_search.cc.
◆ MakeMoveTowardTargetOperator() [2/2]
| LocalSearchOperator * operations_research::Solver::MakeMoveTowardTargetOperator | ( | const std::vector< IntVar * > & | variables, |
| const std::vector< int64_t > & | target_values ) |
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.
Definition at line 292 of file local_search.cc.
◆ MakeNBestLexicographicValueSolutionCollector() [1/2]
| SolutionCollector * operations_research::Solver::MakeNBestLexicographicValueSolutionCollector | ( | const Assignment * | assignment, |
| int | solution_count, | ||
| std::vector< bool > | maximize ) |
◆ MakeNBestLexicographicValueSolutionCollector() [2/2]
| SolutionCollector * operations_research::Solver::MakeNBestLexicographicValueSolutionCollector | ( | int | solution_count, |
| std::vector< bool > | maximize ) |
◆ MakeNBestValueSolutionCollector() [1/2]
| SolutionCollector * operations_research::Solver::MakeNBestValueSolutionCollector | ( | const Assignment * | assignment, |
| int | solution_count, | ||
| bool | maximize ) |
◆ MakeNBestValueSolutionCollector() [2/2]
| SolutionCollector * operations_research::Solver::MakeNBestValueSolutionCollector | ( | int | solution_count, |
| bool | maximize ) |
◆ MakeNeighborhoodLimit()
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.
Definition at line 1924 of file local_search.cc.
◆ MakeNestedOptimize() [1/6]
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.
◆ MakeNestedOptimize() [2/6]
◆ MakeNestedOptimize() [3/6]
◆ MakeNestedOptimize() [4/6]
◆ MakeNestedOptimize() [5/6]
◆ MakeNestedOptimize() [6/6]
◆ MakeNoCycle() [1/2]
| Constraint * operations_research::Solver::MakeNoCycle | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| Solver::IndexFilter1 | sink_handler, | ||
| bool | assume_paths ) |
◆ MakeNoCycle() [2/2]
| Constraint * operations_research::Solver::MakeNoCycle | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| Solver::IndexFilter1 | sink_handler = nullptr ) |
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.
Definition at line 634 of file graph_constraints.cc.
◆ MakeNonEquality() [1/3]
| Constraint * operations_research::Solver::MakeNonEquality | ( | IntExpr * | expr, |
| int | value ) |
◆ MakeNonEquality() [2/3]
| Constraint * operations_research::Solver::MakeNonEquality | ( | IntExpr * | expr, |
| int64_t | value ) |
◆ MakeNonEquality() [3/3]
◆ MakeNonOverlappingBoxesConstraint() [1/3]
| Constraint * operations_research::Solver::MakeNonOverlappingBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| absl::Span< const int > | x_size, | ||
| absl::Span< const int > | y_size ) |
◆ MakeNonOverlappingBoxesConstraint() [2/3]
| Constraint * operations_research::Solver::MakeNonOverlappingBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| absl::Span< const int64_t > | x_size, | ||
| absl::Span< const int64_t > | y_size ) |
◆ MakeNonOverlappingBoxesConstraint() [3/3]
| Constraint * operations_research::Solver::MakeNonOverlappingBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< IntVar * > & | x_size, | ||
| const std::vector< IntVar * > & | y_size ) |
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.
◆ MakeNonOverlappingNonStrictBoxesConstraint() [1/3]
| Constraint * operations_research::Solver::MakeNonOverlappingNonStrictBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| absl::Span< const int > | x_size, | ||
| absl::Span< const int > | y_size ) |
◆ MakeNonOverlappingNonStrictBoxesConstraint() [2/3]
| Constraint * operations_research::Solver::MakeNonOverlappingNonStrictBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| absl::Span< const int64_t > | x_size, | ||
| absl::Span< const int64_t > | y_size ) |
◆ MakeNonOverlappingNonStrictBoxesConstraint() [3/3]
| Constraint * operations_research::Solver::MakeNonOverlappingNonStrictBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< IntVar * > & | x_size, | ||
| const std::vector< IntVar * > & | y_size ) |
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.
◆ MakeNotBetweenCt()
| Constraint * operations_research::Solver::MakeNotBetweenCt | ( | IntExpr * | expr, |
| int64_t | l, | ||
| int64_t | u ) |
(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.
Definition at line 961 of file expr_cst.cc.
◆ MakeNotMemberCt() [1/5]
| Constraint * operations_research::Solver::MakeNotMemberCt | ( | IntExpr * | expr, |
| const std::vector< int > & | values ) |
◆ MakeNotMemberCt() [2/5]
| Constraint * operations_research::Solver::MakeNotMemberCt | ( | IntExpr * | expr, |
| const std::vector< int64_t > & | values ) |
◆ MakeNotMemberCt() [3/5]
expr should not be in the list of forbidden intervals.
Definition at line 1595 of file expr_cst.cc.
◆ MakeNotMemberCt() [4/5]
| Constraint * operations_research::Solver::MakeNotMemberCt | ( | IntExpr * | expr, |
| std::vector< int > | starts, | ||
| std::vector< int > | ends ) |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1588 of file expr_cst.cc.
◆ MakeNotMemberCt() [5/5]
| Constraint * operations_research::Solver::MakeNotMemberCt | ( | IntExpr * | expr, |
| std::vector< int64_t > | starts, | ||
| std::vector< int64_t > | ends ) |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1581 of file expr_cst.cc.
◆ MakeNullIntersect()
| Constraint * operations_research::Solver::MakeNullIntersect | ( | const std::vector< IntVar * > & | first_vars, |
| const std::vector< IntVar * > & | second_vars ) |
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.
Definition at line 735 of file alldiff_cst.cc.
◆ MakeNullIntersectExcept()
| Constraint * operations_research::Solver::MakeNullIntersectExcept | ( | const std::vector< IntVar * > & | first_vars, |
| const std::vector< IntVar * > & | second_vars, | ||
| int64_t | escape_value ) |
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.
Definition at line 740 of file alldiff_cst.cc.
◆ MakeOperator() [1/4]
| LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::IndexEvaluator3 | evaluator, | ||
| Solver::EvaluatorLocalSearchOperators | op ) |
◆ MakeOperator() [2/4]
| LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::LocalSearchOperators | op, | ||
| std::function< const std::vector< int > &(int, int)> | get_incoming_neighbors = nullptr, | ||
| std::function< const std::vector< int > &(int, int)> | get_outgoing_neighbors = nullptr ) |
◆ MakeOperator() [3/4]
◆ MakeOperator() [4/4]
| LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| Solver::LocalSearchOperators | op, | ||
| std::function< const std::vector< int > &(int, int)> | get_incoming_neighbors = nullptr, | ||
| std::function< const std::vector< int > &(int, int)> | get_outgoing_neighbors = nullptr ) |
◆ MakeOpposite()
◆ MakeOptimize()
| OptimizeVar * operations_research::Solver::MakeOptimize | ( | bool | maximize, |
| IntVar * | v, | ||
| int64_t | step ) |
◆ MakePack()
| Pack * operations_research::Solver::MakePack | ( | const std::vector< IntVar * > & | vars, |
| int | number_of_bins ) |
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.
◆ MakePathConnected()
| Constraint * operations_research::Solver::MakePathConnected | ( | std::vector< IntVar * > | nexts, |
| std::vector< int64_t > | sources, | ||
| std::vector< int64_t > | sinks, | ||
| std::vector< IntVar * > | status ) |
Check whether more propagation is needed.
Constraint enforcing that status[i] is true iff there's a path defined on next variables from sources[i] to sinks[i].
Definition at line 1439 of file graph_constraints.cc.
◆ MakePathCumul() [1/3]
| Constraint * operations_research::Solver::MakePathCumul | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| const std::vector< IntVar * > & | cumuls, | ||
| const std::vector< IntVar * > & | slacks, | ||
| Solver::IndexEvaluator2 | transit_evaluator ) |
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.
Definition at line 1319 of file graph_constraints.cc.
◆ MakePathCumul() [2/3]
| Constraint * operations_research::Solver::MakePathCumul | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| const std::vector< IntVar * > & | cumuls, | ||
| const std::vector< IntVar * > & | transits ) |
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.
Definition at line 1301 of file graph_constraints.cc.
◆ MakePathCumul() [3/3]
| Constraint * operations_research::Solver::MakePathCumul | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| const std::vector< IntVar * > & | cumuls, | ||
| Solver::IndexEvaluator2 | transit_evaluator ) |
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.
Definition at line 1310 of file graph_constraints.cc.
◆ MakePathEnergyCostConstraint()
◆ MakePathPrecedenceConstraint() [1/2]
| Constraint * operations_research::Solver::MakePathPrecedenceConstraint | ( | std::vector< IntVar * > | nexts, |
| const std::vector< std::pair< int, int > > & | precedences ) |
Constraint enforcing, for each pair (i,j) in precedences, i to be before j in paths defined by next variables. the implementation can easily be modified to do that; evaluate the impact on models solved with local search.
Definition at line 1624 of file graph_constraints.cc.
◆ MakePathPrecedenceConstraint() [2/2]
| Constraint * operations_research::Solver::MakePathPrecedenceConstraint | ( | std::vector< IntVar * > | nexts, |
| const std::vector< std::pair< int, int > > & | precedences, | ||
| absl::Span< const int > | lifo_path_starts, | ||
| absl::Span< const int > | fifo_path_starts ) |
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).
Definition at line 1630 of file graph_constraints.cc.
◆ MakePathTransitPrecedenceConstraint()
| Constraint * operations_research::Solver::MakePathTransitPrecedenceConstraint | ( | std::vector< IntVar * > | nexts, |
| std::vector< IntVar * > | transits, | ||
| const std::vector< std::pair< int, int > > & | precedences ) |
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.
Definition at line 1647 of file graph_constraints.cc.
◆ MakePhase() [1/15]
◆ MakePhase() [2/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IndexEvaluator2 | value_evaluator ) |
◆ MakePhase() [3/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IndexEvaluator2 | value_evaluator, | ||
| Solver::IndexEvaluator1 | tie_breaker ) |
◆ MakePhase() [4/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IntValueStrategy | val_str ) |
◆ MakePhase() [5/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator2 | eval, | ||
| Solver::EvaluatorStrategy | str ) |
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.
◆ MakePhase() [6/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator2 | eval, | ||
| Solver::IndexEvaluator1 | tie_breaker, | ||
| Solver::EvaluatorStrategy | str ) |
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.
◆ MakePhase() [7/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IndexEvaluator2 | value_evaluator ) |
◆ MakePhase() [8/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IndexEvaluator2 | value_evaluator, | ||
| Solver::IndexEvaluator1 | tie_breaker ) |
◆ MakePhase() [9/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str ) |
◆ MakePhase() [10/15]
| DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, |
| IntVarStrategy | var_str, | ||
| VariableValueComparator | var_val1_val2_comparator ) |
◆ MakePhase() [11/15]
◆ MakePhase() [12/15]
◆ MakePhase() [13/15]
◆ MakePhase() [14/15]
◆ MakePhase() [15/15]
◆ MakePiecewiseLinearExpr()
expressions.
General piecewise-linear function expression, built from f(x) where f is piecewise-linear. The resulting expression is f(expr).
Definition at line 7268 of file expressions.cc.
◆ MakePower()
◆ MakePrintModelVisitor()
| ModelVisitor * operations_research::Solver::MakePrintModelVisitor | ( | ) |
◆ MakeProd() [1/2]
◆ MakeProd() [2/2]
◆ MakeProfiledDecisionBuilderWrapper()
◆ MakeRandomLnsOperator() [1/2]
| LocalSearchOperator * operations_research::Solver::MakeRandomLnsOperator | ( | const std::vector< IntVar * > & | vars, |
| int | number_of_variables ) |
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.
Definition at line 198 of file local_search.cc.
◆ MakeRandomLnsOperator() [2/2]
| LocalSearchOperator * operations_research::Solver::MakeRandomLnsOperator | ( | const std::vector< IntVar * > & | vars, |
| int | number_of_variables, | ||
| int32_t | seed ) |
◆ MakeRankFirstInterval()
| Decision * operations_research::Solver::MakeRankFirstInterval | ( | SequenceVar * | sequence, |
| int | index ) |
Returns a decision that tries to rank first the ith interval var in the sequence variable.
Definition at line 870 of file sched_search.cc.
◆ MakeRankLastInterval()
| Decision * operations_research::Solver::MakeRankLastInterval | ( | SequenceVar * | sequence, |
| int | index ) |
Returns a decision that tries to rank last the ith interval var in the sequence variable.
Definition at line 876 of file sched_search.cc.
◆ MakeRejectFilter()
◆ MakeRestoreAssignment()
◆ MakeRoundRobinCompoundObjectiveMonitor()
◆ MakeScalProd() [1/2]
| IntExpr * operations_research::Solver::MakeScalProd | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefs ) |
◆ MakeScalProd() [2/2]
| IntExpr * operations_research::Solver::MakeScalProd | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefs ) |
◆ MakeScalProdEquality() [1/4]
| Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| int64_t | cst ) |
◆ MakeScalProdEquality() [2/4]
| Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| IntVar * | target ) |
◆ MakeScalProdEquality() [3/4]
| Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| int64_t | cst ) |
◆ MakeScalProdEquality() [4/4]
| Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| IntVar * | target ) |
◆ MakeScalProdGreaterOrEqual() [1/2]
| Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coeffs, | ||
| int64_t | cst ) |
◆ MakeScalProdGreaterOrEqual() [2/2]
| Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coeffs, | ||
| int64_t | cst ) |
◆ MakeScalProdLessOrEqual() [1/2]
| Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| int64_t | cst ) |
◆ MakeScalProdLessOrEqual() [2/2]
| Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| int64_t | cst ) |
◆ MakeScheduleOrExpedite()
| Decision * operations_research::Solver::MakeScheduleOrExpedite | ( | IntervalVar * | var, |
| int64_t | est, | ||
| int64_t * | marker ) |
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.
Definition at line 849 of file sched_search.cc.
◆ MakeScheduleOrPostpone()
| Decision * operations_research::Solver::MakeScheduleOrPostpone | ( | IntervalVar * | var, |
| int64_t | est, | ||
| int64_t * | marker ) |
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.
Definition at line 842 of file sched_search.cc.
◆ MakeSearchLog() [1/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period | ) |
◆ MakeSearchLog() [2/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| IntVar * | var ) |
◆ MakeSearchLog() [3/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| IntVar * | var, | ||
| std::function< std::string()> | display_callback ) |
◆ MakeSearchLog() [4/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| OptimizeVar * | opt_var ) |
◆ MakeSearchLog() [5/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| OptimizeVar * | opt_var, | ||
| std::function< std::string()> | display_callback ) |
◆ MakeSearchLog() [6/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| std::function< std::string()> | display_callback ) |
◆ MakeSearchLog() [7/8]
| SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_period, |
| std::vector< IntVar * > | vars, | ||
| std::function< std::string()> | display_callback ) |
◆ MakeSearchLog() [8/8]
◆ MakeSearchTrace()
| SearchMonitor * operations_research::Solver::MakeSearchTrace | ( | const std::string & | prefix | ) |
◆ MakeSemiContinuousExpr()
| IntExpr * operations_research::Solver::MakeSemiContinuousExpr | ( | IntExpr * | expr, |
| int64_t | fixed_charge, | ||
| int64_t | step ) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0
Definition at line 7195 of file expressions.cc.
◆ MakeSimulatedAnnealing()
| ObjectiveMonitor * operations_research::Solver::MakeSimulatedAnnealing | ( | bool | maximize, |
| IntVar * | v, | ||
| int64_t | step, | ||
| int64_t | initial_temperature ) |
◆ MakeSolutionsLimit()
| RegularLimit * operations_research::Solver::MakeSolutionsLimit | ( | int64_t | solutions | ) |
◆ MakeSolveOnce() [1/6]
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.
◆ MakeSolveOnce() [2/6]
◆ MakeSolveOnce() [3/6]
◆ MakeSolveOnce() [4/6]
◆ MakeSolveOnce() [5/6]
◆ MakeSolveOnce() [6/6]
◆ MakeSortingConstraint()
| Constraint * operations_research::Solver::MakeSortingConstraint | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | sorted ) |
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
Definition at line 716 of file alldiff_cst.cc.
◆ MakeSplitVariableDomain()
| Decision * operations_research::Solver::MakeSplitVariableDomain | ( | IntVar * | var, |
| int64_t | val, | ||
| bool | start_with_lower_half ) |
◆ MakeSquare()
◆ MakeStatisticsModelVisitor()
| ModelVisitor * operations_research::Solver::MakeStatisticsModelVisitor | ( | ) |
Displays some nice statistics on the model.
Definition at line 813 of file utilities.cc.
◆ MakeStoreAssignment()
◆ MakeStrictDisjunctiveConstraint()
| DisjunctiveConstraint * operations_research::Solver::MakeStrictDisjunctiveConstraint | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::string & | name ) |
This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero durations cannot overlap with over intervals.
Definition at line 2613 of file resource.cc.
◆ MakeSubCircuit()
| Constraint * operations_research::Solver::MakeSubCircuit | ( | const std::vector< IntVar * > & | nexts | ) |
Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves.
Definition at line 645 of file graph_constraints.cc.
◆ MakeSum() [1/3]
◆ MakeSum() [2/3]
◆ MakeSum() [3/3]
◆ MakeSumEquality() [1/2]
| Constraint * operations_research::Solver::MakeSumEquality | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst ) |
◆ MakeSumEquality() [2/2]
| Constraint * operations_research::Solver::MakeSumEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar * | var ) |
◆ MakeSumGreaterOrEqual()
| Constraint * operations_research::Solver::MakeSumGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst ) |
◆ MakeSumLessOrEqual()
| Constraint * operations_research::Solver::MakeSumLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst ) |
◆ MakeSumObjectiveFilter() [1/2]
| IntVarLocalSearchFilter * operations_research::Solver::MakeSumObjectiveFilter | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::IndexEvaluator3 | values, | ||
| Solver::LocalSearchFilterBound | filter_enum ) |
◆ MakeSumObjectiveFilter() [2/2]
◆ MakeSymmetryManager() [1/5]
| SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | const std::vector< SymmetryBreaker * > & | visitors | ) |
◆ MakeSymmetryManager() [2/5]
◆ MakeSymmetryManager() [3/5]
◆ MakeSymmetryManager() [4/5]
◆ MakeSymmetryManager() [5/5]
◆ MakeTabuSearch()
| ObjectiveMonitor * operations_research::Solver::MakeTabuSearch | ( | bool | maximize, |
| IntVar * | objective, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | vars, | ||
| int64_t | keep_tenure, | ||
| int64_t | forbid_tenure, | ||
| double | tabu_factor ) |
MetaHeuristics which try to get the search out of local optima.
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.
◆ MakeTemporalDisjunction() [1/2]
This constraint implements a temporal disjunction between two interval vars.
Definition at line 408 of file timetabling.cc.
◆ MakeTemporalDisjunction() [2/2]
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).
Definition at line 402 of file timetabling.cc.
◆ MakeTimeLimit() [1/2]
| RegularLimit * operations_research::Solver::MakeTimeLimit | ( | absl::Duration | time | ) |
◆ MakeTimeLimit() [2/2]
|
inline |
◆ MakeTransitionConstraint() [1/2]
| Constraint * operations_research::Solver::MakeTransitionConstraint | ( | const std::vector< IntVar * > & | vars, |
| const IntTupleSet & | transition_table, | ||
| int64_t | initial_state, | ||
| const std::vector< int > & | final_states ) |
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.
◆ MakeTransitionConstraint() [2/2]
| Constraint * operations_research::Solver::MakeTransitionConstraint | ( | const std::vector< IntVar * > & | vars, |
| const IntTupleSet & | transition_table, | ||
| int64_t | initial_state, | ||
| const std::vector< int64_t > & | final_states ) |
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.
◆ MakeTrueConstraint()
| Constraint * operations_research::Solver::MakeTrueConstraint | ( | ) |
◆ MakeVariableDegreeVisitor()
| ModelVisitor * operations_research::Solver::MakeVariableDegreeVisitor | ( | absl::flat_hash_map< const IntVar *, int > * | map | ) |
Compute the number of constraints a variable is attached to.
Definition at line 817 of file utilities.cc.
◆ MakeVariableDomainFilter()
◆ MakeVariableGreaterOrEqualValue()
| Decision * operations_research::Solver::MakeVariableGreaterOrEqualValue | ( | IntVar * | var, |
| int64_t | value ) |
◆ MakeVariableLessOrEqualValue()
| Decision * operations_research::Solver::MakeVariableLessOrEqualValue | ( | IntVar * | var, |
| int64_t | value ) |
◆ MakeWeightedMaximize() [1/2]
| OptimizeVar * operations_research::Solver::MakeWeightedMaximize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int > & | weights, | ||
| int64_t | step ) |
◆ MakeWeightedMaximize() [2/2]
| OptimizeVar * operations_research::Solver::MakeWeightedMaximize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int64_t > & | weights, | ||
| int64_t | step ) |
◆ MakeWeightedMinimize() [1/2]
| OptimizeVar * operations_research::Solver::MakeWeightedMinimize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int > & | weights, | ||
| int64_t | step ) |
◆ MakeWeightedMinimize() [2/2]
| OptimizeVar * operations_research::Solver::MakeWeightedMinimize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int64_t > & | weights, | ||
| int64_t | step ) |
◆ MakeWeightedOptimize() [1/2]
| OptimizeVar * operations_research::Solver::MakeWeightedOptimize | ( | bool | maximize, |
| const std::vector< IntVar * > & | sub_objectives, | ||
| const std::vector< int > & | weights, | ||
| int64_t | step ) |
◆ MakeWeightedOptimize() [2/2]
| OptimizeVar * operations_research::Solver::MakeWeightedOptimize | ( | bool | maximize, |
| const std::vector< IntVar * > & | sub_objectives, | ||
| const std::vector< int64_t > & | weights, | ||
| int64_t | step ) |
◆ MemoryUsage()
|
static |
◆ model_name()
| std::string operations_research::Solver::model_name | ( | ) | const |
◆ MultiArmedBanditConcatenateOperators()
| LocalSearchOperator * operations_research::Solver::MultiArmedBanditConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, |
| double | memory_coefficient, | ||
| double | exploration_coefficient, | ||
| bool | maximize ) |
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.
Definition at line 2346 of file local_search.cc.
◆ NameAllVariables()
| bool operations_research::Solver::NameAllVariables | ( | ) | const |
◆ neighbors()
|
inline |
◆ NewSearch() [1/6]
◆ NewSearch() [2/6]
| void operations_research::Solver::NewSearch | ( | DecisionBuilder * | db, |
| const std::vector< SearchMonitor * > & | monitors ) |
Decomposed search. The code for a top level search should look like solver->NewSearch(db); while (solver->NextSolution()) { ///<.. use the current solution } solver()->EndSearch();
Definition at line 1842 of file constraint_solver.cc.
◆ NewSearch() [3/6]
◆ NewSearch() [4/6]
◆ NewSearch() [5/6]
◆ NewSearch() [6/6]
◆ NextSolution()
| bool operations_research::Solver::NextSolution | ( | ) |
◆ Now()
| absl::Time operations_research::Solver::Now | ( | ) | const |
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.
Definition at line 1555 of file constraint_solver.cc.
◆ operator=()
◆ optimization_direction()
|
inline |
◆ parameters()
◆ PopState()
| void operations_research::Solver::PopState | ( | ) |
◆ PushState()
| void operations_research::Solver::PushState | ( | ) |
The PushState and PopState methods manipulates the states of the reversible objects. They are visible only because they are useful to write unitary tests.
Definition at line 1589 of file constraint_solver.cc.
◆ Rand32()
|
inline |
◆ Rand64()
|
inline |
◆ RandomConcatenateOperators() [1/2]
Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor().
Definition at line 2169 of file local_search.cc.
◆ RandomConcatenateOperators() [2/2]
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.
Definition at line 2174 of file local_search.cc.
◆ RegisterDemon()
◆ RegisterIntervalVar()
Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary.
◆ RegisterIntExpr()
◆ RegisterIntVar()
◆ ReSeed()
|
inline |
◆ RestartCurrentSearch()
| void operations_research::Solver::RestartCurrentSearch | ( | ) |
◆ RestartSearch()
| void operations_research::Solver::RestartSearch | ( | ) |
◆ RevAlloc()
template<typename T>
|
inline |
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.
Definition at line 876 of file constraint_solver.h.
◆ RevAllocArray()
template<typename T>
|
inline |
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*.
Definition at line 888 of file constraint_solver.h.
◆ RunUncheckedLocalSearch()
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.
Definition at line 4887 of file local_search.cc.
◆ SaveAndAdd()
template<class T>
|
inline |
◆ SaveAndSetValue()
template<class T>
|
inline |
◆ SaveValue()
template<class T>
|
inline |
reversibility
SaveValue() saves the value of the corresponding object. It must be called before modifying the object. The value will be restored upon backtrack.
Definition at line 857 of file constraint_solver.h.
◆ SearchContext() [1/2]
| std::string operations_research::Solver::SearchContext | ( | ) | const |
◆ SearchContext() [2/2]
| std::string operations_research::Solver::SearchContext | ( | const Search * | search | ) | const |
◆ SearchDepth()
| int operations_research::Solver::SearchDepth | ( | ) | const |
Gets the search depth of the current active search. Returns -1 if there is no active search opened.
Definition at line 1201 of file constraint_solver.cc.
◆ SearchLeftDepth()
| int operations_research::Solver::SearchLeftDepth | ( | ) | const |
Gets the search left depth of the current active search. Returns -1 if there is no active search opened.
Definition at line 1203 of file constraint_solver.cc.
◆ set_context()
|
inline |
◆ set_fail_intercept()
|
inline |
◆ set_optimization_direction()
|
inline |
◆ SetBranchSelector()
| void operations_research::Solver::SetBranchSelector | ( | BranchSelector | bs | ) |
◆ SetGuidedLocalSearchPenaltyCallback()
|
inline |
◆ SetSearchContext()
| void operations_research::Solver::SetSearchContext | ( | Search * | search, |
| absl::string_view | search_context ) |
◆ SetUseFastLocalSearch()
|
inline |
enabled for metaheuristics. Disables/enables fast local search.
Definition at line 3164 of file constraint_solver.h.
◆ ShouldFail()
|
inline |
These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail.
Definition at line 3266 of file constraint_solver.h.
◆ solutions()
| int64_t operations_research::Solver::solutions | ( | ) | const |
◆ Solve() [1/6]
◆ Solve() [2/6]
| bool operations_research::Solver::Solve | ( | DecisionBuilder * | db, |
| const std::vector< SearchMonitor * > & | monitors ) |
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
- 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().
- Parameters
-
db The decision builder that will generate the search tree. 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.
Definition at line 1807 of file constraint_solver.cc.
◆ Solve() [3/6]
◆ Solve() [4/6]
◆ Solve() [5/6]
◆ Solve() [6/6]
◆ SolveAndCommit() [1/5]
◆ SolveAndCommit() [2/5]
| bool operations_research::Solver::SolveAndCommit | ( | DecisionBuilder * | db, |
| const std::vector< SearchMonitor * > & | monitors ) |
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.
Definition at line 2395 of file constraint_solver.cc.
◆ SolveAndCommit() [3/5]
◆ SolveAndCommit() [4/5]
◆ SolveAndCommit() [5/5]
◆ SolveDepth()
| int operations_research::Solver::SolveDepth | ( | ) | const |
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.
Definition at line 1197 of file constraint_solver.cc.
◆ stamp()
| uint64_t operations_research::Solver::stamp | ( | ) | const |
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.
Definition at line 1676 of file constraint_solver.cc.
◆ state()
|
inline |
◆ TopPeriodicCheck()
| void operations_research::Solver::TopPeriodicCheck | ( | ) |
Performs PeriodicCheck on the top-level search; for instance, can be called from a nested solve to check top-level limits.
Definition at line 1575 of file constraint_solver.cc.
◆ TopProgressPercent()
| int operations_research::Solver::TopProgressPercent | ( | ) |
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).
Definition at line 1577 of file constraint_solver.cc.
◆ Try() [1/4]
◆ Try() [2/4]
Creates a decision builder which will create a search tree where each decision builder is called from the top of the search tree. For instance the decision builder Try(db1, db2) will entirely explore the search tree of db1 then the one of db2, resulting in the following search tree: Tree root | / \ | db1 tree db2 tree | This is very handy to try a decision builder which partially explores the search space and if it fails to try another decision builder. "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.
◆ Try() [3/4]
◆ Try() [4/4]
◆ unchecked_solutions()
| int64_t operations_research::Solver::unchecked_solutions | ( | ) | const |
◆ UseFastLocalSearch()
|
inline |
◆ wall_time()
| int64_t operations_research::Solver::wall_time | ( | ) | const |
◆ BaseIntExpr
◆ Constraint
◆ DemonProfiler
|
friend class DemonProfiler |
friend |
◆ FindOneNeighbor
|
friend class FindOneNeighbor |
friend |
◆ InternalSaveBooleanVarValue
◆ IntVar
◆ LocalSearch
◆ LocalSearchProfiler
|
friend class LocalSearchProfiler |
friend |
◆ PropagationBaseObject
|
friend class PropagationBaseObject |
friend |
◆ Queue
◆ RevImmutableMultiMap
template<class K, class V>
|
friend class RevImmutableMultiMap |
friend |
◆ RoutingModel
|
friend class RoutingModel |
friend |
◆ SearchLimit
◆ SearchMonitor
|
friend class SearchMonitor |
friend |
◆ SimpleRevFIFO
template<class>
|
friend class SimpleRevFIFO |
friend |
◆ kNumPriorities
|
int operations_research::Solver::kNumPriorities = 3 |
staticconstexpr |
◆ tmp_vector_
std::vector<int64_t> operations_research::Solver::tmp_vector_
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.
Definition at line 3221 of file constraint_solver.h.
The documentation for this class was generated from the following files:
- ortools/constraint_solver/constraint_solver.h
- ortools/constraint_solver/alldiff_cst.cc
- ortools/constraint_solver/assignment.cc
- ortools/constraint_solver/constraint_solver.cc
- ortools/constraint_solver/constraints.cc
- ortools/constraint_solver/count_cst.cc
- ortools/constraint_solver/default_search.cc
- ortools/constraint_solver/demon_profiler.cc
- ortools/constraint_solver/deviation.cc
- ortools/constraint_solver/diffn.cc
- ortools/constraint_solver/element.cc
- ortools/constraint_solver/expr_array.cc
- ortools/constraint_solver/expr_cst.cc
- ortools/constraint_solver/expressions.cc
- ortools/constraint_solver/graph_constraints.cc
- ortools/constraint_solver/interval.cc
- ortools/constraint_solver/local_search.cc
- ortools/constraint_solver/model_cache.cc
- ortools/constraint_solver/pack.cc
- ortools/constraint_solver/range_cst.cc
- ortools/constraint_solver/resource.cc
- ortools/constraint_solver/sched_constraints.cc
- ortools/constraint_solver/sched_search.cc
- ortools/constraint_solver/search.cc
- ortools/constraint_solver/table.cc
- ortools/constraint_solver/timetabling.cc
- ortools/constraint_solver/trace.cc
- ortools/constraint_solver/utilities.cc