![]() |
OR-Tools
9.3
|
Solver Class.
A solver represents the main computation engine. It implements the entire range of Constraint Programming protocols:
Usually, Constraint Programming code consists of
For the time being, Solver is neither MT_SAFE nor MT_HOT.
Definition at line 245 of file constraint_solver.h.
Classes | |
| struct | IntegerCastInfo |
| Holds semantic information stating that the 'expression' has been cast into 'variable' using the Var() method, and that 'maintainer' is responsible for maintaining the equality between 'variable' and 'expression'. More... | |
| struct | SearchLogParameters |
| Creates a search monitor from logging parameters. More... | |
Public Types | |
| enum | IntVarStrategy { INT_VAR_DEFAULT , INT_VAR_SIMPLE , CHOOSE_FIRST_UNBOUND , CHOOSE_RANDOM , CHOOSE_MIN_SIZE_LOWEST_MIN , CHOOSE_MIN_SIZE_HIGHEST_MIN , CHOOSE_MIN_SIZE_LOWEST_MAX , CHOOSE_MIN_SIZE_HIGHEST_MAX , CHOOSE_LOWEST_MIN , CHOOSE_HIGHEST_MAX , CHOOSE_MIN_SIZE , CHOOSE_MAX_SIZE , CHOOSE_MAX_REGRET_ON_MIN , CHOOSE_PATH } |
| This enum describes the strategy used to select the next branching variable at each node during the search. More... | |
| enum | IntValueStrategy { INT_VALUE_DEFAULT , INT_VALUE_SIMPLE , ASSIGN_MIN_VALUE , ASSIGN_MAX_VALUE , ASSIGN_RANDOM_VALUE , ASSIGN_CENTER_VALUE , SPLIT_LOWER_HALF , SPLIT_UPPER_HALF } |
| This enum describes the strategy used to select the next variable value to set. More... | |
| enum | EvaluatorStrategy { CHOOSE_STATIC_GLOBAL_BEST , CHOOSE_DYNAMIC_GLOBAL_BEST } |
| This enum is used by Solver::MakePhase to specify how to select variables and values during the search. More... | |
| enum | SequenceStrategy { SEQUENCE_DEFAULT , SEQUENCE_SIMPLE , CHOOSE_MIN_SLACK_RANK_FORWARD , CHOOSE_RANDOM_RANK_FORWARD } |
| Used for scheduling. Not yet implemented. More... | |
| enum | IntervalStrategy { INTERVAL_DEFAULT , INTERVAL_SIMPLE , INTERVAL_SET_TIMES_FORWARD , INTERVAL_SET_TIMES_BACKWARD } |
| This enum describes the straregy used to select the next interval variable and its value to be fixed. More... | |
| enum | LocalSearchOperators { TWOOPT , OROPT , RELOCATE , EXCHANGE , CROSS , MAKEACTIVE , MAKEINACTIVE , MAKECHAININACTIVE , SWAPACTIVE , EXTENDEDSWAPACTIVE , PATHLNS , FULLPATHLNS , UNACTIVELNS , INCREMENT , DECREMENT , SIMPLELNS } |
| This enum is used in Solver::MakeOperator to specify the neighborhood to create. More... | |
| enum | EvaluatorLocalSearchOperators { LK , TSPOPT , TSPLNS } |
| This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create. More... | |
| enum | LocalSearchFilterBound { GE , LE , EQ } |
| This enum is used in Solver::MakeLocalSearchObjectiveFilter. More... | |
| enum | DemonPriority { DELAYED_PRIORITY = 0 , VAR_PRIORITY = 1 , NORMAL_PRIORITY = 2 } |
| This enum represents the three possible priorities for a demon in the Solver queue. More... | |
| enum | BinaryIntervalRelation { ENDS_AFTER_END , ENDS_AFTER_START , ENDS_AT_END , ENDS_AT_START , STARTS_AFTER_END , STARTS_AFTER_START , STARTS_AT_END , STARTS_AT_START , STAYS_IN_SYNC } |
| This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2. More... | |
| enum | UnaryIntervalRelation { ENDS_AFTER , ENDS_AT , ENDS_BEFORE , STARTS_AFTER , STARTS_AT , STARTS_BEFORE , CROSS_DATE , AVOID_DATE } |
| This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d. More... | |
| enum | DecisionModification { NO_CHANGE , KEEP_LEFT , KEEP_RIGHT , KILL_BOTH , SWITCH_BRANCHES } |
| The Solver is responsible for creating the search tree. More... | |
| enum | MarkerType { SENTINEL , SIMPLE_MARKER , CHOICE_POINT , REVERSIBLE_ACTION } |
| This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree. More... | |
| enum | SolverState { OUTSIDE_SEARCH , IN_ROOT_NODE , IN_SEARCH , AT_SOLUTION , NO_MORE_SOLUTIONS , PROBLEM_INFEASIBLE } |
| This enum represents the state of the solver w.r.t. the search. More... | |
| enum | OptimizationDirection { NOT_SET , MAXIMIZATION , MINIMIZATION } |
| Optimization directions. More... | |
| typedef std::function< int64_t(int64_t)> | IndexEvaluator1 |
| Callback typedefs. More... | |
| typedef std::function< int64_t(int64_t, int64_t)> | IndexEvaluator2 |
| typedef std::function< int64_t(int64_t, int64_t, int64_t)> | IndexEvaluator3 |
| typedef std::function< bool(int64_t)> | IndexFilter1 |
| typedef std::function< IntVar *(int64_t)> | Int64ToIntVar |
| typedef std::function< int64_t(Solver *solver, const std::vector< IntVar * > &vars, int64_t first_unbound, int64_t last_unbound)> | VariableIndexSelector |
| typedef std::function< int64_t(const IntVar *v, int64_t id)> | VariableValueSelector |
| typedef std::function< bool(int64_t, int64_t, int64_t)> | VariableValueComparator |
| typedef std::function< DecisionModification()> | BranchSelector |
| typedef std::function< void(Solver *)> | Action |
| typedef std::function< void()> | Closure |
Public Member Functions | |
| Solver (const std::string &name) | |
| Solver API. More... | |
| Solver (const std::string &name, const ConstraintSolverParameters ¶meters) | |
| ~Solver () | |
| ConstraintSolverParameters | parameters () const |
| Stored Parameters. More... | |
| template<class T > | |
| void | SaveValue (T *o) |
| reversibility More... | |
| template<typename T > | |
| T * | RevAlloc (T *object) |
| Registers the given object as being reversible. More... | |
| template<typename T > | |
| T * | RevAllocArray (T *object) |
| Like RevAlloc() above, but for an array of objects: the array must have been allocated with the new[] operator. More... | |
| void | AddConstraint (Constraint *const c) |
| Adds the constraint 'c' to the model. More... | |
| void | AddCastConstraint (CastConstraint *const constraint, IntVar *const target_var, IntExpr *const expr) |
| Adds 'constraint' to the solver and marks it as a cast constraint, that is, a constraint created calling Var() on an expression. More... | |
| bool | SolveAndCommit (DecisionBuilder *const 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. More... | |
| bool | SolveAndCommit (DecisionBuilder *const db) |
| bool | SolveAndCommit (DecisionBuilder *const db, SearchMonitor *const m1) |
| bool | SolveAndCommit (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2) |
| bool | SolveAndCommit (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
| bool | CheckAssignment (Assignment *const solution) |
| Checks whether the given assignment satisfies all relevant constraints. More... | |
| bool | CheckConstraint (Constraint *const ct) |
| Checks whether adding this constraint will lead to an immediate failure. More... | |
| SolverState | state () const |
| State of the solver. More... | |
| void | Fail () |
| Abandon the current branch in the search tree. A backtrack will follow. More... | |
| void | 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. More... | |
| std::string | DebugString () const |
| !defined(SWIG) More... | |
| absl::Time | Now () const |
| The 'absolute time' as seen by the solver. More... | |
| int64_t | wall_time () const |
| DEPRECATED: Use Now() instead. More... | |
| int64_t | branches () const |
| The number of branches explored since the creation of the solver. More... | |
| int64_t | solutions () const |
| The number of solutions found since the start of the search. More... | |
| int64_t | unchecked_solutions () const |
| The number of unchecked solutions found by local search. More... | |
| int64_t | demon_runs (DemonPriority p) const |
| The number of demons executed during search for a given priority. More... | |
| int64_t | failures () const |
| The number of failures encountered since the creation of the solver. More... | |
| int64_t | neighbors () const |
| The number of neighbors created. More... | |
| int64_t | filtered_neighbors () const |
| The number of filtered neighbors (neighbors accepted by filters). More... | |
| int64_t | accepted_neighbors () const |
| The number of accepted neighbors. More... | |
| uint64_t | stamp () const |
| The stamp indicates how many moves in the search tree we have performed. More... | |
| uint64_t | fail_stamp () const |
| The fail_stamp() is incremented after each backtrack. More... | |
| OptimizationDirection | optimization_direction () const |
| The direction of optimization, getter and setter. More... | |
| void | set_optimization_direction (OptimizationDirection direction) |
| 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. More... | |
| IntVar * | MakeIntVar (const std::vector< int64_t > &values, const std::string &name) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar * | MakeIntVar (const std::vector< int > &values, const std::string &name) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar * | MakeIntVar (int64_t min, int64_t max) |
| MakeIntVar will create the best range based int var for the bounds given. More... | |
| IntVar * | MakeIntVar (const std::vector< int64_t > &values) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar * | MakeIntVar (const std::vector< int > &values) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar * | MakeBoolVar (const std::string &name) |
| MakeBoolVar will create a variable with a {0, 1} domain. More... | |
| IntVar * | MakeBoolVar () |
| MakeBoolVar will create a variable with a {0, 1} domain. More... | |
| IntVar * | MakeIntConst (int64_t val, const std::string &name) |
| IntConst will create a constant expression. More... | |
| IntVar * | MakeIntConst (int64_t val) |
| IntConst will create a constant expression. More... | |
| void | 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. More... | |
| void | 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. More... | |
| IntVar ** | MakeIntVarArray (int var_count, int64_t vmin, int64_t vmax, const std::string &name) |
| Same but allocates an array and returns it. More... | |
| void | 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. More... | |
| void | MakeBoolVarArray (int var_count, std::vector< IntVar * > *vars) |
| This method will append the vector vars with 'var_count' boolean variables having no names. More... | |
| IntVar ** | MakeBoolVarArray (int var_count, const std::string &name) |
| Same but allocates an array and returns it. More... | |
| IntExpr * | MakeSum (IntExpr *const left, IntExpr *const right) |
| left + right. More... | |
| IntExpr * | MakeSum (IntExpr *const expr, int64_t value) |
| expr + value. More... | |
| IntExpr * | MakeSum (const std::vector< IntVar * > &vars) |
| sum of all vars. More... | |
| IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int64_t > &coefs) |
| scalar product More... | |
| IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int > &coefs) |
| scalar product More... | |
| IntExpr * | MakeDifference (IntExpr *const left, IntExpr *const right) |
| left - right More... | |
| IntExpr * | MakeDifference (int64_t value, IntExpr *const expr) |
| value - expr More... | |
| IntExpr * | MakeOpposite (IntExpr *const expr) |
| -expr More... | |
| IntExpr * | MakeProd (IntExpr *const left, IntExpr *const right) |
| left * right More... | |
| IntExpr * | MakeProd (IntExpr *const expr, int64_t value) |
| expr * value More... | |
| IntExpr * | MakeDiv (IntExpr *const expr, int64_t value) |
| expr / value (integer division) More... | |
| IntExpr * | MakeDiv (IntExpr *const numerator, IntExpr *const denominator) |
| numerator / denominator (integer division). Terms need to be positive. More... | |
| IntExpr * | MakeAbs (IntExpr *const expr) |
| |expr| More... | |
| IntExpr * | MakeSquare (IntExpr *const expr) |
| expr * expr More... | |
| IntExpr * | MakePower (IntExpr *const expr, int64_t n) |
| expr ^ n (n > 0) More... | |
| IntExpr * | MakeElement (const std::vector< int64_t > &values, IntVar *const index) |
| values[index] More... | |
| IntExpr * | MakeElement (const std::vector< int > &values, IntVar *const index) |
| values[index] More... | |
| IntExpr * | MakeElement (IndexEvaluator1 values, IntVar *const index) |
| Function-based element. More... | |
| IntExpr * | MakeMonotonicElement (IndexEvaluator1 values, bool increasing, IntVar *const index) |
| Function based element. More... | |
| IntExpr * | MakeElement (IndexEvaluator2 values, IntVar *const index1, IntVar *const index2) |
| 2D version of function-based element expression, values(expr1, expr2). More... | |
| IntExpr * | MakeElement (const std::vector< IntVar * > &vars, IntVar *const index) |
| vars[expr] More... | |
| IntExpr * | MakeElement (Int64ToIntVar vars, int64_t range_start, int64_t range_end, IntVar *argument) |
| vars(argument) More... | |
| IntExpr * | MakeIndexExpression (const std::vector< IntVar * > &vars, int64_t value) |
| Returns the expression expr such that vars[expr] == value. More... | |
| Constraint * | MakeIfThenElseCt (IntVar *const condition, IntExpr *const then_expr, IntExpr *const else_expr, IntVar *const target_var) |
| Special cases with arrays of size two. More... | |
| IntExpr * | MakeMin (const std::vector< IntVar * > &vars) |
| std::min(vars) More... | |
| IntExpr * | MakeMin (IntExpr *const left, IntExpr *const right) |
| std::min (left, right) More... | |
| IntExpr * | MakeMin (IntExpr *const expr, int64_t value) |
| std::min(expr, value) More... | |
| IntExpr * | MakeMin (IntExpr *const expr, int value) |
| std::min(expr, value) More... | |
| IntExpr * | MakeMax (const std::vector< IntVar * > &vars) |
| std::max(vars) More... | |
| IntExpr * | MakeMax (IntExpr *const left, IntExpr *const right) |
| std::max(left, right) More... | |
| IntExpr * | MakeMax (IntExpr *const expr, int64_t value) |
| std::max(expr, value) More... | |
| IntExpr * | MakeMax (IntExpr *const expr, int value) |
| std::max(expr, value) More... | |
| IntExpr * | MakeConvexPiecewiseExpr (IntExpr *expr, int64_t early_cost, int64_t early_date, int64_t late_date, int64_t late_cost) |
| Convex piecewise function. More... | |
| IntExpr * | MakeSemiContinuousExpr (IntExpr *const 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. More... | |
| IntExpr * | MakePiecewiseLinearExpr (IntExpr *expr, const PiecewiseLinearFunction &f) |
| General piecewise-linear function expression, built from f(x) where f is piecewise-linear. More... | |
| IntExpr * | MakeModulo (IntExpr *const x, int64_t mod) |
| Modulo expression x % mod (with the python convention for modulo). More... | |
| IntExpr * | MakeModulo (IntExpr *const x, IntExpr *const mod) |
| Modulo expression x % mod (with the python convention for modulo). More... | |
| IntExpr * | MakeConditionalExpression (IntVar *const condition, IntExpr *const expr, int64_t unperformed_value) |
| Conditional Expr condition ? expr : unperformed_value. More... | |
| Constraint * | MakeTrueConstraint () |
| This constraint always succeeds. More... | |
| Constraint * | MakeFalseConstraint () |
| This constraint always fails. More... | |
| Constraint * | MakeFalseConstraint (const std::string &explanation) |
| Constraint * | MakeIsEqualCstCt (IntExpr *const var, int64_t value, IntVar *const boolvar) |
| boolvar == (var == value) More... | |
| IntVar * | MakeIsEqualCstVar (IntExpr *const var, int64_t value) |
| status var of (var == value) More... | |
| Constraint * | MakeIsEqualCt (IntExpr *const v1, IntExpr *v2, IntVar *const b) |
| b == (v1 == v2) More... | |
| IntVar * | MakeIsEqualVar (IntExpr *const v1, IntExpr *v2) |
| status var of (v1 == v2) More... | |
| Constraint * | MakeEquality (IntExpr *const left, IntExpr *const right) |
| left == right More... | |
| Constraint * | MakeEquality (IntExpr *const expr, int64_t value) |
| expr == value More... | |
| Constraint * | MakeEquality (IntExpr *const expr, int value) |
| expr == value More... | |
| Constraint * | MakeIsDifferentCstCt (IntExpr *const var, int64_t value, IntVar *const boolvar) |
| boolvar == (var != value) More... | |
| IntVar * | MakeIsDifferentCstVar (IntExpr *const var, int64_t value) |
| status var of (var != value) More... | |
| IntVar * | MakeIsDifferentVar (IntExpr *const v1, IntExpr *const v2) |
| status var of (v1 != v2) More... | |
| Constraint * | MakeIsDifferentCt (IntExpr *const v1, IntExpr *const v2, IntVar *const b) |
| b == (v1 != v2) More... | |
| Constraint * | MakeNonEquality (IntExpr *const left, IntExpr *const right) |
| left != right More... | |
| Constraint * | MakeNonEquality (IntExpr *const expr, int64_t value) |
| expr != value More... | |
| Constraint * | MakeNonEquality (IntExpr *const expr, int value) |
| expr != value More... | |
| Constraint * | MakeIsLessOrEqualCstCt (IntExpr *const var, int64_t value, IntVar *const boolvar) |
| boolvar == (var <= value) More... | |
| IntVar * | MakeIsLessOrEqualCstVar (IntExpr *const var, int64_t value) |
| status var of (var <= value) More... | |
| IntVar * | MakeIsLessOrEqualVar (IntExpr *const left, IntExpr *const right) |
| status var of (left <= right) More... | |
| Constraint * | MakeIsLessOrEqualCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
| b == (left <= right) More... | |
| Constraint * | MakeLessOrEqual (IntExpr *const left, IntExpr *const right) |
| left <= right More... | |
| Constraint * | MakeLessOrEqual (IntExpr *const expr, int64_t value) |
| expr <= value More... | |
| Constraint * | MakeLessOrEqual (IntExpr *const expr, int value) |
| expr <= value More... | |
| Constraint * | MakeIsGreaterOrEqualCstCt (IntExpr *const var, int64_t value, IntVar *const boolvar) |
| boolvar == (var >= value) More... | |
| IntVar * | MakeIsGreaterOrEqualCstVar (IntExpr *const var, int64_t value) |
| status var of (var >= value) More... | |
| IntVar * | MakeIsGreaterOrEqualVar (IntExpr *const left, IntExpr *const right) |
| status var of (left >= right) More... | |
| Constraint * | MakeIsGreaterOrEqualCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
| b == (left >= right) More... | |
| Constraint * | MakeGreaterOrEqual (IntExpr *const left, IntExpr *const right) |
| left >= right More... | |
| Constraint * | MakeGreaterOrEqual (IntExpr *const expr, int64_t value) |
| expr >= value More... | |
| Constraint * | MakeGreaterOrEqual (IntExpr *const expr, int value) |
| expr >= value More... | |
| Constraint * | MakeIsGreaterCstCt (IntExpr *const v, int64_t c, IntVar *const b) |
| b == (v > c) More... | |
| IntVar * | MakeIsGreaterCstVar (IntExpr *const var, int64_t value) |
| status var of (var > value) More... | |
| IntVar * | MakeIsGreaterVar (IntExpr *const left, IntExpr *const right) |
| status var of (left > right) More... | |
| Constraint * | MakeIsGreaterCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
| b == (left > right) More... | |
| Constraint * | MakeGreater (IntExpr *const left, IntExpr *const right) |
| left > right More... | |
| Constraint * | MakeGreater (IntExpr *const expr, int64_t value) |
| expr > value More... | |
| Constraint * | MakeGreater (IntExpr *const expr, int value) |
| expr > value More... | |
| Constraint * | MakeIsLessCstCt (IntExpr *const v, int64_t c, IntVar *const b) |
| b == (v < c) More... | |
| IntVar * | MakeIsLessCstVar (IntExpr *const var, int64_t value) |
| status var of (var < value) More... | |
| IntVar * | MakeIsLessVar (IntExpr *const left, IntExpr *const right) |
| status var of (left < right) More... | |
| Constraint * | MakeIsLessCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
| b == (left < right) More... | |
| Constraint * | MakeLess (IntExpr *const left, IntExpr *const right) |
| left < right More... | |
| Constraint * | MakeLess (IntExpr *const expr, int64_t value) |
| expr < value More... | |
| Constraint * | MakeLess (IntExpr *const expr, int value) |
| expr < value More... | |
| Constraint * | MakeSumLessOrEqual (const std::vector< IntVar * > &vars, int64_t cst) |
| Variation on arrays. More... | |
| 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 *const 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 *const target) |
| Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, IntVar *const 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 *const min_var) |
| Constraint * | MakeMaxEquality (const std::vector< IntVar * > &vars, IntVar *const max_var) |
| Constraint * | MakeElementEquality (const std::vector< int64_t > &vals, IntVar *const index, IntVar *const target) |
| Constraint * | MakeElementEquality (const std::vector< int > &vals, IntVar *const index, IntVar *const target) |
| Constraint * | MakeElementEquality (const std::vector< IntVar * > &vars, IntVar *const index, IntVar *const target) |
| Constraint * | MakeElementEquality (const std::vector< IntVar * > &vars, IntVar *const index, int64_t target) |
| Constraint * | MakeAbsEquality (IntVar *const var, IntVar *const abs_var) |
| Creates the constraint abs(var) == abs_var. More... | |
| Constraint * | MakeIndexOfConstraint (const std::vector< IntVar * > &vars, IntVar *const 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. More... | |
| Demon * | MakeConstraintInitialPropagateCallback (Constraint *const ct) |
| This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'. More... | |
| Demon * | MakeDelayedConstraintInitialPropagateCallback (Constraint *const ct) |
| This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority. More... | |
| Demon * | MakeActionDemon (Action action) |
| Creates a demon from a callback. More... | |
| Demon * | MakeClosureDemon (Closure closure) |
| !defined(SWIG) More... | |
| Constraint * | MakeBetweenCt (IntExpr *const expr, int64_t l, int64_t u) |
| (l <= expr <= u) More... | |
| Constraint * | MakeNotBetweenCt (IntExpr *const 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. More... | |
| Constraint * | MakeIsBetweenCt (IntExpr *const expr, int64_t l, int64_t u, IntVar *const b) |
| b == (l <= expr <= u) More... | |
| IntVar * | MakeIsBetweenVar (IntExpr *const v, int64_t l, int64_t u) |
| Constraint * | MakeMemberCt (IntExpr *const expr, const std::vector< int64_t > &values) |
| expr in set. More... | |
| Constraint * | MakeMemberCt (IntExpr *const expr, const std::vector< int > &values) |
| Constraint * | MakeNotMemberCt (IntExpr *const expr, const std::vector< int64_t > &values) |
| expr not in set. More... | |
| Constraint * | MakeNotMemberCt (IntExpr *const expr, const std::vector< int > &values) |
| Constraint * | MakeNotMemberCt (IntExpr *const 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]]. More... | |
| Constraint * | MakeNotMemberCt (IntExpr *const expr, std::vector< int > starts, std::vector< int > ends) |
| expr should not be in the list of forbidden intervals [start[i]..end[i]]. More... | |
| Constraint * | MakeNotMemberCt (IntExpr *expr, SortedDisjointIntervalList intervals) |
| expr should not be in the list of forbidden intervals. More... | |
| Constraint * | MakeIsMemberCt (IntExpr *const expr, const std::vector< int64_t > &values, IntVar *const boolvar) |
| boolvar == (expr in set) More... | |
| Constraint * | MakeIsMemberCt (IntExpr *const expr, const std::vector< int > &values, IntVar *const boolvar) |
| IntVar * | MakeIsMemberVar (IntExpr *const expr, const std::vector< int64_t > &values) |
| IntVar * | MakeIsMemberVar (IntExpr *const 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 More... | |
| Constraint * | MakeCount (const std::vector< IntVar * > &vars, int64_t value, int64_t max_count) |
| |{i | vars[i] == value}| == max_count More... | |
| Constraint * | MakeCount (const std::vector< IntVar * > &vars, int64_t value, IntVar *const max_count) |
| |{i | vars[i] == value}| == max_count More... | |
| 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]. More... | |
| 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]. More... | |
| Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &cards) |
| Aggregated version of count: |{i | v[i] == j}| == cards[j]. More... | |
| Constraint * | 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 . More... | |
| Constraint * | 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 . More... | |
| Constraint * | 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 . More... | |
| 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) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint * | 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 . More... | |
| Constraint * | MakeDeviation (const std::vector< IntVar * > &vars, IntVar *const 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. More... | |
| Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars) |
| All variables are pairwise different. More... | |
| Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars, bool stronger_propagation) |
| All variables are pairwise different. More... | |
| Constraint * | MakeAllDifferentExcept (const std::vector< IntVar * > &vars, int64_t escape_value) |
| All variables are pairwise different, unless they are assigned to the escape value. More... | |
| Constraint * | 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. More... | |
| Constraint * | MakeLexicalLess (const std::vector< IntVar * > &left, const std::vector< IntVar * > &right) |
| Creates a constraint that enforces that left is lexicographically less than right. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| Constraint * | MakeNoCycle (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, IndexFilter1 sink_handler=nullptr) |
| Prevent cycles. More... | |
| 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. More... | |
| Constraint * | MakeSubCircuit (const std::vector< IntVar * > &nexts) |
| Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves. More... | |
| Constraint * | 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]. More... | |
| Constraint * | 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. More... | |
| Constraint * | MakePathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, IndexEvaluator2 transit_evaluator) |
| Creates a constraint which accumulates values along a path such that: cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]). More... | |
| 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) |
| Creates a constraint which accumulates values along a path such that: cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]) + slacks[i]. More... | |
| Constraint * | MakePathConnected (std::vector< IntVar * > nexts, std::vector< int64_t > sources, std::vector< int64_t > sinks, std::vector< IntVar * > status) |
| Constraint enforcing that status[i] is true iff there's a path defined on next variables from sources[i] to sinks[i]. More... | |
| Constraint * | 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. More... | |
| Constraint * | MakePathPrecedenceConstraint (std::vector< IntVar * > nexts, const std::vector< std::pair< int, int > > &precedences, const std::vector< int > &lifo_path_starts, const std::vector< int > &fifo_path_starts) |
| Same as MakePathPrecedenceConstraint but ensures precedence pairs on some paths follow a LIFO or FIFO order. More... | |
| Constraint * | 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. More... | |
| Constraint * | MakeMapDomain (IntVar *const var, const std::vector< IntVar * > &actives) |
| This constraint maps the domain of 'var' onto the array of variables 'actives'. More... | |
| Constraint * | MakeAllowedAssignments (const std::vector< IntVar * > &vars, const IntTupleSet &tuples) |
| This method creates a constraint where the graph of the relation between the variables is given in extension. More... | |
| Constraint * | 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. More... | |
| Constraint * | 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. More... | |
| 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) |
| This constraint states that all the boxes must not overlap. More... | |
| Constraint * | MakeNonOverlappingBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< int64_t > &x_size, const std::vector< int64_t > &y_size) |
| Constraint * | MakeNonOverlappingBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< int > &x_size, const std::vector< 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) |
| This constraint states that all the boxes must not overlap. More... | |
| Constraint * | MakeNonOverlappingNonStrictBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< int64_t > &x_size, const std::vector< int64_t > &y_size) |
| Constraint * | MakeNonOverlappingNonStrictBoxesConstraint (const std::vector< IntVar * > &x_vars, const std::vector< IntVar * > &y_vars, const std::vector< int > &x_size, const std::vector< int > &y_size) |
| Pack * | MakePack (const std::vector< IntVar * > &vars, int number_of_bins) |
| This constraint packs all variables onto 'number_of_bins' variables. More... | |
| IntervalVar * | 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. More... | |
| void | MakeFixedDurationIntervalVarArray (int count, int64_t start_min, int64_t start_max, int64_t duration, bool optional, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with 'count' interval variables built with the corresponding parameters. More... | |
| IntervalVar * | MakeFixedDurationIntervalVar (IntVar *const start_variable, int64_t duration, const std::string &name) |
| Creates a performed interval var with a fixed duration. More... | |
| IntervalVar * | MakeFixedDurationIntervalVar (IntVar *const start_variable, int64_t duration, IntVar *const performed_variable, const std::string &name) |
| Creates an interval var with a fixed duration, and performed_variable. More... | |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, int64_t duration, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with 'count' interval var built with the corresponding start variables. More... | |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, const std::vector< int64_t > &durations, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with interval variables built with the corresponding start variables. More... | |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, const std::vector< int > &durations, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with interval variables built with the corresponding start variables. More... | |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, const std::vector< int64_t > &durations, const std::vector< IntVar * > &performed_variables, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with interval variables built with the corresponding start and performed variables. More... | |
| void | MakeFixedDurationIntervalVarArray (const std::vector< IntVar * > &start_variables, const std::vector< int > &durations, const std::vector< IntVar * > &performed_variables, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with interval variables built with the corresponding start and performed variables. More... | |
| IntervalVar * | MakeFixedInterval (int64_t start, int64_t duration, const std::string &name) |
| Creates a fixed and performed interval. More... | |
| 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) |
| Creates an interval var by specifying the bounds on start, duration, and end. More... | |
| 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, const std::string &name, std::vector< IntervalVar * > *const array) |
| This method fills the vector with 'count' interval var built with the corresponding parameters. More... | |
| IntervalVar * | MakeMirrorInterval (IntervalVar *const interval_var) |
| Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis. More... | |
| IntervalVar * | MakeFixedDurationStartSyncedOnStartIntervalVar (IntervalVar *const 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. More... | |
| IntervalVar * | MakeFixedDurationStartSyncedOnEndIntervalVar (IntervalVar *const 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. More... | |
| IntervalVar * | MakeFixedDurationEndSyncedOnStartIntervalVar (IntervalVar *const 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. More... | |
| IntervalVar * | MakeFixedDurationEndSyncedOnEndIntervalVar (IntervalVar *const 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. More... | |
| IntervalVar * | MakeIntervalRelaxedMin (IntervalVar *const interval_var) |
| Creates and returns an interval variable that wraps around the given one, relaxing the min start and end. More... | |
| IntervalVar * | MakeIntervalRelaxedMax (IntervalVar *const interval_var) |
| Creates and returns an interval variable that wraps around the given one, relaxing the max start and end. More... | |
| Constraint * | MakeIntervalVarRelation (IntervalVar *const t, UnaryIntervalRelation r, int64_t d) |
| This method creates a relation between an interval var and a date. More... | |
| Constraint * | MakeIntervalVarRelation (IntervalVar *const t1, BinaryIntervalRelation r, IntervalVar *const t2) |
| This method creates a relation between two interval vars. More... | |
| Constraint * | MakeIntervalVarRelationWithDelay (IntervalVar *const t1, BinaryIntervalRelation r, IntervalVar *const t2, int64_t delay) |
| This method creates a relation between two interval vars. More... | |
| Constraint * | MakeTemporalDisjunction (IntervalVar *const t1, IntervalVar *const t2, IntVar *const alt) |
| This constraint implements a temporal disjunction between two interval vars t1 and t2. More... | |
| Constraint * | MakeTemporalDisjunction (IntervalVar *const t1, IntervalVar *const t2) |
| This constraint implements a temporal disjunction between two interval vars. More... | |
| DisjunctiveConstraint * | MakeDisjunctiveConstraint (const std::vector< IntervalVar * > &intervals, const std::string &name) |
| This constraint forces all interval vars into an non-overlapping sequence. More... | |
| DisjunctiveConstraint * | MakeStrictDisjunctiveConstraint (const std::vector< IntervalVar * > &intervals, const std::string &name) |
| This constraint forces all interval vars into an non-overlapping sequence. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int64_t > &demands, int64_t capacity, const std::string &name) |
| 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. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int > &demands, int64_t capacity, const std::string &name) |
| 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. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int64_t > &demands, IntVar *const capacity, const std::string &name) |
| 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. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int > &demands, IntVar *const capacity, const std::string &name) |
| 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. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< IntVar * > &demands, int64_t capacity, const std::string &name) |
| This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. More... | |
| Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< IntVar * > &demands, IntVar *const capacity, const std::string &name) |
| This constraint enforces that, for any integer t, the sum of demands corresponding to an interval containing t does not exceed the given capacity. More... | |
| Constraint * | MakeCover (const std::vector< IntervalVar * > &vars, IntervalVar *const target_var) |
| This constraint states that the target_var is the convex hull of the intervals. More... | |
| Constraint * | MakeEquality (IntervalVar *const var1, IntervalVar *const var2) |
| This constraints states that the two interval variables are equal. More... | |
| Assignment * | MakeAssignment () |
| This method creates an empty assignment. More... | |
| Assignment * | MakeAssignment (const Assignment *const a) |
| This method creates an assignment which is a copy of 'a'. More... | |
| SolutionCollector * | MakeFirstSolutionCollector (const Assignment *const assignment) |
| Collect the first solution of the search. More... | |
| SolutionCollector * | MakeFirstSolutionCollector () |
| Collect the first solution of the search. More... | |
| SolutionCollector * | MakeLastSolutionCollector (const Assignment *const assignment) |
| Collect the last solution of the search. More... | |
| SolutionCollector * | MakeLastSolutionCollector () |
| Collect the last solution of the search. More... | |
| SolutionCollector * | MakeBestValueSolutionCollector (const Assignment *const assignment, bool maximize) |
| Collect the solution corresponding to the optimal value of the objective of 'assignment'; if 'assignment' does not have an objective no solution is collected. More... | |
| SolutionCollector * | MakeBestValueSolutionCollector (bool maximize) |
| Collect the solution corresponding to the optimal value of the objective of 'assignment'; if 'assignment' does not have an objective no solution is collected. More... | |
| SolutionCollector * | MakeNBestValueSolutionCollector (const Assignment *const assignment, int solution_count, bool maximize) |
| Same as MakeBestValueSolutionCollector but collects the best solution_count solutions. More... | |
| SolutionCollector * | MakeNBestValueSolutionCollector (int solution_count, bool maximize) |
| SolutionCollector * | MakeAllSolutionCollector (const Assignment *const assignment) |
| Collect all solutions of the search. More... | |
| SolutionCollector * | MakeAllSolutionCollector () |
| Collect all solutions of the search. More... | |
| OptimizeVar * | MakeMinimize (IntVar *const v, int64_t step) |
| Creates a minimization objective. More... | |
| OptimizeVar * | MakeMaximize (IntVar *const v, int64_t step) |
| Creates a maximization objective. More... | |
| OptimizeVar * | MakeOptimize (bool maximize, IntVar *const v, int64_t step) |
| Creates a objective with a given sense (true = maximization). More... | |
| OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &sub_objectives, const std::vector< int64_t > &weights, int64_t step) |
| Creates a minimization weighted objective. More... | |
| OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &sub_objectives, const std::vector< int > &weights, int64_t step) |
| Creates a minimization weighted objective. More... | |
| OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &sub_objectives, const std::vector< int64_t > &weights, int64_t step) |
| Creates a maximization weigthed objective. More... | |
| OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &sub_objectives, const std::vector< int > &weights, int64_t step) |
| Creates a maximization weigthed objective. More... | |
| 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). More... | |
| 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). More... | |
| SearchMonitor * | MakeTabuSearch (bool maximize, IntVar *const v, 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. More... | |
| SearchMonitor * | MakeGenericTabuSearch (bool maximize, IntVar *const v, int64_t step, const std::vector< IntVar * > &tabu_vars, int64_t forbid_tenure) |
| Creates a Tabu Search based on the vars |vars|. More... | |
| SearchMonitor * | MakeSimulatedAnnealing (bool maximize, IntVar *const v, int64_t step, int64_t initial_temperature) |
| Creates a Simulated Annealing monitor. More... | |
| SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator2 objective_function, int64_t step, const std::vector< IntVar * > &vars, double penalty_factor) |
| Creates a Guided Local Search monitor. More... | |
| SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator3 objective_function, int64_t step, const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, double penalty_factor) |
| SearchMonitor * | MakeLubyRestart (int scale_factor) |
| This search monitor will restart the search periodically. More... | |
| SearchMonitor * | MakeConstantRestart (int frequency) |
| This search monitor will restart the search periodically after 'frequency' failures. More... | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeTimeLimit (absl::Duration time) |
| Creates a search limit that constrains the running time. More... | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeTimeLimit (int64_t time_in_ms) |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeBranchesLimit (int64_t branches) |
| Creates a search limit that constrains the number of branches explored in the search tree. More... | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeFailuresLimit (int64_t failures) |
| Creates a search limit that constrains the number of failures that can happen when exploring the search tree. More... | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeSolutionsLimit (int64_t solutions) |
| Creates a search limit that constrains the number of solutions found during the search. More... | |
| 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) |
| Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits. More... | |
| ABSL_MUST_USE_RESULT RegularLimit * | MakeLimit (const RegularLimitParameters &proto) |
| Creates a search limit from its protobuf description. More... | |
| 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. More... | |
| ABSL_MUST_USE_RESULT SearchLimit * | MakeLimit (SearchLimit *const limit_1, SearchLimit *const limit_2) |
| Creates a search limit that is reached when either of the underlying limit is reached. More... | |
| 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) |
| Limits the search based on the improvements of 'objective_var'. More... | |
| ABSL_MUST_USE_RESULT SearchLimit * | MakeCustomLimit (std::function< bool()> limiter) |
| Callback-based search limit. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period) |
| The SearchMonitors below will display a periodic search log on LOG(INFO) every branch_period branches explored. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period, IntVar *const var) |
| At each solution, this monitor also display the var value. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period, std::function< std::string()> display_callback) |
At each solution, this monitor will also display result of display_callback. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period, IntVar *var, std::function< std::string()> display_callback) |
At each solution, this monitor will display the 'var' value and the result of display_callback. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period, OptimizeVar *const opt_var) |
| OptimizeVar Search Logs At each solution, this monitor will also display the 'opt_var' value. More... | |
| SearchMonitor * | MakeSearchLog (int branch_period, OptimizeVar *const opt_var, std::function< std::string()> display_callback) |
| Creates a search monitor that will also print the result of the display callback. More... | |
| SearchMonitor * | MakeSearchLog (SearchLogParameters parameters) |
| SearchMonitor * | MakeSearchTrace (const std::string &prefix) |
| Creates a search monitor that will trace precisely the behavior of the search. More... | |
| SearchMonitor * | MakeEnterSearchCallback (std::function< void()> callback) |
| --— Callback-based search monitors --— More... | |
| SearchMonitor * | MakeExitSearchCallback (std::function< void()> callback) |
| SearchMonitor * | MakeAtSolutionCallback (std::function< void()> callback) |
| ModelVisitor * | MakePrintModelVisitor () |
| Prints the model. More... | |
| ModelVisitor * | MakeStatisticsModelVisitor () |
| Displays some nice statistics on the model. More... | |
| ModelVisitor * | MakeVariableDegreeVisitor (absl::flat_hash_map< const IntVar *, int > *const map) |
| Compute the number of constraints a variable is attached to. More... | |
| SearchMonitor * | MakeSymmetryManager (const std::vector< SymmetryBreaker * > &visitors) |
| Symmetry Breaking. More... | |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2, SymmetryBreaker *const v3) |
| SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2, SymmetryBreaker *const v3, SymmetryBreaker *const v4) |
| Decision * | MakeAssignVariableValue (IntVar *const var, int64_t val) |
| Decisions. More... | |
| Decision * | MakeVariableLessOrEqualValue (IntVar *const var, int64_t value) |
| Decision * | MakeVariableGreaterOrEqualValue (IntVar *const var, int64_t value) |
| Decision * | MakeSplitVariableDomain (IntVar *const var, int64_t val, bool start_with_lower_half) |
| Decision * | MakeAssignVariableValueOrFail (IntVar *const var, int64_t value) |
| Decision * | MakeAssignVariableValueOrDoNothing (IntVar *const 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 *const db1, DecisionBuilder *const db2) |
| Creates a decision builder which sequentially composes decision builders. More... | |
| DecisionBuilder * | Compose (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3) |
| DecisionBuilder * | Compose (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3, DecisionBuilder *const db4) |
| DecisionBuilder * | Compose (const std::vector< DecisionBuilder * > &dbs) |
| DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2) |
| Creates a decision builder which will create a search tree where each decision builder is called from the top of the search tree. More... | |
| DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3) |
| DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3, DecisionBuilder *const 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. More... | |
| 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) |
| var_val1_val2_comparator(var, val1, val2) is true iff assigning value "val1" to variable "var" is better than assigning value "val2". More... | |
| 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 *const v0, IntVarStrategy var_str, IntValueStrategy val_str) |
| Shortcuts for small arrays. More... | |
| DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVarStrategy var_str, IntValueStrategy val_str) |
| DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVar *const v2, IntVarStrategy var_str, IntValueStrategy val_str) |
| DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVar *const v2, IntVar *const v3, IntVarStrategy var_str, IntValueStrategy val_str) |
| Decision * | MakeScheduleOrPostpone (IntervalVar *const var, int64_t est, int64_t *const marker) |
| Returns a decision that tries to schedule a task at a given time. More... | |
| Decision * | MakeScheduleOrExpedite (IntervalVar *const var, int64_t est, int64_t *const marker) |
| Returns a decision that tries to schedule a task at a given time. More... | |
| Decision * | MakeRankFirstInterval (SequenceVar *const sequence, int index) |
| Returns a decision that tries to rank first the ith interval var in the sequence variable. More... | |
| Decision * | MakeRankLastInterval (SequenceVar *const sequence, int index) |
| Returns a decision that tries to rank last the ith interval var in the sequence variable. More... | |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 eval, EvaluatorStrategy str) |
| Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. More... | |
| DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 eval, IndexEvaluator1 tie_breaker, EvaluatorStrategy str) |
| Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. More... | |
| DecisionBuilder * | MakePhase (const std::vector< IntervalVar * > &intervals, IntervalStrategy str) |
| Scheduling phases. More... | |
| DecisionBuilder * | MakePhase (const std::vector< SequenceVar * > &sequences, SequenceStrategy str) |
| DecisionBuilder * | MakeDecisionBuilderFromAssignment (Assignment *const assignment, DecisionBuilder *const db, const std::vector< IntVar * > &vars) |
| Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'. More... | |
| DecisionBuilder * | MakeConstraintAdder (Constraint *const ct) |
| Returns a decision builder that will add the given constraint to the model. More... | |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db) |
| SolveOnce will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point. More... | |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3, SearchMonitor *const monitor4) |
| DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step) |
| NestedOptimize will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point. More... | |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step, SearchMonitor *const monitor1) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step, SearchMonitor *const monitor1, SearchMonitor *const monitor2) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3, SearchMonitor *const monitor4) |
| DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64_t step, const std::vector< SearchMonitor * > &monitors) |
| DecisionBuilder * | MakeRestoreAssignment (Assignment *assignment) |
| Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore()) More... | |
| DecisionBuilder * | MakeStoreAssignment (Assignment *assignment) |
| Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store()) More... | |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, LocalSearchOperators op) |
| Local Search Operators. More... | |
| LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, LocalSearchOperators op) |
| 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) |
| 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). More... | |
| LocalSearchOperator * | MakeRandomLnsOperator (const std::vector< IntVar * > &vars, int number_of_variables, int32_t seed) |
| LocalSearchOperator * | MakeMoveTowardTargetOperator (const Assignment &target) |
| Creates a local search operator that tries to move the assignment of some variables toward a target. More... | |
| LocalSearchOperator * | 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. More... | |
| LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops) |
| Creates a local search operator which concatenates a vector of operators. More... | |
| 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) |
| Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). More... | |
| LocalSearchOperator * | RandomConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, int32_t seed) |
| Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). More... | |
| LocalSearchOperator * | 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. More... | |
| LocalSearchOperator * | MakeNeighborhoodLimit (LocalSearchOperator *const op, int64_t limit) |
| 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()). More... | |
| DecisionBuilder * | MakeLocalSearchPhase (Assignment *const assignment, LocalSearchPhaseParameters *const parameters) |
| Local Search decision builders factories. More... | |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< IntVar * > &vars, DecisionBuilder *const first_solution, LocalSearchPhaseParameters *const parameters) |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< IntVar * > &vars, DecisionBuilder *const first_solution, DecisionBuilder *const first_solution_sub_decision_builder, LocalSearchPhaseParameters *const parameters) |
| Variant with a sub_decison_builder specific to the first solution. More... | |
| DecisionBuilder * | MakeLocalSearchPhase (const std::vector< SequenceVar * > &vars, DecisionBuilder *const first_solution, LocalSearchPhaseParameters *const parameters) |
| SolutionPool * | MakeDefaultSolutionPool () |
| Solution Pool. More... | |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder) |
| Local Search Phase Parameters. More... | |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, RegularLimit *const limit) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, RegularLimit *const limit, LocalSearchFilterManager *filter_manager) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, RegularLimit *const limit) |
| LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (IntVar *objective, SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, RegularLimit *const limit, LocalSearchFilterManager *filter_manager) |
| LocalSearchFilter * | MakeAcceptFilter () |
| Local Search Filters. More... | |
| 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 () |
| Performs PeriodicCheck on the top-level search; for instance, can be called from a nested solve to check top-level limits. More... | |
| int | 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). More... | |
| void | PushState () |
| The PushState and PopState methods manipulates the states of the reversible objects. More... | |
| void | PopState () |
| int | SearchDepth () const |
| Gets the search depth of the current active search. More... | |
| int | SearchLeftDepth () const |
| Gets the search left depth of the current active search. More... | |
| int | SolveDepth () const |
| Gets the number of nested searches. More... | |
| void | SetBranchSelector (BranchSelector bs) |
| Sets the given branch selector on the current active search. More... | |
| DecisionBuilder * | MakeApplyBranchSelector (BranchSelector bs) |
| Creates a decision builder that will set the branch selector. More... | |
| template<class T > | |
| void | SaveAndSetValue (T *adr, T val) |
| All-in-one SaveAndSetValue. More... | |
| template<class T > | |
| void | SaveAndAdd (T *adr, T val) |
| All-in-one SaveAndAdd_value. More... | |
| int64_t | Rand64 (int64_t size) |
| Returns a random value between 0 and 'size' - 1;. More... | |
| int32_t | Rand32 (int32_t size) |
| Returns a random value between 0 and 'size' - 1;. More... | |
| void | ReSeed (int32_t seed) |
| Reseed the solver random generator. More... | |
| void | ExportProfilingOverview (const std::string &filename) |
| Exports the profiling information in a human readable overview. More... | |
| std::string | LocalSearchProfile () const |
| Returns local search profiling information in a human readable format. More... | |
| ConstraintSolverStatistics | GetConstraintSolverStatistics () const |
| Returns detailed cp search statistics. More... | |
| LocalSearchStatistics | GetLocalSearchStatistics () const |
| Returns detailed local search statistics. More... | |
| bool | CurrentlyInSolve () const |
| Returns true whether the current search has been created using a Solve() call instead of a NewSearch one. More... | |
| int | constraints () const |
| Counts the number of constraints that have been added to the solver before the search. More... | |
| void | Accept (ModelVisitor *const visitor) const |
| Accepts the given model visitor. More... | |
| Decision * | balancing_decision () const |
| void | set_fail_intercept (std::function< void()> fail_intercept) |
| Internal. More... | |
| void | clear_fail_intercept () |
| DemonProfiler * | demon_profiler () const |
| Access to demon profiler. More... | |
| void | SetUseFastLocalSearch (bool use_fast_local_search) |
| enabled for metaheuristics. More... | |
| bool | UseFastLocalSearch () const |
| Returns true if fast local search is enabled. More... | |
| bool | HasName (const PropagationBaseObject *object) const |
| Returns whether the object has been named or not. More... | |
| Demon * | RegisterDemon (Demon *const demon) |
| Adds a new demon and wraps it inside a DemonProfiler if necessary. More... | |
| IntExpr * | RegisterIntExpr (IntExpr *const expr) |
| Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary. More... | |
| IntVar * | RegisterIntVar (IntVar *const var) |
| Registers a new IntVar and wraps it inside a TraceIntVar if necessary. More... | |
| IntervalVar * | RegisterIntervalVar (IntervalVar *const var) |
| Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary. More... | |
| Search * | ActiveSearch () const |
| Returns the active search, nullptr outside search. More... | |
| ModelCache * | Cache () const |
| Returns the cache of the model. More... | |
| bool | InstrumentsDemons () const |
| Returns whether we are instrumenting demons. More... | |
| bool | IsProfilingEnabled () const |
| Returns whether we are profiling the solver. More... | |
| bool | IsLocalSearchProfilingEnabled () const |
| Returns whether we are profiling local search. More... | |
| bool | InstrumentsVariables () const |
| Returns whether we are tracing variables. More... | |
| bool | NameAllVariables () const |
| Returns whether all variables should be named. More... | |
| std::string | model_name () const |
| Returns the name of the model. More... | |
| PropagationMonitor * | GetPropagationMonitor () const |
| Returns the propagation monitor. More... | |
| void | AddPropagationMonitor (PropagationMonitor *const monitor) |
| Adds the propagation monitor to the solver. More... | |
| LocalSearchMonitor * | GetLocalSearchMonitor () const |
| Returns the local search monitor. More... | |
| void | AddLocalSearchMonitor (LocalSearchMonitor *monitor) |
| Adds the local search monitor to the solver. More... | |
| void | SetSearchContext (Search *search, const std::string &search_context) |
| std::string | SearchContext () const |
| std::string | SearchContext (const Search *search) const |
| Assignment * | GetOrCreateLocalSearchState () |
| Returns (or creates) an assignment representing the state of local search. More... | |
| void | ClearLocalSearchState () |
| Clears the local search state. More... | |
| bool | IsBooleanVar (IntExpr *const expr, IntVar **inner_var, bool *is_negated) const |
| Returns true if expr represents either boolean_var or 1 - boolean_var. More... | |
| bool | IsProduct (IntExpr *const expr, IntExpr **inner_expr, int64_t *coefficient) |
| Returns true if expr represents a product of a expr and a constant. More... | |
| IntExpr * | CastExpression (const IntVar *const var) const |
| !defined(SWIG) More... | |
| void | FinishCurrentSearch () |
| Tells the solver to kill or restart the current search. More... | |
| void | RestartCurrentSearch () |
| void | ShouldFail () |
| These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail. More... | |
| void | CheckFail () |
| DecisionBuilder * | MakeProfiledDecisionBuilderWrapper (DecisionBuilder *db) |
| Activates profiling on a decision builder. More... | |
| bool | Solve (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
| bool | Solve (DecisionBuilder *const db) |
| bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1) |
| bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2) |
| bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
| bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3, SearchMonitor *const m4) |
| void | NewSearch (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
| void | NewSearch (DecisionBuilder *const db) |
| void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1) |
| void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2) |
| void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
| void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3, SearchMonitor *const m4) |
| bool | NextSolution () |
| void | RestartSearch () |
| void | EndSearch () |
Static Public Member Functions | |
| static ConstraintSolverParameters | DefaultSolverParameters () |
| Create a ConstraintSolverParameters proto with all the default values. More... | |
| static int64_t | MemoryUsage () |
| Current memory usage in bytes. More... | |
Public Attributes | |
| std::vector< int64_t > | tmp_vector_ |
| Unsafe temporary vector. More... | |
Static Public Attributes | |
| static constexpr int | kNumPriorities = 3 |
| Number of priorities for demons. More... | |
Definition at line 754 of file constraint_solver.h.
| typedef std::function<DecisionModification()> BranchSelector |
Definition at line 752 of file constraint_solver.h.
| typedef std::function<void()> Closure |
Definition at line 755 of file constraint_solver.h.
| typedef std::function<int64_t(int64_t)> IndexEvaluator1 |
Callback typedefs.
Definition at line 735 of file constraint_solver.h.
| typedef std::function<int64_t(int64_t, int64_t)> IndexEvaluator2 |
Definition at line 736 of file constraint_solver.h.
| typedef std::function<int64_t(int64_t, int64_t, int64_t)> IndexEvaluator3 |
Definition at line 737 of file constraint_solver.h.
| typedef std::function<bool(int64_t)> IndexFilter1 |
Definition at line 739 of file constraint_solver.h.
| typedef std::function<IntVar*(int64_t)> Int64ToIntVar |
Definition at line 741 of file constraint_solver.h.
| typedef std::function<int64_t(Solver* solver, const std::vector<IntVar*>& vars, int64_t first_unbound, int64_t last_unbound)> VariableIndexSelector |
Definition at line 746 of file constraint_solver.h.
| typedef std::function<bool(int64_t, int64_t, int64_t)> VariableValueComparator |
Definition at line 751 of file constraint_solver.h.
| typedef std::function<int64_t(const IntVar* v, int64_t id)> VariableValueSelector |
Definition at line 749 of file constraint_solver.h.
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2.
Definition at line 619 of file constraint_solver.h.
| enum 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 687 of file constraint_solver.h.
| enum 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 605 of file constraint_solver.h.
This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create.
Definition at line 564 of file constraint_solver.h.
| enum 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 387 of file constraint_solver.h.
| enum IntervalStrategy |
This enum describes the straregy used to select the next interval variable and its value to be fixed.
Definition at line 411 of file constraint_solver.h.
| enum IntValueStrategy |
This enum describes the strategy used to select the next variable value to set.
Definition at line 347 of file constraint_solver.h.
| enum IntVarStrategy |
This enum describes the strategy used to select the next branching variable at each node during the search.
Definition at line 266 of file constraint_solver.h.
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 592 of file constraint_solver.h.
| enum 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 |
| 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. Note that the two sub-chains can be part of the same path; they even may overlap. |
| 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 426 of file constraint_solver.h.
| enum 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 713 of file constraint_solver.h.
Optimization directions.
| Enumerator | |
|---|---|
| NOT_SET | |
| MAXIMIZATION | |
| MINIMIZATION | |
Definition at line 732 of file constraint_solver.h.
| enum SequenceStrategy |
Used for scheduling. Not yet implemented.
| Enumerator | |
|---|---|
| SEQUENCE_DEFAULT | |
| SEQUENCE_SIMPLE | |
| CHOOSE_MIN_SLACK_RANK_FORWARD | |
| CHOOSE_RANDOM_RANK_FORWARD | |
Definition at line 402 of file constraint_solver.h.
| enum SolverState |
This enum represents the state of the solver w.r.t. the search.
Definition at line 716 of file constraint_solver.h.
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d.
Definition at line 652 of file constraint_solver.h.
|
explicit |
Solver API.
Definition at line 1421 of file constraint_solver.cc.
| Solver | ( | const std::string & | name, |
| const ConstraintSolverParameters & | parameters | ||
| ) |
Definition at line 1410 of file constraint_solver.cc.
| ~Solver | ( | ) |
Definition at line 1475 of file constraint_solver.cc.
| void Accept | ( | ModelVisitor *const | visitor | ) | const |
Accepts the given model visitor.
Definition at line 1699 of file constraint_solver.cc.
|
inline |
The number of accepted neighbors.
Definition at line 1003 of file constraint_solver.h.
| Search * ActiveSearch | ( | ) | const |
Returns the active search, nullptr outside search.
Definition at line 1131 of file constraint_solver.cc.
| void 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 1595 of file constraint_solver.cc.
| void AddCastConstraint | ( | CastConstraint *const | constraint, |
| IntVar *const | target_var, | ||
| IntExpr *const | 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 1687 of file constraint_solver.cc.
| void AddConstraint | ( | Constraint *const | 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:
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.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 1663 of file constraint_solver.cc.
| void AddLocalSearchMonitor | ( | LocalSearchMonitor * | monitor | ) |
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 3218 of file constraint_solver.cc.
| void AddPropagationMonitor | ( | PropagationMonitor *const | monitor | ) |
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 3141 of file constraint_solver.cc.
|
inline |
Definition at line 2883 of file constraint_solver.h.
|
inline |
The number of branches explored since the creation of the solver.
Definition at line 982 of file constraint_solver.h.
| ModelCache * Cache | ( | ) | const |
Returns the cache of the model.
Definition at line 850 of file model_cache.cc.
!defined(SWIG)
Internal. If the variables is the result of expr->Var(), this method returns expr, nullptr otherwise.
Definition at line 2443 of file constraint_solver.cc.
| bool CheckAssignment | ( | Assignment *const | solution | ) |
Checks whether the given assignment satisfies all relevant constraints.
Definition at line 2299 of file constraint_solver.cc.
| bool CheckConstraint | ( | Constraint *const | 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 2378 of file constraint_solver.cc.
|
inline |
Definition at line 3000 of file constraint_solver.h.
|
inline |
Definition at line 2891 of file constraint_solver.h.
|
inline |
Clears the local search state.
Definition at line 2947 of file constraint_solver.h.
| DecisionBuilder * Compose | ( | const std::vector< DecisionBuilder * > & | dbs | ) |
| DecisionBuilder * Compose | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2 | ||
| ) |
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 |
| DecisionBuilder * Compose | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2, | ||
| DecisionBuilder *const | db3 | ||
| ) |
| DecisionBuilder * Compose | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2, | ||
| DecisionBuilder *const | db3, | ||
| DecisionBuilder *const | db4 | ||
| ) |
| LocalSearchOperator * ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops | ) |
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].
Definition at line 2022 of file local_search.cc.
| LocalSearchOperator * ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, |
| bool | restart | ||
| ) |
Definition at line 2027 of file local_search.cc.
| LocalSearchOperator * ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, |
| std::function< int64_t(int, int)> | evaluator | ||
| ) |
Definition at line 2039 of file local_search.cc.
|
inline |
Counts the number of constraints that have been added to the solver before the search.
Definition at line 2878 of file constraint_solver.h.
| bool 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 1752 of file constraint_solver.cc.
| std::string DebugString | ( | ) | const |
|
static |
Create a ConstraintSolverParameters proto with all the default values.
Definition at line 122 of file constraint_solver.cc.
|
inline |
Access to demon profiler.
Definition at line 2893 of file constraint_solver.h.
|
inline |
The number of demons executed during search for a given priority.
Definition at line 991 of file constraint_solver.h.
| void EndSearch | ( | ) |
Definition at line 2269 of file constraint_solver.cc.
| void 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 433 of file demon_profiler.cc.
| void Fail | ( | ) |
Abandon the current branch in the search tree. A backtrack will follow.
Definition at line 2422 of file constraint_solver.cc.
| uint64_t fail_stamp | ( | ) | const |
The fail_stamp() is incremented after each backtrack.
Definition at line 1651 of file constraint_solver.cc.
|
inline |
The number of failures encountered since the creation of the solver.
Definition at line 994 of file constraint_solver.h.
|
inline |
The number of filtered neighbors (neighbors accepted by filters).
Definition at line 1000 of file constraint_solver.h.
| void FinishCurrentSearch | ( | ) |
Tells the solver to kill or restart the current search.
Definition at line 2433 of file constraint_solver.cc.
| ConstraintSolverStatistics GetConstraintSolverStatistics | ( | ) | const |
Returns detailed cp search statistics.
Definition at line 1552 of file constraint_solver.cc.
| LocalSearchMonitor * GetLocalSearchMonitor | ( | ) | const |
Returns the local search monitor.
Definition at line 3223 of file constraint_solver.cc.
| LocalSearchStatistics GetLocalSearchStatistics | ( | ) | const |
Returns detailed local search statistics.
Definition at line 3940 of file local_search.cc.
| Assignment * GetOrCreateLocalSearchState | ( | ) |
Returns (or creates) an assignment representing the state of local search.
Definition at line 3240 of file constraint_solver.cc.
| PropagationMonitor * GetPropagationMonitor | ( | ) | const |
Returns the propagation monitor.
Definition at line 3146 of file constraint_solver.cc.
| bool HasName | ( | const PropagationBaseObject * | object | ) | const |
Returns whether the object has been named or not.
Definition at line 2491 of file constraint_solver.cc.
| bool InstrumentsDemons | ( | ) | const |
Returns whether we are instrumenting demons.
Definition at line 173 of file constraint_solver.cc.
| bool InstrumentsVariables | ( | ) | const |
Returns whether we are tracing variables.
Definition at line 187 of file constraint_solver.cc.
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 7476 of file expressions.cc.
| bool IsLocalSearchProfilingEnabled | ( | ) | const |
Returns whether we are profiling local search.
Definition at line 182 of file constraint_solver.cc.
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 7494 of file expressions.cc.
| bool IsProfilingEnabled | ( | ) | const |
Returns whether we are profiling the solver.
Definition at line 177 of file constraint_solver.cc.
| std::string LocalSearchProfile | ( | ) | const |
Returns local search profiling information in a human readable format.
Definition at line 3933 of file local_search.cc.
|expr|
Definition at line 7017 of file expressions.cc.
| Constraint * MakeAbsEquality | ( | IntVar *const | var, |
| IntVar *const | abs_var | ||
| ) |
Creates the constraint abs(var) == abs_var.
Definition at line 7010 of file expressions.cc.
| LocalSearchFilter * MakeAcceptFilter | ( | ) |
Local Search Filters.
Definition at line 2546 of file local_search.cc.
| Demon * MakeActionDemon | ( | Solver::Action | action | ) |
Creates a demon from a callback.
Definition at line 510 of file constraints.cc.
| Constraint * 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.
| Constraint * 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.
| Constraint * 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.
| Constraint * MakeAllowedAssignments | ( | const std::vector< IntVar * > & | vars, |
| const IntTupleSet & | tuples | ||
| ) |
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.
Definition at line 1261 of file constraint_solver/table.cc.
| SolutionCollector * MakeAllSolutionCollector | ( | ) |
| SolutionCollector * MakeAllSolutionCollector | ( | const Assignment *const | assignment | ) |
| DecisionBuilder * MakeApplyBranchSelector | ( | BranchSelector | bs | ) |
Creates a decision builder that will set the branch selector.
Definition at line 1171 of file constraint_solver.cc.
| Assignment * MakeAssignment | ( | ) |
This method creates an empty assignment.
Definition at line 1042 of file constraint_solver/assignment.cc.
| Assignment * MakeAssignment | ( | const Assignment *const | a | ) |
This method creates an assignment which is a copy of 'a'.
Definition at line 1044 of file constraint_solver/assignment.cc.
| Constraint * 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.
| SearchMonitor * MakeAtSolutionCallback | ( | std::function< void()> | callback | ) |
| SolutionCollector * MakeBestValueSolutionCollector | ( | bool | maximize | ) |
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.
| SolutionCollector * MakeBestValueSolutionCollector | ( | const Assignment *const | assignment, |
| bool | maximize | ||
| ) |
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).
| Constraint * MakeBetweenCt | ( | IntExpr *const | expr, |
| int64_t | l, | ||
| int64_t | u | ||
| ) |
(l <= expr <= u)
Definition at line 923 of file expr_cst.cc.
| IntVar * MakeBoolVar | ( | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 6412 of file expressions.cc.
| IntVar * MakeBoolVar | ( | const std::string & | name | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 6408 of file expressions.cc.
| IntVar ** MakeBoolVarArray | ( | int | var_count, |
| const std::string & | name | ||
| ) |
Same but allocates an array and returns it.
Definition at line 6549 of file expressions.cc.
| void 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 6536 of file expressions.cc.
| void 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 6543 of file expressions.cc.
| RegularLimit * MakeBranchesLimit | ( | int64_t | branches | ) |
| Constraint * MakeCircuit | ( | const std::vector< IntVar * > & | nexts | ) |
Force the "nexts" variable to create a complete Hamiltonian path.
Definition at line 639 of file graph_constraints.cc.
| Demon * MakeClosureDemon | ( | Solver::Closure | closure | ) |
| IntExpr * MakeConditionalExpression | ( | IntVar *const | condition, |
| IntExpr *const | expr, | ||
| int64_t | unperformed_value | ||
| ) |
Conditional Expr condition ? expr : unperformed_value.
Definition at line 7249 of file expressions.cc.
| SearchMonitor * MakeConstantRestart | ( | int | frequency | ) |
| DecisionBuilder * MakeConstraintAdder | ( | Constraint *const | ct | ) |
Returns a decision builder that will add the given constraint to the model.
Definition at line 2374 of file constraint_solver.cc.
| Demon * MakeConstraintInitialPropagateCallback | ( | Constraint *const | ct | ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 35 of file constraints.cc.
| IntExpr * MakeConvexPiecewiseExpr | ( | IntExpr * | expr, |
| int64_t | early_cost, | ||
| int64_t | early_date, | ||
| int64_t | late_date, | ||
| int64_t | late_cost | ||
| ) |
Convex piecewise function.
Definition at line 7162 of file expressions.cc.
| Constraint * 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.
| Constraint * MakeCount | ( | const std::vector< IntVar * > & | vars, |
| int64_t | value, | ||
| IntVar *const | max_count | ||
| ) |
|{i | vars[i] == value}| == max_count
Definition at line 47 of file count_cst.cc.
| Constraint * MakeCover | ( | const std::vector< IntervalVar * > & | vars, |
| IntervalVar *const | target_var | ||
| ) |
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 587 of file sched_constraints.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2611 of file resource.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int > & | demands, | ||
| IntVar *const | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2629 of file resource.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int64_t > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2597 of file resource.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< int64_t > & | demands, | ||
| IntVar *const | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2617 of file resource.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< IntVar * > & | demands, | ||
| int64_t | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2638 of file resource.cc.
| Constraint * MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::vector< IntVar * > & | demands, | ||
| IntVar *const | capacity, | ||
| const std::string & | name | ||
| ) |
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.
Definition at line 2656 of file resource.cc.
| SearchLimit * MakeCustomLimit | ( | std::function< bool()> | limiter | ) |
| DecisionBuilder * MakeDecisionBuilderFromAssignment | ( | Assignment *const | assignment, |
| DecisionBuilder *const | db, | ||
| const std::vector< IntVar * > & | vars | ||
| ) |
| DecisionBuilder * MakeDefaultPhase | ( | const std::vector< IntVar * > & | vars | ) |
Definition at line 1115 of file default_search.cc.
| DecisionBuilder * MakeDefaultPhase | ( | const std::vector< IntVar * > & | vars, |
| const DefaultPhaseParameters & | parameters | ||
| ) |
Definition at line 1120 of file default_search.cc.
| RegularLimitParameters MakeDefaultRegularLimitParameters | ( | ) | const |
| SolutionPool * MakeDefaultSolutionPool | ( | ) |
Solution Pool.
Definition at line 4884 of file local_search.cc.
| Demon * MakeDelayedConstraintInitialPropagateCallback | ( | Constraint *const | 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 40 of file constraints.cc.
| Constraint * 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 1328 of file graph_constraints.cc.
| Constraint * MakeDeviation | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | 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.
value - expr
Definition at line 6707 of file expressions.cc.
left - right
Definition at line 6667 of file expressions.cc.
| DisjunctiveConstraint * MakeDisjunctiveConstraint | ( | const std::vector< IntervalVar * > & | intervals, |
| const std::string & | name | ||
| ) |
This constraint forces all interval vars into an non-overlapping sequence.
Intervals with zero duration can be scheduled anywhere.
Definition at line 2585 of file resource.cc.
| Constraint * 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.
| Constraint * 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.
| 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].
Definition at line 994 of file count_cst.cc.
| Constraint * 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.
| 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 | ||
| ) |
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.
| 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].
Definition at line 965 of file count_cst.cc.
| Constraint * 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.
| Constraint * 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.
expr / value (integer division)
Definition at line 6989 of file expressions.cc.
numerator / denominator (integer division). Terms need to be positive.
Definition at line 6951 of file expressions.cc.
values[index]
Definition at line 667 of file element.cc.
values[index]
Definition at line 657 of file element.cc.
vars[expr]
Definition at line 1617 of file element.cc.
| IntExpr * MakeElement | ( | Solver::IndexEvaluator1 | values, |
| IntVar *const | 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.
| IntExpr * MakeElement | ( | Solver::IndexEvaluator2 | values, |
| IntVar *const | index1, | ||
| IntVar *const | index2 | ||
| ) |
2D version of function-based element expression, values(expr1, expr2).
Definition at line 1114 of file element.cc.
| IntExpr * MakeElement | ( | Int64ToIntVar | vars, |
| int64_t | range_start, | ||
| int64_t | range_end, | ||
| IntVar * | argument | ||
| ) |
vars(argument)
Definition at line 1664 of file element.cc.
| Constraint * MakeElementEquality | ( | const std::vector< int > & | vals, |
| IntVar *const | index, | ||
| IntVar *const | target | ||
| ) |
Definition at line 1687 of file element.cc.
| Constraint * MakeElementEquality | ( | const std::vector< int64_t > & | vals, |
| IntVar *const | index, | ||
| IntVar *const | target | ||
| ) |
Definition at line 1681 of file element.cc.
| Constraint * MakeElementEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | index, | ||
| int64_t | target | ||
| ) |
Definition at line 1720 of file element.cc.
| Constraint * MakeElementEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | index, | ||
| IntVar *const | target | ||
| ) |
Definition at line 1693 of file element.cc.
| SearchMonitor * MakeEnterSearchCallback | ( | std::function< void()> | callback | ) |
| Constraint * MakeEquality | ( | IntervalVar *const | var1, |
| IntervalVar *const | var2 | ||
| ) |
This constraints states that the two interval variables are equal.
Definition at line 597 of file sched_constraints.cc.
| Constraint * MakeEquality | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr == value
Definition at line 101 of file expr_cst.cc.
| Constraint * MakeEquality | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr == value
Definition at line 86 of file expr_cst.cc.
| Constraint * MakeEquality | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left == right
Definition at line 512 of file range_cst.cc.
| SearchMonitor * MakeExitSearchCallback | ( | std::function< void()> | callback | ) |
| Decision * MakeFailDecision | ( | ) |
Definition at line 1383 of file constraint_solver.cc.
| RegularLimit * MakeFailuresLimit | ( | int64_t | failures | ) |
| Constraint * MakeFalseConstraint | ( | ) |
This constraint always fails.
Definition at line 523 of file constraints.cc.
| Constraint * MakeFalseConstraint | ( | const std::string & | explanation | ) |
Definition at line 527 of file constraints.cc.
| SolutionCollector * MakeFirstSolutionCollector | ( | ) |
| SolutionCollector * MakeFirstSolutionCollector | ( | const Assignment *const | assignment | ) |
| IntervalVar * MakeFixedDurationEndSyncedOnEndIntervalVar | ( | IntervalVar *const | 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 2451 of file interval.cc.
| IntervalVar * MakeFixedDurationEndSyncedOnStartIntervalVar | ( | IntervalVar *const | 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 2444 of file interval.cc.
| IntervalVar * 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 2271 of file interval.cc.
| IntervalVar * MakeFixedDurationIntervalVar | ( | IntVar *const | 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 2299 of file interval.cc.
| IntervalVar * MakeFixedDurationIntervalVar | ( | IntVar *const | start_variable, |
| int64_t | duration, | ||
| IntVar *const | 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 2310 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| const std::vector< int > & | durations, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with interval variables built with the corresponding start variables.
Definition at line 2359 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| const std::vector< int > & | durations, | ||
| const std::vector< IntVar * > & | performed_variables, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with interval variables built with the corresponding start and performed variables.
Definition at line 2373 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| const std::vector< int64_t > & | durations, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with interval variables built with the corresponding start variables.
Definition at line 2345 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| const std::vector< int64_t > & | durations, | ||
| const std::vector< IntVar * > & | performed_variables, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with interval variables built with the corresponding start and performed variables.
Definition at line 2387 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | const std::vector< IntVar * > & | start_variables, |
| int64_t | duration, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with 'count' interval var built with the corresponding start variables.
Definition at line 2331 of file interval.cc.
| void MakeFixedDurationIntervalVarArray | ( | int | count, |
| int64_t | start_min, | ||
| int64_t | start_max, | ||
| int64_t | duration, | ||
| bool | optional, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with 'count' interval variables built with the corresponding parameters.
Definition at line 2286 of file interval.cc.
| IntervalVar * MakeFixedDurationStartSyncedOnEndIntervalVar | ( | IntervalVar *const | 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 2437 of file interval.cc.
| IntervalVar * MakeFixedDurationStartSyncedOnStartIntervalVar | ( | IntervalVar *const | 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 2430 of file interval.cc.
| IntervalVar * MakeFixedInterval | ( | int64_t | start, |
| int64_t | duration, | ||
| const std::string & | name | ||
| ) |
Creates a fixed and performed interval.
Definition at line 2266 of file interval.cc.
| SearchMonitor * MakeGenericTabuSearch | ( | bool | maximize, |
| IntVar *const | v, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | tabu_vars, | ||
| int64_t | forbid_tenure | ||
| ) |
| Constraint * MakeGreater | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr > value
Definition at line 203 of file expr_cst.cc.
| Constraint * MakeGreater | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr > value
Definition at line 192 of file expr_cst.cc.
| Constraint * MakeGreater | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left > right
Definition at line 560 of file range_cst.cc.
| Constraint * MakeGreaterOrEqual | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr >= value
Definition at line 181 of file expr_cst.cc.
| Constraint * MakeGreaterOrEqual | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr >= value
Definition at line 170 of file expr_cst.cc.
| Constraint * MakeGreaterOrEqual | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left >= right
Definition at line 542 of file range_cst.cc.
| SearchMonitor * MakeGuidedLocalSearch | ( | bool | maximize, |
| IntVar *const | objective, | ||
| Solver::IndexEvaluator2 | objective_function, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | vars, | ||
| double | penalty_factor | ||
| ) |
Creates a Guided Local Search monitor.
Description here: http://en.wikipedia.org/wiki/Guided_Local_Search
| SearchMonitor * MakeGuidedLocalSearch | ( | bool | maximize, |
| IntVar *const | objective, | ||
| Solver::IndexEvaluator3 | objective_function, | ||
| int64_t | step, | ||
| const std::vector< IntVar * > & | vars, | ||
| const std::vector< IntVar * > & | secondary_vars, | ||
| double | penalty_factor | ||
| ) |
| Constraint * MakeIfThenElseCt | ( | IntVar *const | condition, |
| IntExpr *const | then_expr, | ||
| IntExpr *const | else_expr, | ||
| IntVar *const | target_var | ||
| ) |
Special cases with arrays of size two.
Definition at line 1609 of file element.cc.
| ImprovementSearchLimit * MakeImprovementLimit | ( | IntVar * | objective_var, |
| bool | maximize, | ||
| double | objective_scaling_factor, | ||
| double | objective_offset, | ||
| double | improvement_rate_coefficient, | ||
| int | improvement_rate_solutions_distance | ||
| ) |
Returns the expression expr such that vars[expr] == value.
It assumes that vars are all different.
Definition at line 1759 of file element.cc.
| Constraint * MakeIndexOfConstraint | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | 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 1744 of file element.cc.
| Constraint * 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 558 of file constraints.cc.
| Constraint * 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 563 of file constraints.cc.
| IntVar * MakeIntConst | ( | int64_t | val | ) |
IntConst will create a constant expression.
Definition at line 6491 of file expressions.cc.
| IntVar * MakeIntConst | ( | int64_t | val, |
| const std::string & | name | ||
| ) |
IntConst will create a constant expression.
Definition at line 6480 of file expressions.cc.
| IntervalVar * MakeIntervalRelaxedMax | ( | IntervalVar *const | interval_var | ) |
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:
This is very useful for implementing propagators that may only modify the start min or end min.
Definition at line 2241 of file interval.cc.
| IntervalVar * MakeIntervalRelaxedMin | ( | IntervalVar *const | interval_var | ) |
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:
This is very useful to implement propagators that may only modify the start max or end max.
Definition at line 2250 of file interval.cc.
| 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 | ||
| ) |
Creates an interval var by specifying the bounds on start, duration, and end.
Definition at line 2403 of file interval.cc.
| 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, | ||
| const std::string & | name, | ||
| std::vector< IntervalVar * > *const | array | ||
| ) |
This method fills the vector with 'count' interval var built with the corresponding parameters.
Definition at line 2412 of file interval.cc.
| Constraint * MakeIntervalVarRelation | ( | IntervalVar *const | t, |
| Solver::UnaryIntervalRelation | r, | ||
| int64_t | d | ||
| ) |
This method creates a relation between an interval var and a date.
Definition at line 114 of file timetabling.cc.
| Constraint * MakeIntervalVarRelation | ( | IntervalVar *const | t1, |
| Solver::BinaryIntervalRelation | r, | ||
| IntervalVar *const | t2 | ||
| ) |
This method creates a relation between two interval vars.
Definition at line 233 of file timetabling.cc.
| Constraint * MakeIntervalVarRelationWithDelay | ( | IntervalVar *const | t1, |
| Solver::BinaryIntervalRelation | r, | ||
| IntervalVar *const | t2, | ||
| int64_t | delay | ||
| ) |
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 239 of file timetabling.cc.
| IntVar * MakeIntVar | ( | const std::vector< int > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6476 of file expressions.cc.
| IntVar * MakeIntVar | ( | const std::vector< int > & | values, |
| const std::string & | name | ||
| ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6471 of file expressions.cc.
| IntVar * MakeIntVar | ( | const std::vector< int64_t > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6467 of file expressions.cc.
| IntVar * MakeIntVar | ( | const std::vector< int64_t > & | values, |
| const std::string & | name | ||
| ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 6416 of file expressions.cc.
| IntVar * MakeIntVar | ( | int64_t | min, |
| int64_t | max | ||
| ) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 6404 of file expressions.cc.
| 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.
Definition at line 6388 of file expressions.cc.
| IntVar ** 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 6527 of file expressions.cc.
| void 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 6512 of file expressions.cc.
| void 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 6520 of file expressions.cc.
| Constraint * 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 553 of file constraints.cc.
| Constraint * MakeIsBetweenCt | ( | IntExpr *const | expr, |
| int64_t | l, | ||
| int64_t | u, | ||
| IntVar *const | b | ||
| ) |
b == (l <= expr <= u)
Definition at line 1051 of file expr_cst.cc.
Definition at line 1087 of file expr_cst.cc.
| Constraint * MakeIsDifferentCstCt | ( | IntExpr *const | var, |
| int64_t | value, | ||
| IntVar *const | boolvar | ||
| ) |
boolvar == (var != value)
Definition at line 589 of file expr_cst.cc.
status var of (var != value)
Definition at line 580 of file expr_cst.cc.
| Constraint * MakeIsDifferentCt | ( | IntExpr *const | v1, |
| IntExpr *const | v2, | ||
| IntVar *const | b | ||
| ) |
b == (v1 != v2)
Definition at line 686 of file range_cst.cc.
status var of (v1 != v2)
Definition at line 641 of file range_cst.cc.
| Constraint * MakeIsEqualCstCt | ( | IntExpr *const | var, |
| int64_t | value, | ||
| IntVar *const | boolvar | ||
| ) |
boolvar == (var == value)
Definition at line 487 of file expr_cst.cc.
status var of (var == value)
Definition at line 462 of file expr_cst.cc.
| Constraint * MakeIsEqualCt | ( | IntExpr *const | v1, |
| IntExpr * | v2, | ||
| IntVar *const | b | ||
| ) |
b == (v1 == v2)
Definition at line 622 of file range_cst.cc.
status var of (v1 == v2)
Definition at line 577 of file range_cst.cc.
| Constraint * MakeIsGreaterCstCt | ( | IntExpr *const | v, |
| int64_t | c, | ||
| IntVar *const | b | ||
| ) |
b == (v > c)
Definition at line 716 of file expr_cst.cc.
status var of (var > value)
Definition at line 696 of file expr_cst.cc.
| Constraint * MakeIsGreaterCt | ( | IntExpr *const | left, |
| IntExpr *const | right, | ||
| IntVar *const | b | ||
| ) |
b == (left > right)
Definition at line 800 of file range_cst.cc.
| Constraint * MakeIsGreaterOrEqualCstCt | ( | IntExpr *const | var, |
| int64_t | value, | ||
| IntVar *const | boolvar | ||
| ) |
boolvar == (var >= value)
Definition at line 700 of file expr_cst.cc.
status var of (var >= value)
Definition at line 679 of file expr_cst.cc.
| Constraint * MakeIsGreaterOrEqualCt | ( | IntExpr *const | left, |
| IntExpr *const | right, | ||
| IntVar *const | b | ||
| ) |
b == (left >= right)
Definition at line 790 of file range_cst.cc.
status var of (left >= right)
Definition at line 785 of file range_cst.cc.
status var of (left > right)
Definition at line 796 of file range_cst.cc.
| Constraint * MakeIsLessCstCt | ( | IntExpr *const | v, |
| int64_t | c, | ||
| IntVar *const | b | ||
| ) |
b == (v < c)
Definition at line 816 of file expr_cst.cc.
status var of (var < value)
Definition at line 796 of file expr_cst.cc.
| Constraint * MakeIsLessCt | ( | IntExpr *const | left, |
| IntExpr *const | right, | ||
| IntVar *const | b | ||
| ) |
b == (left < right)
Definition at line 773 of file range_cst.cc.
| Constraint * MakeIsLessOrEqualCstCt | ( | IntExpr *const | var, |
| int64_t | value, | ||
| IntVar *const | boolvar | ||
| ) |
boolvar == (var <= value)
Definition at line 800 of file expr_cst.cc.
status var of (var <= value)
Definition at line 779 of file expr_cst.cc.
| Constraint * MakeIsLessOrEqualCt | ( | IntExpr *const | left, |
| IntExpr *const | right, | ||
| IntVar *const | b | ||
| ) |
b == (left <= right)
Definition at line 730 of file range_cst.cc.
status var of (left <= right)
Definition at line 698 of file range_cst.cc.
status var of (left < right)
Definition at line 742 of file range_cst.cc.
| Constraint * MakeIsMemberCt | ( | IntExpr *const | expr, |
| const std::vector< int > & | values, | ||
| IntVar *const | boolvar | ||
| ) |
Definition at line 1489 of file expr_cst.cc.
| Constraint * MakeIsMemberCt | ( | IntExpr *const | expr, |
| const std::vector< int64_t > & | values, | ||
| IntVar *const | boolvar | ||
| ) |
boolvar == (expr in set)
Definition at line 1483 of file expr_cst.cc.
Definition at line 1502 of file expr_cst.cc.
Definition at line 1495 of file expr_cst.cc.
| SolutionCollector * MakeLastSolutionCollector | ( | ) |
| SolutionCollector * MakeLastSolutionCollector | ( | const Assignment *const | assignment | ) |
| Constraint * MakeLess | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr < value
Definition at line 300 of file expr_cst.cc.
| Constraint * MakeLess | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr < value
Definition at line 289 of file expr_cst.cc.
| Constraint * MakeLess | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left < right
Definition at line 546 of file range_cst.cc.
| Constraint * MakeLessOrEqual | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr <= value
Definition at line 278 of file expr_cst.cc.
| Constraint * MakeLessOrEqual | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr <= value
Definition at line 267 of file expr_cst.cc.
| Constraint * MakeLessOrEqual | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left <= right
Definition at line 526 of file range_cst.cc.
| Constraint * 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 543 of file constraints.cc.
| Constraint * 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 548 of file constraints.cc.
| RegularLimit * MakeLimit | ( | absl::Duration | time, |
| int64_t | branches, | ||
| int64_t | failures, | ||
| int64_t | solutions, | ||
| bool | smart_time_check = false, |
||
| bool | cumulative = false |
||
| ) |
| RegularLimit * MakeLimit | ( | const RegularLimitParameters & | proto | ) |
| RegularLimit * MakeLimit | ( | int64_t | time, |
| int64_t | branches, | ||
| int64_t | failures, | ||
| int64_t | solutions, | ||
| bool | smart_time_check = false, |
||
| bool | cumulative = false |
||
| ) |
| SearchLimit * MakeLimit | ( | SearchLimit *const | limit_1, |
| SearchLimit *const | limit_2 | ||
| ) |
| DecisionBuilder * MakeLocalSearchPhase | ( | Assignment *const | assignment, |
| LocalSearchPhaseParameters *const | parameters | ||
| ) |
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:
Definition at line 4888 of file local_search.cc.
| DecisionBuilder * MakeLocalSearchPhase | ( | const std::vector< IntVar * > & | vars, |
| DecisionBuilder *const | first_solution, | ||
| DecisionBuilder *const | first_solution_sub_decision_builder, | ||
| LocalSearchPhaseParameters *const | parameters | ||
| ) |
Variant with a sub_decison_builder specific to the first solution.
Definition at line 4906 of file local_search.cc.
| DecisionBuilder * MakeLocalSearchPhase | ( | const std::vector< IntVar * > & | vars, |
| DecisionBuilder *const | first_solution, | ||
| LocalSearchPhaseParameters *const | parameters | ||
| ) |
Definition at line 4896 of file local_search.cc.
| DecisionBuilder * MakeLocalSearchPhase | ( | const std::vector< SequenceVar * > & | vars, |
| DecisionBuilder *const | first_solution, | ||
| LocalSearchPhaseParameters *const | parameters | ||
| ) |
Definition at line 4917 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder | ||
| ) |
Local Search Phase Parameters.
Definition at line 4465 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder, | ||
| RegularLimit *const | limit | ||
| ) |
Definition at line 4473 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder, | ||
| RegularLimit *const | limit, | ||
| LocalSearchFilterManager * | filter_manager | ||
| ) |
Definition at line 4481 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| SolutionPool *const | pool, | ||
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder | ||
| ) |
Definition at line 4490 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| SolutionPool *const | pool, | ||
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder, | ||
| RegularLimit *const | limit | ||
| ) |
Definition at line 4498 of file local_search.cc.
| LocalSearchPhaseParameters * MakeLocalSearchPhaseParameters | ( | IntVar * | objective, |
| SolutionPool *const | pool, | ||
| LocalSearchOperator *const | ls_operator, | ||
| DecisionBuilder *const | sub_decision_builder, | ||
| RegularLimit *const | limit, | ||
| LocalSearchFilterManager * | filter_manager | ||
| ) |
Definition at line 4506 of file local_search.cc.
| SearchMonitor * MakeLubyRestart | ( | int | scale_factor | ) |
| Constraint * MakeMapDomain | ( | IntVar *const | 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 538 of file constraints.cc.
std::max(vars)
Definition at line 3344 of file expr_array.cc.
std::max(expr, value)
Definition at line 7158 of file expressions.cc.
std::max(expr, value)
Definition at line 7144 of file expressions.cc.
std::max(left, right)
Definition at line 7126 of file expressions.cc.
| Constraint * MakeMaxEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | max_var | ||
| ) |
Definition at line 3409 of file expr_array.cc.
| OptimizeVar * MakeMaximize | ( | IntVar *const | v, |
| int64_t | step | ||
| ) |
| Constraint * MakeMemberCt | ( | IntExpr *const | expr, |
| const std::vector< int > & | values | ||
| ) |
Definition at line 1228 of file expr_cst.cc.
| Constraint * MakeMemberCt | ( | IntExpr *const | 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 1163 of file expr_cst.cc.
std::min(vars)
Definition at line 3301 of file expr_array.cc.
std::min(expr, value)
Definition at line 7122 of file expressions.cc.
std::min(expr, value)
Definition at line 7108 of file expressions.cc.
std::min (left, right)
Definition at line 7090 of file expressions.cc.
| Constraint * MakeMinEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | min_var | ||
| ) |
Definition at line 3387 of file expr_array.cc.
| OptimizeVar * MakeMinimize | ( | IntVar *const | v, |
| int64_t | step | ||
| ) |
| IntervalVar * MakeMirrorInterval | ( | IntervalVar *const | interval_var | ) |
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 2236 of file interval.cc.
Modulo expression x % mod (with the python convention for modulo).
Definition at line 7273 of file expressions.cc.
Modulo expression x % mod (with the python convention for modulo).
Definition at line 7284 of file expressions.cc.
| IntExpr * MakeMonotonicElement | ( | Solver::IndexEvaluator1 | values, |
| bool | increasing, | ||
| IntVar *const | 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.
| LocalSearchOperator * MakeMoveTowardTargetOperator | ( | const Assignment & | target | ) |
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 271 of file local_search.cc.
| LocalSearchOperator * 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 287 of file local_search.cc.
| SolutionCollector * MakeNBestValueSolutionCollector | ( | const Assignment *const | assignment, |
| int | solution_count, | ||
| bool | maximize | ||
| ) |
| SolutionCollector * MakeNBestValueSolutionCollector | ( | int | solution_count, |
| bool | maximize | ||
| ) |
| LocalSearchOperator * MakeNeighborhoodLimit | ( | LocalSearchOperator *const | op, |
| int64_t | limit | ||
| ) |
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 1889 of file local_search.cc.
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step | ||
| ) |
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.
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step, | ||
| const std::vector< SearchMonitor * > & | monitors | ||
| ) |
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step, | ||
| SearchMonitor *const | monitor1 | ||
| ) |
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step, | ||
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2 | ||
| ) |
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step, | ||
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2, | ||
| SearchMonitor *const | monitor3 | ||
| ) |
| DecisionBuilder * MakeNestedOptimize | ( | DecisionBuilder *const | db, |
| Assignment *const | solution, | ||
| bool | maximize, | ||
| int64_t | step, | ||
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2, | ||
| SearchMonitor *const | monitor3, | ||
| SearchMonitor *const | monitor4 | ||
| ) |
| Constraint * MakeNoCycle | ( | const std::vector< IntVar * > & | nexts, |
| const std::vector< IntVar * > & | active, | ||
| Solver::IndexFilter1 | sink_handler, | ||
| bool | assume_paths | ||
| ) |
Definition at line 620 of file graph_constraints.cc.
| Constraint * 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 632 of file graph_constraints.cc.
| Constraint * MakeNonEquality | ( | IntExpr *const | expr, |
| int | value | ||
| ) |
expr != value
Definition at line 394 of file expr_cst.cc.
| Constraint * MakeNonEquality | ( | IntExpr *const | expr, |
| int64_t | value | ||
| ) |
expr != value
Definition at line 379 of file expr_cst.cc.
| Constraint * MakeNonEquality | ( | IntExpr *const | left, |
| IntExpr *const | right | ||
| ) |
left != right
Definition at line 564 of file range_cst.cc.
| Constraint * MakeNonOverlappingBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< int > & | x_size, | ||
| const std::vector< int > & | y_size | ||
| ) |
Definition at line 317 of file constraint_solver/diffn.cc.
| Constraint * MakeNonOverlappingBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< int64_t > & | x_size, | ||
| const std::vector< int64_t > & | y_size | ||
| ) |
Definition at line 305 of file constraint_solver/diffn.cc.
| 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 | ||
| ) |
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.
Definition at line 299 of file constraint_solver/diffn.cc.
| Constraint * MakeNonOverlappingNonStrictBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< int > & | x_size, | ||
| const std::vector< int > & | y_size | ||
| ) |
Definition at line 347 of file constraint_solver/diffn.cc.
| Constraint * MakeNonOverlappingNonStrictBoxesConstraint | ( | const std::vector< IntVar * > & | x_vars, |
| const std::vector< IntVar * > & | y_vars, | ||
| const std::vector< int64_t > & | x_size, | ||
| const std::vector< int64_t > & | y_size | ||
| ) |
Definition at line 335 of file constraint_solver/diffn.cc.
| 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 | ||
| ) |
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.
Definition at line 329 of file constraint_solver/diffn.cc.
| Constraint * MakeNotBetweenCt | ( | IntExpr *const | 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 956 of file expr_cst.cc.
| Constraint * MakeNotMemberCt | ( | IntExpr *const | expr, |
| const std::vector< int > & | values | ||
| ) |
Definition at line 1297 of file expr_cst.cc.
| Constraint * MakeNotMemberCt | ( | IntExpr *const | expr, |
| const std::vector< int64_t > & | values | ||
| ) |
expr not in set.
Definition at line 1233 of file expr_cst.cc.
| Constraint * MakeNotMemberCt | ( | IntExpr *const | 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 1583 of file expr_cst.cc.
| Constraint * MakeNotMemberCt | ( | IntExpr *const | 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 1576 of file expr_cst.cc.
| Constraint * MakeNotMemberCt | ( | IntExpr * | expr, |
| SortedDisjointIntervalList | intervals | ||
| ) |
expr should not be in the list of forbidden intervals.
Definition at line 1590 of file expr_cst.cc.
| Constraint * 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.
| Constraint * 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.
| LocalSearchOperator * MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::IndexEvaluator3 | evaluator, | ||
| Solver::EvaluatorLocalSearchOperators | op | ||
| ) |
Definition at line 2438 of file local_search.cc.
| LocalSearchOperator * MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::LocalSearchOperators | op | ||
| ) |
Definition at line 2324 of file local_search.cc.
| LocalSearchOperator * MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator3 | evaluator, | ||
| Solver::EvaluatorLocalSearchOperators | op | ||
| ) |
Definition at line 2432 of file local_search.cc.
| LocalSearchOperator * MakeOperator | ( | const std::vector< IntVar * > & | vars, |
| Solver::LocalSearchOperators | op | ||
| ) |
Local Search Operators.
Definition at line 2319 of file local_search.cc.
-expr
Definition at line 6761 of file expressions.cc.
| OptimizeVar * MakeOptimize | ( | bool | maximize, |
| IntVar *const | v, | ||
| int64_t | step | ||
| ) |
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.
| Constraint * MakePathConnected | ( | std::vector< IntVar * > | nexts, |
| std::vector< int64_t > | sources, | ||
| std::vector< int64_t > | sinks, | ||
| std::vector< IntVar * > | status | ||
| ) |
Constraint enforcing that status[i] is true iff there's a path defined on next variables from sources[i] to sinks[i].
Check whether more propagation is needed.
Definition at line 1438 of file graph_constraints.cc.
| Constraint * 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 1318 of file graph_constraints.cc.
| Constraint * 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 1300 of file graph_constraints.cc.
| Constraint * 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 1309 of file graph_constraints.cc.
| Constraint * 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 1623 of file graph_constraints.cc.
| Constraint * MakePathPrecedenceConstraint | ( | std::vector< IntVar * > | nexts, |
| const std::vector< std::pair< int, int > > & | precedences, | ||
| const std::vector< int > & | lifo_path_starts, | ||
| const std::vector< 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 1629 of file graph_constraints.cc.
| Constraint * 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 1646 of file graph_constraints.cc.
| DecisionBuilder * MakePhase | ( | const std::vector< IntervalVar * > & | intervals, |
| IntervalStrategy | str | ||
| ) |
Scheduling phases.
Definition at line 853 of file sched_search.cc.
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IndexEvaluator2 | value_evaluator | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IndexEvaluator2 | value_evaluator, | ||
| Solver::IndexEvaluator1 | tie_breaker | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator1 | var_evaluator, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| DecisionBuilder * 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.
| DecisionBuilder * 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.
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IndexEvaluator2 | value_evaluator | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IndexEvaluator2 | value_evaluator, | ||
| Solver::IndexEvaluator1 | tie_breaker | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< IntVar * > & | vars, |
| IntVarStrategy | var_str, | ||
| VariableValueComparator | var_val1_val2_comparator | ||
| ) |
| DecisionBuilder * MakePhase | ( | const std::vector< SequenceVar * > & | sequences, |
| SequenceStrategy | str | ||
| ) |
Definition at line 878 of file sched_search.cc.
| DecisionBuilder * MakePhase | ( | IntVar *const | v0, |
| IntVar *const | v1, | ||
| IntVar *const | v2, | ||
| IntVar *const | v3, | ||
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| DecisionBuilder * MakePhase | ( | IntVar *const | v0, |
| IntVar *const | v1, | ||
| IntVar *const | v2, | ||
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| DecisionBuilder * MakePhase | ( | IntVar *const | v0, |
| IntVar *const | v1, | ||
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| DecisionBuilder * MakePhase | ( | IntVar *const | v0, |
| Solver::IntVarStrategy | var_str, | ||
| Solver::IntValueStrategy | val_str | ||
| ) |
| IntExpr * MakePiecewiseLinearExpr | ( | IntExpr * | expr, |
| const PiecewiseLinearFunction & | f | ||
| ) |
General piecewise-linear function expression, built from f(x) where f is piecewise-linear.
The resulting expression is f(expr). expressions.
Definition at line 7242 of file expressions.cc.
expr ^ n (n > 0)
Definition at line 7056 of file expressions.cc.
| ModelVisitor * MakePrintModelVisitor | ( | ) |
Prints the model.
Definition at line 813 of file utilities.cc.
expr * value
Definition at line 6779 of file expressions.cc.
left * right
Definition at line 6869 of file expressions.cc.
| DecisionBuilder * MakeProfiledDecisionBuilderWrapper | ( | DecisionBuilder * | db | ) |
Activates profiling on a decision builder.
Definition at line 3908 of file local_search.cc.
| LocalSearchOperator * 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 193 of file local_search.cc.
| LocalSearchOperator * MakeRandomLnsOperator | ( | const std::vector< IntVar * > & | vars, |
| int | number_of_variables, | ||
| int32_t | seed | ||
| ) |
Definition at line 198 of file local_search.cc.
| Decision * MakeRankFirstInterval | ( | SequenceVar *const | sequence, |
| int | index | ||
| ) |
Returns a decision that tries to rank first the ith interval var in the sequence variable.
Definition at line 867 of file sched_search.cc.
| Decision * MakeRankLastInterval | ( | SequenceVar *const | sequence, |
| int | index | ||
| ) |
Returns a decision that tries to rank last the ith interval var in the sequence variable.
Definition at line 873 of file sched_search.cc.
| LocalSearchFilter * MakeRejectFilter | ( | ) |
Definition at line 2564 of file local_search.cc.
| DecisionBuilder * MakeRestoreAssignment | ( | Assignment * | assignment | ) |
Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore())
Definition at line 1086 of file constraint_solver/assignment.cc.
scalar product
Definition at line 3570 of file expr_array.cc.
| IntExpr * MakeScalProd | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefs | ||
| ) |
scalar product
Definition at line 3564 of file expr_array.cc.
| Constraint * MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| int64_t | cst | ||
| ) |
Definition at line 3513 of file expr_array.cc.
| Constraint * MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| IntVar *const | target | ||
| ) |
Definition at line 3527 of file expr_array.cc.
| Constraint * MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| int64_t | cst | ||
| ) |
Definition at line 3506 of file expr_array.cc.
| Constraint * MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| IntVar *const | target | ||
| ) |
Definition at line 3520 of file expr_array.cc.
| Constraint * MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coeffs, | ||
| int64_t | cst | ||
| ) |
Definition at line 3542 of file expr_array.cc.
| Constraint * MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coeffs, | ||
| int64_t | cst | ||
| ) |
Definition at line 3535 of file expr_array.cc.
| Constraint * MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int > & | coefficients, | ||
| int64_t | cst | ||
| ) |
Definition at line 3556 of file expr_array.cc.
| Constraint * MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< int64_t > & | coefficients, | ||
| int64_t | cst | ||
| ) |
Definition at line 3549 of file expr_array.cc.
| Decision * MakeScheduleOrExpedite | ( | IntervalVar *const | var, |
| int64_t | est, | ||
| int64_t *const | 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 846 of file sched_search.cc.
| Decision * MakeScheduleOrPostpone | ( | IntervalVar *const | var, |
| int64_t | est, | ||
| int64_t *const | 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 839 of file sched_search.cc.
| SearchMonitor * MakeSearchLog | ( | int | branch_period | ) |
| SearchMonitor * MakeSearchLog | ( | int | branch_period, |
| IntVar *const | var | ||
| ) |
| SearchMonitor * MakeSearchLog | ( | int | branch_period, |
| IntVar * | var, | ||
| std::function< std::string()> | display_callback | ||
| ) |
| SearchMonitor * MakeSearchLog | ( | int | branch_period, |
| OptimizeVar *const | opt_var | ||
| ) |
OptimizeVar Search Logs At each solution, this monitor will also display the 'opt_var' value.
| SearchMonitor * MakeSearchLog | ( | int | branch_period, |
| OptimizeVar *const | opt_var, | ||
| std::function< std::string()> | display_callback | ||
| ) |
| SearchMonitor * MakeSearchLog | ( | int | branch_period, |
| std::function< std::string()> | display_callback | ||
| ) |
| SearchMonitor * MakeSearchLog | ( | SearchLogParameters | parameters | ) |
| SearchMonitor * MakeSearchTrace | ( | const std::string & | prefix | ) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0.
Definition at line 7169 of file expressions.cc.
| SearchMonitor * MakeSimulatedAnnealing | ( | bool | maximize, |
| IntVar *const | v, | ||
| int64_t | step, | ||
| int64_t | initial_temperature | ||
| ) |
| RegularLimit * MakeSolutionsLimit | ( | int64_t | solutions | ) |
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db | ) |
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.
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db, |
| const std::vector< SearchMonitor * > & | monitors | ||
| ) |
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | monitor1 | ||
| ) |
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2 | ||
| ) |
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2, | ||
| SearchMonitor *const | monitor3 | ||
| ) |
| DecisionBuilder * MakeSolveOnce | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | monitor1, | ||
| SearchMonitor *const | monitor2, | ||
| SearchMonitor *const | monitor3, | ||
| SearchMonitor *const | monitor4 | ||
| ) |
| Constraint * 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:
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.
expr * expr
Definition at line 7038 of file expressions.cc.
| ModelVisitor * MakeStatisticsModelVisitor | ( | ) |
Displays some nice statistics on the model.
Definition at line 817 of file utilities.cc.
| DecisionBuilder * MakeStoreAssignment | ( | Assignment * | assignment | ) |
Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store())
Definition at line 1090 of file constraint_solver/assignment.cc.
| DisjunctiveConstraint * 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 2590 of file resource.cc.
| Constraint * 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 643 of file graph_constraints.cc.
sum of all vars.
Definition at line 3252 of file expr_array.cc.
expr + value.
Definition at line 6596 of file expressions.cc.
left + right.
Definition at line 6564 of file expressions.cc.
| Constraint * MakeSumEquality | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst | ||
| ) |
Definition at line 3451 of file expr_array.cc.
| Constraint * MakeSumEquality | ( | const std::vector< IntVar * > & | vars, |
| IntVar *const | var | ||
| ) |
Definition at line 3481 of file expr_array.cc.
| Constraint * MakeSumGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst | ||
| ) |
Definition at line 3441 of file expr_array.cc.
| Constraint * MakeSumLessOrEqual | ( | const std::vector< IntVar * > & | vars, |
| int64_t | cst | ||
| ) |
Variation on arrays.
Definition at line 3431 of file expr_array.cc.
| IntVarLocalSearchFilter * MakeSumObjectiveFilter | ( | const std::vector< IntVar * > & | vars, |
| const std::vector< IntVar * > & | secondary_vars, | ||
| Solver::IndexEvaluator3 | values, | ||
| Solver::LocalSearchFilterBound | filter_enum | ||
| ) |
Definition at line 3593 of file local_search.cc.
| IntVarLocalSearchFilter * MakeSumObjectiveFilter | ( | const std::vector< IntVar * > & | vars, |
| Solver::IndexEvaluator2 | values, | ||
| Solver::LocalSearchFilterBound | filter_enum | ||
| ) |
Definition at line 3586 of file local_search.cc.
| SearchMonitor * MakeSymmetryManager | ( | const std::vector< SymmetryBreaker * > & | visitors | ) |
| SearchMonitor * MakeSymmetryManager | ( | SymmetryBreaker *const | v1 | ) |
| SearchMonitor * MakeSymmetryManager | ( | SymmetryBreaker *const | v1, |
| SymmetryBreaker *const | v2 | ||
| ) |
| SearchMonitor * MakeSymmetryManager | ( | SymmetryBreaker *const | v1, |
| SymmetryBreaker *const | v2, | ||
| SymmetryBreaker *const | v3 | ||
| ) |
| SearchMonitor * MakeSymmetryManager | ( | SymmetryBreaker *const | v1, |
| SymmetryBreaker *const | v2, | ||
| SymmetryBreaker *const | v3, | ||
| SymmetryBreaker *const | v4 | ||
| ) |
| SearchMonitor * MakeTabuSearch | ( | bool | maximize, |
| IntVar *const | v, | ||
| 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:
| Constraint * MakeTemporalDisjunction | ( | IntervalVar *const | t1, |
| IntervalVar *const | t2 | ||
| ) |
This constraint implements a temporal disjunction between two interval vars.
Definition at line 410 of file timetabling.cc.
| Constraint * MakeTemporalDisjunction | ( | IntervalVar *const | t1, |
| IntervalVar *const | t2, | ||
| IntVar *const | alt | ||
| ) |
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 404 of file timetabling.cc.
| RegularLimit * MakeTimeLimit | ( | absl::Duration | time | ) |
|
inline |
Definition at line 2209 of file constraint_solver.h.
| Constraint * 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.
Definition at line 1281 of file constraint_solver/table.cc.
| Constraint * 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.
Definition at line 1274 of file constraint_solver/table.cc.
| Constraint * MakeTrueConstraint | ( | ) |
This constraint always succeeds.
Definition at line 518 of file constraints.cc.
| ModelVisitor * MakeVariableDegreeVisitor | ( | absl::flat_hash_map< const IntVar *, int > *const | map | ) |
Compute the number of constraints a variable is attached to.
Definition at line 821 of file utilities.cc.
| LocalSearchFilter * MakeVariableDomainFilter | ( | ) |
Definition at line 3294 of file local_search.cc.
| OptimizeVar * MakeWeightedMaximize | ( | 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 | ||
| ) |
| OptimizeVar * MakeWeightedMinimize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int > & | weights, | ||
| int64_t | step | ||
| ) |
| OptimizeVar * MakeWeightedMinimize | ( | const std::vector< IntVar * > & | sub_objectives, |
| const std::vector< int64_t > & | weights, | ||
| int64_t | step | ||
| ) |
| OptimizeVar * MakeWeightedOptimize | ( | bool | maximize, |
| const std::vector< IntVar * > & | sub_objectives, | ||
| const std::vector< int > & | weights, | ||
| int64_t | step | ||
| ) |
| OptimizeVar * MakeWeightedOptimize | ( | bool | maximize, |
| const std::vector< IntVar * > & | sub_objectives, | ||
| const std::vector< int64_t > & | weights, | ||
| int64_t | step | ||
| ) |
|
static |
Current memory usage in bytes.
Definition at line 1522 of file constraint_solver.cc.
| std::string model_name | ( | ) | const |
Returns the name of the model.
Definition at line 1401 of file constraint_solver.cc.
| LocalSearchOperator * 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 2276 of file local_search.cc.
| bool NameAllVariables | ( | ) | const |
Returns whether all variables should be named.
Definition at line 191 of file constraint_solver.cc.
|
inline |
The number of neighbors created.
Definition at line 997 of file constraint_solver.h.
| void NewSearch | ( | DecisionBuilder *const | db | ) |
Definition at line 1813 of file constraint_solver.cc.
| void NewSearch | ( | DecisionBuilder *const | 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 1849 of file constraint_solver.cc.
| void NewSearch | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1 | ||
| ) |
Definition at line 1807 of file constraint_solver.cc.
| void NewSearch | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2 | ||
| ) |
Definition at line 1818 of file constraint_solver.cc.
| void NewSearch | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2, | ||
| SearchMonitor *const | m3 | ||
| ) |
Definition at line 1826 of file constraint_solver.cc.
| void NewSearch | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2, | ||
| SearchMonitor *const | m3, | ||
| SearchMonitor *const | m4 | ||
| ) |
Definition at line 1835 of file constraint_solver.cc.
| bool NextSolution | ( | ) |
Definition at line 2099 of file constraint_solver.cc.
| absl::Time 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 1528 of file constraint_solver.cc.
|
inline |
The direction of optimization, getter and setter.
Definition at line 1013 of file constraint_solver.h.
|
inline |
Stored Parameters.
Definition at line 763 of file constraint_solver.h.
| void PopState | ( | ) |
Definition at line 1567 of file constraint_solver.cc.
| void 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 1562 of file constraint_solver.cc.
|
inline |
Returns a random value between 0 and 'size' - 1;.
Definition at line 2847 of file constraint_solver.h.
|
inline |
Returns a random value between 0 and 'size' - 1;.
Definition at line 2841 of file constraint_solver.h.
| LocalSearchOperator * RandomConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops | ) |
Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor().
Definition at line 2112 of file local_search.cc.
| LocalSearchOperator * RandomConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, |
| int32_t | seed | ||
| ) |
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 2117 of file local_search.cc.
Adds a new demon and wraps it inside a DemonProfiler if necessary.
Definition at line 453 of file demon_profiler.cc.
| IntervalVar * RegisterIntervalVar | ( | IntervalVar *const | var | ) |
Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary.
|
inline |
Reseed the solver random generator.
Definition at line 2853 of file constraint_solver.h.
| void RestartCurrentSearch | ( | ) |
Definition at line 2437 of file constraint_solver.cc.
| void RestartSearch | ( | ) |
Definition at line 1991 of file constraint_solver.cc.
|
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 791 of file constraint_solver.h.
|
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 802 of file constraint_solver.h.
|
inline |
All-in-one SaveAndAdd_value.
Definition at line 2833 of file constraint_solver.h.
|
inline |
All-in-one SaveAndSetValue.
Definition at line 2824 of file constraint_solver.h.
|
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 774 of file constraint_solver.h.
| std::string SearchContext | ( | ) | const |
Definition at line 3232 of file constraint_solver.cc.
| std::string SearchContext | ( | const Search * | search | ) | const |
Definition at line 3236 of file constraint_solver.cc.
| int SearchDepth | ( | ) | const |
Gets the search depth of the current active search.
Returns -1 if there is no active search opened.
Definition at line 1179 of file constraint_solver.cc.
| int SearchLeftDepth | ( | ) | const |
Gets the search left depth of the current active search.
Returns -1 if there is no active search opened.
Definition at line 1181 of file constraint_solver.cc.
|
inline |
Internal.
Definition at line 2887 of file constraint_solver.h.
|
inline |
Definition at line 1016 of file constraint_solver.h.
| void SetBranchSelector | ( | BranchSelector | bs | ) |
Sets the given branch selector on the current active search.
Definition at line 1156 of file constraint_solver.cc.
| void SetSearchContext | ( | Search * | search, |
| const std::string & | search_context | ||
| ) |
Definition at line 3227 of file constraint_solver.cc.
|
inline |
enabled for metaheuristics.
Disables/enables fast local search.
Definition at line 2897 of file constraint_solver.h.
|
inline |
These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail.
Definition at line 2999 of file constraint_solver.h.
| int64_t solutions | ( | ) | const |
The number of solutions found since the start of the search.
Definition at line 1532 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | db | ) |
Definition at line 1764 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | 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 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:
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:
| 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 1797 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1 | ||
| ) |
Definition at line 1758 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2 | ||
| ) |
Definition at line 1769 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2, | ||
| SearchMonitor *const | m3 | ||
| ) |
Definition at line 1777 of file constraint_solver.cc.
| bool Solve | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2, | ||
| SearchMonitor *const | m3, | ||
| SearchMonitor *const | m4 | ||
| ) |
Definition at line 1786 of file constraint_solver.cc.
| bool SolveAndCommit | ( | DecisionBuilder *const | db | ) |
Definition at line 2389 of file constraint_solver.cc.
| bool SolveAndCommit | ( | DecisionBuilder *const | 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 2411 of file constraint_solver.cc.
| bool SolveAndCommit | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1 | ||
| ) |
Definition at line 2382 of file constraint_solver.cc.
| bool SolveAndCommit | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2 | ||
| ) |
Definition at line 2394 of file constraint_solver.cc.
| bool SolveAndCommit | ( | DecisionBuilder *const | db, |
| SearchMonitor *const | m1, | ||
| SearchMonitor *const | m2, | ||
| SearchMonitor *const | m3 | ||
| ) |
Definition at line 2402 of file constraint_solver.cc.
| int 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 1175 of file constraint_solver.cc.
| uint64_t 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 1649 of file constraint_solver.cc.
|
inline |
State of the solver.
Definition at line 952 of file constraint_solver.h.
| void 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 1548 of file constraint_solver.cc.
| int 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 1550 of file constraint_solver.cc.
| DecisionBuilder * Try | ( | const std::vector< DecisionBuilder * > & | dbs | ) |
| DecisionBuilder * Try | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2 | ||
| ) |
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.
| DecisionBuilder * Try | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2, | ||
| DecisionBuilder *const | db3 | ||
| ) |
| DecisionBuilder * Try | ( | DecisionBuilder *const | db1, |
| DecisionBuilder *const | db2, | ||
| DecisionBuilder *const | db3, | ||
| DecisionBuilder *const | db4 | ||
| ) |
| int64_t unchecked_solutions | ( | ) | const |
The number of unchecked solutions found by local search.
Definition at line 1536 of file constraint_solver.cc.
|
inline |
Returns true if fast local search is enabled.
Definition at line 2901 of file constraint_solver.h.
| int64_t wall_time | ( | ) | const |
DEPRECATED: Use Now() instead.
Time elapsed, in ms since the creation of the solver.
Definition at line 1524 of file constraint_solver.cc.
|
staticconstexpr |
Number of priorities for demons.
Definition at line 262 of file constraint_solver.h.
| std::vector<int64_t> 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 2953 of file constraint_solver.h.