C++ Reference: class Solver
Note: This documentation is automatically generated.
Solver ClassA 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.
Method | |
---|---|
ABSL_DEPRECATED | Arguments: |
ABSL_DEPRECATED | Arguments: |
Accept | Return type: Arguments: Accepts the given model visitor. |
accepted_neighbors | Return type: The number of accepted neighbors. |
ActiveSearch | Return type: Returns the active search, nullptr outside search. |
AddBacktrackAction | Return type: Arguments: 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. |
AddCastConstraint | Return type: Arguments: 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. |
AddConstraint | Return type: Arguments: 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 not 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(...)); |
AddLocalSearchMonitor | Return type: Arguments: Adds the local search monitor to the solver. This is called internally when a propagation monitor is passed to the Solve() or NewSearch() method. |
AddPropagationMonitor | Return type: Arguments: Adds the propagation monitor to the solver. This is called internally when a propagation monitor is passed to the Solve() or NewSearch() method. |
balancing_decision | Return type: |
branches | Return type: The number of branches explored since the creation of the solver. |
Cache | Return type: Returns the cache of the model. |
CastExpression | Return type: Arguments: Internal. If the variables is the result of expr->Var(), this method returns expr, nullptr otherwise. |
CheckAssignment | Return type: Arguments: Checks whether the given assignment satisfies all relevant constraints. |
CheckConstraint | Return type: Arguments: 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. |
CheckFail | Return type: |
clear_fail_intercept | Return type: |
ClearLocalSearchState | Return type: Clears the local search state. |
Compose | Return type: Arguments: 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 | Return type: Arguments: |
Compose | Return type: Arguments: |
Compose | Return type: Arguments: |
ConcatenateOperators | Return type: Arguments: Creates a local search operator which concatenates a vector of operators. Each operator from the vector is called sequentially. By default, when a neighbor is found the neighborhood exploration restarts from the last active operator (the one which produced the neighbor). This can be overridden by setting restart to true to force the exploration to start from the first operator in the vector. The default behavior can also be overridden using an evaluation callback to set the order in which the operators are explored (the callback is called in LocalSearchOperator::Start()). The first argument of the callback is the index of the operator which produced the last move, the second argument is the index of the operator to be evaluated. Ownership of the callback is taken by ConcatenateOperators. Example: const int kPriorities = {10, 100, 10, 0}; int64_t Evaluate(int active_operator, int current_operator) { return kPriorities[current_operator]; } LocalSearchOperator* concat = solver.ConcatenateOperators(operators, NewPermanentCallback(&Evaluate)); The elements of the vector operators will be sorted by increasing priority and explored in that order (tie-breaks are handled by keeping the relative operator order in the vector). This would result in the following order: operators[3], operators[0], operators[2], operators[1]. |
ConcatenateOperators | Return type: Arguments: |
ConcatenateOperators | Return type: Arguments: |
const_parameters | Return type: Read-only. |
constraints | Return type: Counts the number of constraints that have been added to the solver before the search. |
CurrentlyInSolve | Return type: 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. |
DebugString | Return type: misc debug string. |
DefaultSolverParameters | Return type: Create a ConstraintSolverParameters proto with all the default values. TODO(user): Move to constraint_solver_parameters.h. |
demon_profiler | Return type: Access to demon profiler. |
demon_runs | Return type: Arguments: The number of demons executed during search for a given priority. |
EndSearch | Return type: |
ExportProfilingOverview | Return type: Arguments: Exports the profiling information in a human readable overview. The parameter profile_level used to create the solver must be set to true. |
Fail | Return type: Abandon the current branch in the search tree. A backtrack will follow. |
fail_stamp | Return type: The fail_stamp() is incremented after each backtrack. |
failures | Return type: The number of failures encountered since the creation of the solver. |
filtered_neighbors | Return type: The number of filtered neighbors (neighbors accepted by filters). |
FinishCurrentSearch | Return type: Tells the solver to kill or restart the current search. |
GetConstraintSolverStatistics | Return type: Returns detailed cp search statistics. |
GetLocalSearchMonitor | Return type: Returns the local search monitor. |
GetLocalSearchStatistics | Return type: Returns detailed local search statistics. |
GetOrCreateLocalSearchState | Return type: Returns (or creates) an assignment representing the state of local search. TODO(user): Investigate if this should be moved to Search. |
GetPropagationMonitor | Return type: Returns the propagation monitor. |
HasName | Return type: Arguments: Returns whether the object has been named or not. |
InstrumentsDemons | Return type: Returns whether we are instrumenting demons. |
InstrumentsVariables | Return type: Returns whether we are tracing variables. |
IntegerCastInfo | |
InternalSaveBooleanVarValue | Return type: Arguments: |
IsBooleanVar | Return type: Arguments: 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). |
IsLocalSearchProfilingEnabled | Return type: Returns whether we are profiling local search. |
IsProduct | Return type: Arguments: 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. |
IsProfilingEnabled | Return type: Returns whether we are profiling the solver. |
LocalSearchProfile | Return type: Returns local search profiling information in a human readable format. TODO(user): Merge demon and local search profiles. |
MakeAbs | Return type: Arguments: |expr| |
MakeAbsEquality | Return type: Arguments: Creates the constraint abs(var) == abs_var. |
MakeAcceptFilter | Return type: Local Search Filters |
MakeActionDemon | Return type: Arguments: Creates a demon from a callback. |
MakeAllDifferent | Return type: Arguments: All variables are pairwise different. This corresponds to the stronger version of the propagation algorithm. |
MakeAllDifferent | Return type: Arguments: 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. |
MakeAllDifferentExcept | Return type: Arguments: All variables are pairwise different, unless they are assigned to the escape value. |
MakeAllowedAssignments | Return type: Arguments: This method creates a constraint where the graph of the relation between the variables is given in extension. There are 'arity' variables involved in the relation and the graph is given by a integer tuple set. |
MakeAllowedAssignments | Return type: Arguments: Compatibility layer for Python API. |
MakeAllSolutionCollector | Return type: Arguments: Collect all solutions of the search. |
MakeAllSolutionCollector | Return type: Collect all solutions of the search. The variables will need to be added later. |
MakeApplyBranchSelector | Return type: Arguments: Creates a decision builder that will set the branch selector. |
MakeAssignment | Return type: This method creates an empty assignment. |
MakeAssignment | Return type: Arguments: This method creates an assignment which is a copy of 'a'. |
MakeAssignVariablesValues | Return type: Arguments: |
MakeAssignVariablesValuesOrDoNothing | Return type: Arguments: |
MakeAssignVariablesValuesOrFail | Return type: Arguments: |
MakeAssignVariableValue | Return type: Arguments: Decisions. |
MakeAssignVariableValueOrDoNothing | Return type: Arguments: |
MakeAssignVariableValueOrFail | Return type: Arguments: |
MakeAtMost | Return type: Arguments: |{i | vars[i] == value}| <= max_count |
MakeAtSolutionCallback | Return type: Arguments: |
MakeBestValueSolutionCollector | Return type: Arguments: 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). |
MakeBestValueSolutionCollector | Return type: Arguments: 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). The variables will need to be added later. |
MakeBetweenCt | Return type: Arguments: (l <= expr <= u) |
MakeBoolVar | Return type: Arguments: MakeBoolVar will create a variable with a {0, 1} domain. |
MakeBoolVar | Return type: MakeBoolVar will create a variable with a {0, 1} domain. |
MakeBoolVarArray | Return type: Arguments: This method will append the vector vars with 'var_count' boolean variables having name "name" where is the index of the variable. |
MakeBoolVarArray | Return type: Arguments: This method will append the vector vars with 'var_count' boolean variables having no names. |
MakeBoolVarArray | Return type: Arguments: Same but allocates an array and returns it. |
MakeBranchesLimit | Return type: Arguments: Creates a search limit that constrains the number of branches explored in the search tree. |
MakeCircuit | Return type: Arguments: Force the "nexts" variable to create a complete Hamiltonian path. |
MakeClosureDemon | Return type: Arguments: Creates a demon from a closure. |
MakeConditionalExpression | Return type: Arguments: Conditional Expr condition ? expr : unperformed_value |
MakeConstantRestart | Return type: Arguments: This search monitor will restart the search periodically after 'frequency' failures. |
MakeConstraintAdder | Return type: Arguments: Returns a decision builder that will add the given constraint to the model. |
MakeConstraintInitialPropagateCallback | Return type: Arguments: This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'. |
MakeConvexPiecewiseExpr | Return type: Arguments: Convex piecewise function. |
MakeCount | Return type: Arguments: |{i | vars[i] == value}| == max_count |
MakeCount | Return type: Arguments: |{i | vars[i] == value}| == max_count |
MakeCover | Return type: Arguments: 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. |
MakeCumulative | Return type: Arguments: This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint. |
MakeCumulative | Return type: Arguments: This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint. |
MakeCumulative | Return type: Arguments: This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint. |
MakeCumulative | Return type: Arguments: This constraint enforces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint. |
MakeCumulative | Return type: Arguments: This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should be positive. |
MakeCumulative | Return type: Arguments: This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. Intervals and demands should be vectors of equal size. Demands should be positive. |
MakeCustomLimit | Return type: Arguments: Callback-based search limit. Search stops when limiter returns true; if this happens at a leaf the corresponding solution will be rejected. |
MakeDecision | Return type: Arguments: |
MakeDecisionBuilderFromAssignment | Return type: Arguments: Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'. |
MakeDefaultPhase | Return type: Arguments: |
MakeDefaultPhase | Return type: Arguments: |
MakeDefaultRegularLimitParameters | Return type: Creates a regular limit proto containing default values. |
MakeDefaultSolutionPool | Return type: Solution Pool. |
MakeDelayedConstraintInitialPropagateCallback | Return type: Arguments: This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority. |
MakeDelayedPathCumul | Return type: Arguments: Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated. TODO(user): Merge with other path-cumuls constraints. |
MakeDeviation | Return type: Arguments: Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = #vars |
MakeDifference | Return type: Arguments: left - right |
MakeDifference | Return type: Arguments: value - expr |
MakeDisjunctiveConstraint | Return type: Arguments: This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero duration can be scheduled anywhere. |
MakeDistribute | Return type: Arguments: Aggregated version of count: |{i | v[i] == values[j]}| == cards[j] |
MakeDistribute | Return type: Arguments: Aggregated version of count: |{i | v[i] == values[j]}| == cards[j] |
MakeDistribute | Return type: Arguments: Aggregated version of count: |{i | v[i] == j}| == cards[j] |
MakeDistribute | Return type: Arguments: Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min <= |{i | v[i] == j}| <= card_max |
MakeDistribute | Return type: Arguments: Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j] |
MakeDistribute | Return type: Arguments: Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j] |
MakeDistribute | Return type: Arguments: 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] |
MakeDistribute | Return type: Arguments: 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] |
MakeDiv | Return type: Arguments: expr / value (integer division) |
MakeDiv | Return type: Arguments: numerator / denominator (integer division). Terms need to be positive. |
MakeElement | Return type: Arguments: values[index] |
MakeElement | Return type: Arguments: values[index] |
MakeElement | Return type: Arguments: 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). |
MakeElement | Return type: Arguments: 2D version of function-based element expression, values(expr1, expr2). |
MakeElement | Return type: Arguments: vars[expr] |
MakeElement | Return type: Arguments: vars(argument) |
MakeElementEquality | Return type: Arguments: |
MakeElementEquality | Return type: Arguments: |
MakeElementEquality | Return type: Arguments: |
MakeElementEquality | Return type: Arguments: |
MakeEnterSearchCallback | Return type: Arguments: ----- Callback-based search monitors ----- |
MakeEquality | Return type: Arguments: left == right |
MakeEquality | Return type: Arguments: expr == value |
MakeEquality | Return type: Arguments: expr == value |
MakeEquality | Return type: Arguments: This constraints states that the two interval variables are equal. |
MakeExitSearchCallback | Return type: Arguments: |
MakeFailDecision | Return type: |
MakeFailuresLimit | Return type: Arguments: Creates a search limit that constrains the number of failures that can happen when exploring the search tree. |
MakeFalseConstraint | Return type: This constraint always fails. |
MakeFalseConstraint | Return type: Arguments: |
MakeFirstSolutionCollector | Return type: Arguments: Collect the first solution of the search. |
MakeFirstSolutionCollector | Return type: Collect the first solution of the search. The variables will need to be added later. |
MakeFixedDurationEndSyncedOnEndIntervalVar | Return type: Arguments: 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. |
MakeFixedDurationEndSyncedOnStartIntervalVar | Return type: Arguments: 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. |
MakeFixedDurationIntervalVar | Return type: Arguments: 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. |
MakeFixedDurationIntervalVar | Return type: Arguments: Creates a performed interval var with a fixed duration. The duration must be greater than 0. |
MakeFixedDurationIntervalVar | Return type: Arguments: Creates an interval var with a fixed duration, and performed_variable. The duration must be greater than 0. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with 'count' interval variables built with the corresponding parameters. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with 'count' interval var built with the corresponding start variables. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with interval variables built with the corresponding start variables. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with interval variables built with the corresponding start variables. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with interval variables built with the corresponding start and performed variables. |
MakeFixedDurationIntervalVarArray | Return type: Arguments: This method fills the vector with interval variables built with the corresponding start and performed variables. |
MakeFixedDurationStartSyncedOnEndIntervalVar | Return type: Arguments: 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. |
MakeFixedDurationStartSyncedOnStartIntervalVar | Return type: Arguments: 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. |
MakeFixedInterval | Return type: Arguments: Creates a fixed and performed interval. |
MakeGenericTabuSearch | Return type: Arguments: Creates a Tabu Search based on the vars |vars|. A solution is "tabu" if all the vars in |vars| keep their value. |
MakeGreater | Return type: Arguments: left > right |
MakeGreater | Return type: Arguments: expr > value |
MakeGreater | Return type: Arguments: expr > value |
MakeGreaterOrEqual | Return type: Arguments: left >= right |
MakeGreaterOrEqual | Return type: Arguments: expr >= value |
MakeGreaterOrEqual | Return type: Arguments: expr >= value |
MakeGuidedLocalSearch | Return type: Arguments: Creates a Guided Local Search monitor. Description here: http://en.wikipedia.org/wiki/Guided_Local_Search |
MakeGuidedLocalSearch | Return type: Arguments: |
MakeIfThenElseCt | Return type: Arguments: Special cases with arrays of size two. |
MakeImprovementLimit | Return type: Arguments: Limits the search based on the improvements of 'objective_var'. Stops the search when the improvement rate gets lower than a threshold value. This threshold value is computed based on the improvement rate during the first phase of the search. |
MakeIndexExpression | Return type: Arguments: Returns the expression expr such that vars[expr] == value. It assumes that vars are all different. |
MakeIndexOfConstraint | Return type: Arguments: 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. |
MakeIndexOfFirstMaxValueConstraint | Return type: Arguments: Creates a constraint that binds the index variable to the index of the first variable with the maximum value. |
MakeIndexOfFirstMinValueConstraint | Return type: Arguments: Creates a constraint that binds the index variable to the index of the first variable with the minimum value. |
MakeIntConst | Return type: Arguments: IntConst will create a constant expression. |
MakeIntConst | Return type: Arguments: IntConst will create a constant expression. |
MakeIntervalRelaxedMax | Return type: Arguments: 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. |
MakeIntervalRelaxedMin | Return type: Arguments: 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. |
MakeIntervalVar | Return type: Arguments: Creates an interval var by specifying the bounds on start, duration, and end. |
MakeIntervalVarArray | Return type: Arguments: This method fills the vector with 'count' interval var built with the corresponding parameters. |
MakeIntervalVarRelation | Return type: Arguments: This method creates a relation between an interval var and a date. |
MakeIntervalVarRelation | Return type: Arguments: This method creates a relation between two interval vars. |
MakeIntervalVarRelationWithDelay | Return type: Arguments: 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. |
MakeIntVar | Return type: Arguments: MakeIntVar will create the best range based int var for the bounds given. |
MakeIntVar | Return type: Arguments: MakeIntVar will create a variable with the given sparse domain. |
MakeIntVar | Return type: Arguments: MakeIntVar will create a variable with the given sparse domain. |
MakeIntVar | Return type: Arguments: MakeIntVar will create the best range based int var for the bounds given. |
MakeIntVar | Return type: Arguments: MakeIntVar will create a variable with the given sparse domain. |
MakeIntVar | Return type: Arguments: MakeIntVar will create a variable with the given sparse domain. |
MakeIntVarArray | Return type: Arguments: This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having name "name" where is the index of the variable. |
MakeIntVarArray | Return type: Arguments: This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having no names. |
MakeIntVarArray | Return type: Arguments: Same but allocates an array and returns it. |
MakeInversePermutationConstraint | Return type: Arguments: 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. |
MakeIsBetweenCt | Return type: Arguments: b == (l <= expr <= u) |
MakeIsBetweenVar | Return type: Arguments: |
MakeIsDifferentCstCt | Return type: Arguments: boolvar == (var != value) |
MakeIsDifferentCstVar | Return type: Arguments: status var of (var != value) |
MakeIsDifferentCt | Return type: Arguments: b == (v1 != v2) |
MakeIsDifferentVar | Return type: Arguments: status var of (v1 != v2) |
MakeIsEqualCstCt | Return type: Arguments: boolvar == (var == value) |
MakeIsEqualCstVar | Return type: Arguments: status var of (var == value) |
MakeIsEqualCt | Return type: Arguments: b == (v1 == v2) |
MakeIsEqualVar | Return type: Arguments: status var of (v1 == v2) |
MakeIsGreaterCstCt | Return type: Arguments: b == (v > c) |
MakeIsGreaterCstVar | Return type: Arguments: status var of (var > value) |
MakeIsGreaterCt | Return type: Arguments: b == (left > right) |
MakeIsGreaterOrEqualCstCt | Return type: Arguments: boolvar == (var >= value) |
MakeIsGreaterOrEqualCstVar | Return type: Arguments: status var of (var >= value) |
MakeIsGreaterOrEqualCt | Return type: Arguments: b == (left >= right) |
MakeIsGreaterOrEqualVar | Return type: Arguments: status var of (left >= right) |
MakeIsGreaterVar | Return type: Arguments: status var of (left > right) |
MakeIsLessCstCt | Return type: Arguments: b == (v < c) |
MakeIsLessCstVar | Return type: Arguments: status var of (var < value) |
MakeIsLessCt | Return type: Arguments: b == (left < right) |
MakeIsLessOrEqualCstCt | Return type: Arguments: boolvar == (var <= value) |
MakeIsLessOrEqualCstVar | Return type: Arguments: status var of (var <= value) |
MakeIsLessOrEqualCt | Return type: Arguments: b == (left <= right) |
MakeIsLessOrEqualVar | Return type: Arguments: status var of (left <= right) |
MakeIsLessVar | Return type: Arguments: status var of (left < right) |
MakeIsMemberCt | Return type: Arguments: boolvar == (expr in set) |
MakeIsMemberCt | Return type: Arguments: |
MakeIsMemberVar | Return type: Arguments: |
MakeIsMemberVar | Return type: Arguments: |
MakeLastSolutionCollector | Return type: Arguments: Collect the last solution of the search. |
MakeLastSolutionCollector | Return type: Collect the last solution of the search. The variables will need to be added later. |
MakeLess | Return type: Arguments: left < right |
MakeLess | Return type: Arguments: expr < value |
MakeLess | Return type: Arguments: expr < value |
MakeLessOrEqual | Return type: Arguments: left <= right |
MakeLessOrEqual | Return type: Arguments: expr <= value |
MakeLessOrEqual | Return type: Arguments: expr <= value |
MakeLexicalLess | Return type: Arguments: Creates a constraint that enforces that left is lexicographically less than right. |
MakeLexicalLessOrEqual | Return type: Arguments: Creates a constraint that enforces that left is lexicographically less than or equal to right. |
MakeLimit | Return type: Arguments: Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits. 'smart_time_check' reduces the calls to the wall timer by estimating the number of remaining calls, and 'cumulative' means that the limit applies cumulatively, instead of search-by-search. |
MakeLimit | Return type: Arguments: Creates a search limit from its protobuf description |
MakeLimit | Return type: Arguments: |
MakeLimit | Return type: Arguments: Creates a search limit that is reached when either of the underlying limit is reached. That is, the returned limit is more stringent than both argument limits. |
MakeLocalSearchPhase | Return type: Arguments: |
MakeLocalSearchPhase | Return type: Arguments: |
MakeLocalSearchPhase | Return type: Arguments: Variant with a sub_decison_builder specific to the first solution. |
MakeLocalSearchPhase | Return type: Arguments: |
MakeLocalSearchPhaseParameters | Return type: Arguments: Local Search Phase Parameters |
MakeLocalSearchPhaseParameters | Return type: Arguments: |
MakeLocalSearchPhaseParameters | Return type: Arguments: |
MakeLocalSearchPhaseParameters | Return type: Arguments: |
MakeLocalSearchPhaseParameters | Return type: Arguments: |
MakeLocalSearchPhaseParameters | Return type: Arguments: |
MakeLubyRestart | Return type: Arguments: This search monitor will restart the search periodically. At the iteration n, it will restart after scale_factor * Luby(n) failures where Luby is the Luby Strategy (i.e. 1 1 2 1 1 2 4 1 1 2 1 1 2 4 8...). |
MakeMapDomain | Return type: Arguments: 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); |
MakeMax | Return type: Arguments: std::max(vars) |
MakeMax | Return type: Arguments: std::max(left, right) |
MakeMax | Return type: Arguments: std::max(expr, value) |
MakeMax | Return type: Arguments: std::max(expr, value) |
MakeMaxEquality | Return type: Arguments: |
MakeMaximize | Return type: Arguments: Creates a maximization objective. |
MakeMemberCt | Return type: Arguments: expr in set. Propagation is lazy, i.e. this constraint does not creates holes in the domain of the variable. |
MakeMemberCt | Return type: Arguments: |
MakeMin | Return type: Arguments: std::min(vars) |
MakeMin | Return type: Arguments: std::min (left, right) |
MakeMin | Return type: Arguments: std::min(expr, value) |
MakeMin | Return type: Arguments: std::min(expr, value) |
MakeMinEquality | Return type: Arguments: |
MakeMinimize | Return type: Arguments: Creates a minimization objective. |
MakeMirrorInterval | Return type: Arguments: Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis. |
MakeModulo | Return type: Arguments: Modulo expression x % mod (with the python convention for modulo). |
MakeModulo | Return type: Arguments: Modulo expression x % mod (with the python convention for modulo). |
MakeMonotonicElement | Return type: Arguments: 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. |
MakeMoveTowardTargetOperator | Return type: Arguments: 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. |
MakeMoveTowardTargetOperator | Return type: Arguments: 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. |
MakeNBestValueSolutionCollector | Return type: Arguments: Same as MakeBestValueSolutionCollector but collects the best solution_count solutions. Collected solutions are sorted in increasing optimality order (the best solution is the last one). |
MakeNBestValueSolutionCollector | Return type: Arguments: |
MakeNeighborhoodLimit | Return type: Arguments: 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. |
MakeNestedOptimize | Return type: Arguments: 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 | Return type: Arguments: |
MakeNestedOptimize | Return type: Arguments: |
MakeNestedOptimize | Return type: Arguments: |
MakeNestedOptimize | Return type: Arguments: |
MakeNestedOptimize | Return type: Arguments: |
MakeNoCycle | Return type: Arguments: 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. |
MakeNoCycle | Return type: Arguments: |
MakeNonEquality | Return type: Arguments: left != right |
MakeNonEquality | Return type: Arguments: expr != value |
MakeNonEquality | Return type: Arguments: expr != value |
MakeNonOverlappingBoxesConstraint | Return type: Arguments: 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. |
MakeNonOverlappingBoxesConstraint | Return type: Arguments: |
MakeNonOverlappingBoxesConstraint | Return type: Arguments: |
MakeNonOverlappingNonStrictBoxesConstraint | Return type: Arguments: 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. |
MakeNonOverlappingNonStrictBoxesConstraint | Return type: Arguments: |
MakeNonOverlappingNonStrictBoxesConstraint | Return type: Arguments: |
MakeNotBetweenCt | Return type: Arguments: (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. |
MakeNotMemberCt | Return type: Arguments: expr not in set. |
MakeNotMemberCt | Return type: Arguments: |
MakeNotMemberCt | Return type: Arguments: expr should not be in the list of forbidden intervals [start[i]..end[i]]. |
MakeNotMemberCt | Return type: Arguments: expr should not be in the list of forbidden intervals [start[i]..end[i]]. |
MakeNotMemberCt | Return type: Arguments: expr should not be in the list of forbidden intervals. |
MakeNullIntersect | Return type: Arguments: 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. |
MakeNullIntersectExcept | Return type: Arguments: 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. |
MakeOperator | Return type: Arguments: Local Search Operators. |
MakeOperator | Return type: Arguments: |
MakeOperator | Return type: Arguments: TODO(user): Make the callback an IndexEvaluator2 when there are no secondary variables. |
MakeOperator | Return type: Arguments: |
MakeOpposite | Return type: Arguments: -expr |
MakeOptimize | Return type: Arguments: Creates a objective with a given sense (true = maximization). |
MakePack | Return type: Arguments: 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 | Return type: Arguments: Constraint enforcing that status[i] is true iff there's a path defined on next variables from sources[i] to sinks[i]. TODO(user): Only does checking on WhenBound events on next variables. Check whether more propagation is needed. |
MakePathCumul | Return type: Arguments: 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. |
MakePathCumul | Return type: Arguments: 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. |
MakePathCumul | Return type: Arguments: 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. |
MakePathPrecedenceConstraint | Return type: Arguments: Constraint enforcing, for each pair (i,j) in precedences, i to be before j in paths defined by next variables. TODO(user): This constraint does not make holes in variable domains; the implementation can easily be modified to do that; evaluate the impact on models solved with local search. |
MakePathPrecedenceConstraint | Return type: Arguments: 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). |
MakePathTransitPrecedenceConstraint | Return type: Arguments: 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. |
MakePhase | Return type: Arguments: Phases on IntVar arrays. TODO(user): name each of them differently, and document them (and do that for all other functions that have several homonyms in this .h). |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: var_val1_val2_comparator(var, val1, val2) is true iff assigning value "val1" to variable "var" is better than assigning value "val2". |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: Shortcuts for small arrays. |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: |
MakePhase | Return type: Arguments: 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 | Return type: Arguments: 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 | Return type: Arguments: Scheduling phases. |
MakePhase | Return type: Arguments: |
MakePiecewiseLinearExpr | Return type: Arguments: |
MakePower | Return type: Arguments: expr ^ n (n > 0) |
MakePrintModelVisitor | Return type: Prints the model. |
MakeProd | Return type: Arguments: left * right |
MakeProd | Return type: Arguments: expr * value |
MakeProfiledDecisionBuilderWrapper | Return type: Arguments: Activates profiling on a decision builder. |
MakeRandomLnsOperator | Return type: Arguments: 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. |
MakeRandomLnsOperator | Return type: Arguments: |
MakeRankFirstInterval | Return type: Arguments: Returns a decision that tries to rank first the ith interval var in the sequence variable. |
MakeRankLastInterval | Return type: Arguments: Returns a decision that tries to rank last the ith interval var in the sequence variable. |
MakeRejectFilter | Return type: |
MakeRestoreAssignment | Return type: Arguments: Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore()) |
MakeScalProd | Return type: Arguments: scalar product |
MakeScalProd | Return type: Arguments: scalar product |
MakeScalProdEquality | Return type: Arguments: |
MakeScalProdEquality | Return type: Arguments: |
MakeScalProdEquality | Return type: Arguments: |
MakeScalProdEquality | Return type: Arguments: |
MakeScalProdGreaterOrEqual | Return type: Arguments: |
MakeScalProdGreaterOrEqual | Return type: Arguments: |
MakeScalProdLessOrEqual | Return type: Arguments: |
MakeScalProdLessOrEqual | Return type: Arguments: |
MakeScheduleOrExpedite | Return type: Arguments: 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. |
MakeScheduleOrPostpone | Return type: Arguments: 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. |
MakeSearchLog | Return type: Arguments: The SearchMonitors below will display a periodic search log on LOG(INFO) every branch_period branches explored. |
MakeSearchLog | Return type: Arguments: At each solution, this monitor also display the var value. |
MakeSearchLog | Return type: Arguments: At each solution, this monitor will also display result of @p display_callback. |
MakeSearchLog | Return type: Arguments: At each solution, this monitor will display the 'var' value and the result of @p display_callback. |
MakeSearchLog | Return type: Arguments: OptimizeVar Search Logs At each solution, this monitor will also display the 'opt_var' value. |
MakeSearchLog | Return type: Arguments: Creates a search monitor that will also print the result of the display callback. |
MakeSearchLog | Return type: Arguments: |
MakeSearchTrace | Return type: Arguments: Creates a search monitor that will trace precisely the behavior of the search. Use this only for low level debugging. |
MakeSemiContinuousExpr | Return type: Arguments: Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0 |
MakeSimulatedAnnealing | Return type: Arguments: Creates a Simulated Annealing monitor. TODO(user): document behavior |
MakeSolutionsLimit | Return type: Arguments: Creates a search limit that constrains the number of solutions found during the search. |
MakeSolveOnce | Return type: Arguments: 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 | Return type: Arguments: |
MakeSolveOnce | Return type: Arguments: |
MakeSolveOnce | Return type: Arguments: |
MakeSolveOnce | Return type: Arguments: |
MakeSolveOnce | Return type: Arguments: |
MakeSortingConstraint | Return type: Arguments: 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 |
MakeSplitVariableDomain | Return type: Arguments: |
MakeSquare | Return type: Arguments: expr * expr |
MakeStatisticsModelVisitor | Return type: Displays some nice statistics on the model. |
MakeStoreAssignment | Return type: Arguments: Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store()) |
MakeStrictDisjunctiveConstraint | Return type: Arguments: This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero durations cannot overlap with over intervals. |
MakeSubCircuit | Return type: Arguments: Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves. |
MakeSum | Return type: Arguments: left + right. |
MakeSum | Return type: Arguments: expr + value. |
MakeSum | Return type: Arguments: sum of all vars. |
MakeSumEquality | Return type: Arguments: |
MakeSumEquality | Return type: Arguments: |
MakeSumGreaterOrEqual | Return type: Arguments: |
MakeSumLessOrEqual | Return type: Arguments: Variation on arrays. |
MakeSumObjectiveFilter | Return type: Arguments: |
MakeSumObjectiveFilter | Return type: Arguments: |
MakeSymmetryManager | Return type: Arguments: Symmetry Breaking. |
MakeSymmetryManager | Return type: Arguments: |
MakeSymmetryManager | Return type: Arguments: |
MakeSymmetryManager | Return type: Arguments: |
MakeSymmetryManager | Return type: Arguments: |
MakeTabuSearch | Return type: Arguments: |
MakeTemporalDisjunction | Return type: Arguments: 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). |
MakeTemporalDisjunction | Return type: Arguments: This constraint implements a temporal disjunction between two interval vars. |
MakeTimeLimit | Return type: Arguments: Creates a search limit that constrains the running time. |
MakeTimeLimit | Return type: Arguments: |
MakeTransitionConstraint | Return type: Arguments: 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 | Return type: Arguments: 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 | Return type: Arguments: |
MakeTrueConstraint | Return type: This constraint always succeeds. |
MakeVariableDegreeVisitor | Return type: Arguments: Compute the number of constraints a variable is attached to. |
MakeVariableDomainFilter | Return type: |
MakeVariableGreaterOrEqualValue | Return type: Arguments: |
MakeVariableLessOrEqualValue | Return type: Arguments: |
MakeWeightedMaximize | Return type: Arguments: Creates a maximization weigthed objective. |
MakeWeightedMaximize | Return type: Arguments: Creates a maximization weigthed objective. |
MakeWeightedMinimize | Return type: Arguments: Creates a minimization weighted objective. The actual objective is scalar_prod(sub_objectives, weights). |
MakeWeightedMinimize | Return type: Arguments: Creates a minimization weighted objective. The actual objective is scalar_prod(sub_objectives, weights). |
MakeWeightedOptimize | Return type: Arguments: Creates a weighted objective with a given sense (true = maximization). |
MakeWeightedOptimize | Return type: Arguments: Creates a weighted objective with a given sense (true = maximization). |
MemoryUsage | Return type: Current memory usage in bytes |
model_name | Return type: Returns the name of the model. |
MultiArmedBanditConcatenateOperators | Return type: Arguments: 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. |
NameAllVariables | Return type: Returns whether all variables should be named. |
neighbors | Return type: The number of neighbors created. |
NewSearch | Return type: Arguments: |
NewSearch | Return type: Arguments: |
NewSearch | Return type: Arguments: |
NewSearch | Return type: Arguments: |
NewSearch | Return type: Arguments: |
NewSearch | Return type: Arguments: |
NextSolution | Return type: |
Now | Return type: 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. |
optimization_direction | Return type: The direction of optimization, getter and setter. |
parameters | Return type: Stored Parameters. |
PopState | Return type: |
PushState | Return type: The PushState and PopState methods manipulates the states of the reversible objects. They are visible only because they are useful to write unitary tests. |
Rand32 | Return type: Arguments: Returns a random value between 0 and 'size' - 1; |
Rand64 | Return type: Arguments: Returns a random value between 0 and 'size' - 1; |
RandomConcatenateOperators | Return type: Arguments: Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). |
RandomConcatenateOperators | Return type: Arguments: 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. |
RegisterDemon | Return type: Arguments: Adds a new demon and wraps it inside a DemonProfiler if necessary. |
RegisterIntervalVar | Return type: Arguments: Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary. |
RegisterIntExpr | Return type: Arguments: Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary. |
RegisterIntVar | Return type: Arguments: Registers a new IntVar and wraps it inside a TraceIntVar if necessary. |
ReSeed | Return type: Arguments: Reseed the solver random generator. |
RestartCurrentSearch | Return type: |
RestartSearch | Return type: |
RevAlloc | Return type: Arguments: |
RevAllocArray | Return type: Arguments: |
SaveAndAdd | Return type: Arguments: |
SaveAndSetValue | Return type: Arguments: |
SaveValue | Return type: Arguments: |
SearchContext | Return type: |
SearchContext | Return type: Arguments: |
SearchDepth | Return type: Gets the search depth of the current active search. Returns -1 if there is no active search opened. |
SearchLeftDepth | Return type: Gets the search left depth of the current active search. Returns -1 if there is no active search opened. |
set_fail_intercept | Return type: Arguments: |
set_optimization_direction | Return type: Arguments: |
SetBranchSelector | Return type: Arguments: Sets the given branch selector on the current active search. |
SetSearchContext | Return type: Arguments: |
SetUseFastLocalSearch | Return type: Arguments: TODO(user): Get rid of the following methods once fast local search is enabled for metaheuristics. Disables/enables fast local search. |
ShouldFail | Return type: These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail. |
solutions | Return type: The number of solutions found since the start of the search. |
Solve | Return type: Arguments: @{ Solves the problem using the given DecisionBuilder and returns true if a solution was found and accepted. These methods are the ones most users should use to search for a solution. Note that the definition of 'solution' is subtle. A solution here is defined as a leaf of the search tree with respect to the given decision builder for which there is no failure. What this means is that, contrary to intuition, a solution may not have all variables of the model bound. It is the responsibility of the decision builder to keep returning decisions until all variables are indeed bound. The most extreme counterexample is calling Solve with a trivial decision builder whose Next() method always returns nullptr. In this case, Solve immediately returns 'true', since not assigning any variable to any value is a solution, unless the root node propagation discovers that the model is infeasible. This function must be called either from outside of search, or from within the Next() method of a decision builder. Solve will terminate whenever any of the following event arise: * A search monitor asks the solver to terminate the search by calling solver()->FinishCurrentSearch(). * A solution is found that is accepted by all search monitors, and none of the search monitors decides to search for another one. Upon search termination, there will be a series of backtracks all the way to the top level. This means that a user cannot expect to inspect the solution by querying variables after a call to Solve(): all the information will be lost. In order to do something with the solution, the user must either: * Use a search monitor that can process such a leaf. See, in particular, the SolutionCollector class. * Do not use Solve. Instead, use the more fine-grained approach using methods NewSearch(...), NextSolution(), and EndSearch(). @param db The decision builder that will generate the search tree. @param 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. |
Solve | Return type: Arguments: |
Solve | Return type: Arguments: |
Solve | Return type: Arguments: |
Solve | Return type: Arguments: |
Solve | Return type: Arguments: |
SolveAndCommit | Return type: Arguments: 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. |
SolveAndCommit | Return type: Arguments: |
SolveAndCommit | Return type: Arguments: |
SolveAndCommit | Return type: Arguments: |
SolveAndCommit | Return type: Arguments: |
SolveDepth | Return type: 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. |
Solver | Return type: Arguments: Solver API |
Solver | Arguments: |
~Solver | |
stamp | Return type: 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. |
state | Return type: State of the solver. |
TopPeriodicCheck | Return type: Performs PeriodicCheck on the top-level search; for instance, can be called from a nested solve to check top-level limits. |
TopProgressPercent | Return type: 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). |
Try | Return type: Arguments: 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. TODO(user): The search tree can be balanced by using binary "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 | Return type: Arguments: |
Try | Return type: Arguments: |
Try | Return type: Arguments: |
unchecked_solutions | Return type: The number of unchecked solutions found by local search. |
UseFastLocalSearch | Return type: Returns true if fast local search is enabled. |
wall_time | Return type: DEPRECATED: Use Now() instead. Time elapsed, in ms since the creation of the solver. |