Java Reference
Java Reference
Detailed Description
Solver Class A solver represents the main computation engine.
It implements the entire range of Constraint Programming protocols: - Reversibility - Propagation - Search Usually, Constraint Programming code consists of - the creation of the Solver, - the creation of the decision variables of the model, - the creation of the constraints of the model and their addition to the solver() through the AddConstraint() method, - the creation of the main DecisionBuilder class, - the launch of the solve() method with the decision builder. For the time being, Solver is neither MT_SAFE nor MT_HOT.
Definition at line 57 of file Solver.java.
Classes | |
| class | FailException |
| This exceptions signal that a failure has been raised in the C++ world. More... | |
| class | 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... | |
Public Member Functions | |
| synchronized void | delete () |
| IntVar[] | makeIntVarArray (int count, long min, long max) |
| IntVar[] | makeIntVarArray (int count, long min, long max, String name) |
| IntVar[] | makeBoolVarArray (int count) |
| IntVar[] | makeBoolVarArray (int count, String name) |
| IntervalVar[] | makeFixedDurationIntervalVarArray (int count, long start_min, long start_max, long duration, boolean optional) |
| IntervalVar[] | makeFixedDurationIntervalVarArray (int count, long start_min, long start_max, long duration, boolean optional, String name) |
| Solver (String name) | |
| Solver API. More... | |
| Solver (String name, com.google.ortools.constraintsolver.ConstraintSolverParameters parameters) | |
| com.google.ortools.constraintsolver.ConstraintSolverParameters | parameters () |
| Stored Parameters. More... | |
| void | addConstraint (Constraint c) |
| Adds the constraint 'c' to the model. More... | |
| void | addCastConstraint (CastConstraint constraint, IntVar target_var, IntExpr expr) |
| Adds 'constraint' to the solver and marks it as a cast constraint, that is, a constraint created calling Var() on an expression. More... | |
| boolean | solve (DecisionBuilder db, SearchMonitor[] monitors) |
| Solves the problem using the given DecisionBuilder and returns true if a solution was found and accepted. More... | |
| boolean | solve (DecisionBuilder db) |
| boolean | solve (DecisionBuilder db, SearchMonitor m1) |
| boolean | solve (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2) |
| boolean | solve (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2, SearchMonitor m3) |
| boolean | solve (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2, SearchMonitor m3, SearchMonitor m4) |
| void | newSearch (DecisionBuilder db, SearchMonitor[] monitors) |
| Decomposed search. More... | |
| void | newSearch (DecisionBuilder db) |
| void | newSearch (DecisionBuilder db, SearchMonitor m1) |
| void | newSearch (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2) |
| void | newSearch (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2, SearchMonitor m3) |
| void | newSearch (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2, SearchMonitor m3, SearchMonitor m4) |
| boolean | nextSolution () |
| void | restartSearch () |
| void | endSearch () |
| boolean | solveAndCommit (DecisionBuilder db, 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... | |
| boolean | solveAndCommit (DecisionBuilder db) |
| boolean | solveAndCommit (DecisionBuilder db, SearchMonitor m1) |
| boolean | solveAndCommit (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2) |
| boolean | solveAndCommit (DecisionBuilder db, SearchMonitor m1, SearchMonitor m2, SearchMonitor m3) |
| boolean | checkAssignment (Assignment solution) |
| Checks whether the given assignment satisfies all relevant constraints. More... | |
| boolean | checkConstraint (Constraint ct) |
| Checks whether adding this constraint will lead to an immediate failure. More... | |
| int | state () |
| State of the solver. More... | |
| void | fail () |
| Abandon the current branch in the search tree. More... | |
| String | toString () |
| misc debug string. More... | |
| long | wallTime () |
| DEPRECATED: Use Now() instead. More... | |
| long | branches () |
| The number of branches explored since the creation of the solver. More... | |
| long | solutions () |
| The number of solutions found since the start of the search. More... | |
| long | unchecked_solutions () |
| The number of unchecked solutions found by local search. More... | |
| long | demon_runs (int p) |
| The number of demons executed during search for a given priority. More... | |
| long | failures () |
| The number of failures encountered since the creation of the solver. More... | |
| long | neighbors () |
| The number of neighbors created. More... | |
| long | filteredNeighbors () |
| The number of filtered neighbors (neighbors accepted by filters). More... | |
| long | acceptedNeighbors () |
| The number of accepted neighbors. More... | |
| long | stamp () |
| The stamp indicates how many moves in the search tree we have performed. More... | |
| long | fail_stamp () |
| The fail_stamp() is incremented after each backtrack. More... | |
| int | optimization_direction () |
| The direction of optimization, getter and setter. More... | |
| void | set_optimization_direction (int direction) |
| IntVar | makeIntVar (long min, long max, String name) |
| MakeIntVar will create the best range based int var for the bounds given. More... | |
| IntVar | makeIntVar (long[] values, String name) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar | makeIntVar (int[] values, String name) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar | makeIntVar (long min, long max) |
| MakeIntVar will create the best range based int var for the bounds given. More... | |
| IntVar | makeIntVar (long[] values) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar | makeIntVar (int[] values) |
| MakeIntVar will create a variable with the given sparse domain. More... | |
| IntVar | makeBoolVar (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 (long val, String name) |
| IntConst will create a constant expression. More... | |
| IntVar | makeIntConst (long val) |
| IntConst will create a constant expression. More... | |
| IntExpr | makeSum (IntExpr left, IntExpr right) |
| left + right. More... | |
| IntExpr | makeSum (IntExpr expr, long value) |
| expr + value. More... | |
| IntExpr | makeSum (IntVar[] vars) |
| sum of all vars. More... | |
| IntExpr | makeScalProd (IntVar[] vars, long[] coefs) |
| scalar product More... | |
| IntExpr | makeScalProd (IntVar[] vars, int[] coefs) |
| scalar product More... | |
| IntExpr | makeDifference (IntExpr left, IntExpr right) |
| left - right More... | |
| IntExpr | makeDifference (long value, IntExpr expr) |
| value - expr More... | |
| IntExpr | makeOpposite (IntExpr expr) |
| -expr More... | |
| IntExpr | makeProd (IntExpr left, IntExpr right) |
| left * right More... | |
| IntExpr | makeProd (IntExpr expr, long value) |
| expr * value More... | |
| IntExpr | makeDiv (IntExpr expr, long value) |
| expr / value (integer division) More... | |
| IntExpr | makeDiv (IntExpr numerator, IntExpr denominator) |
| numerator / denominator (integer division). More... | |
| IntExpr | makeAbs (IntExpr expr) |
| |expr| More... | |
| IntExpr | makeSquare (IntExpr expr) |
| expr * expr More... | |
| IntExpr | makePower (IntExpr expr, long n) |
| expr ^ n (n > 0) More... | |
| IntExpr | makeElement (long[] values, IntVar index) |
| values[index] More... | |
| IntExpr | makeElement (int[] values, IntVar index) |
| values[index] More... | |
| IntExpr | makeElement (LongUnaryOperator values, IntVar index) |
| Function-based element. More... | |
| IntExpr | makeMonotonicElement (LongUnaryOperator values, boolean increasing, IntVar index) |
| Function based element. More... | |
| IntExpr | makeElement (LongBinaryOperator values, IntVar index1, IntVar index2) |
| 2D version of function-based element expression, values(expr1, expr2). More... | |
| IntExpr | makeElement (IntVar[] vars, IntVar index) |
| vars[expr] More... | |
| IntExpr | makeIndexExpression (IntVar[] vars, long value) |
| Returns the expression expr such that vars[expr] == value. More... | |
| Constraint | makeIfThenElseCt (IntVar condition, IntExpr then_expr, IntExpr else_expr, IntVar target_var) |
| Special cases with arrays of size two. More... | |
| IntExpr | makeMin (IntVar[] vars) |
| std::min(vars) More... | |
| IntExpr | makeMin (IntExpr left, IntExpr right) |
| std::min (left, right) More... | |
| IntExpr | makeMin (IntExpr expr, long value) |
| std::min(expr, value) More... | |
| IntExpr | makeMin (IntExpr expr, int value) |
| std::min(expr, value) More... | |
| IntExpr | makeMax (IntVar[] vars) |
| std::max(vars) More... | |
| IntExpr | makeMax (IntExpr left, IntExpr right) |
| std::max(left, right) More... | |
| IntExpr | makeMax (IntExpr expr, long value) |
| std::max(expr, value) More... | |
| IntExpr | makeMax (IntExpr expr, int value) |
| std::max(expr, value) More... | |
| IntExpr | makeConvexPiecewiseExpr (IntExpr expr, long early_cost, long early_date, long late_date, long late_cost) |
| Convex piecewise function. More... | |
| IntExpr | makeSemiContinuousExpr (IntExpr expr, long fixed_charge, long step) |
| Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0. More... | |
| IntExpr | makeModulo (IntExpr x, long mod) |
| General piecewise-linear function expression, built from f(x) where f is piecewise-linear. More... | |
| IntExpr | makeModulo (IntExpr x, IntExpr mod) |
| Modulo expression x % mod (with the python convention for modulo). More... | |
| IntExpr | makeConditionalExpression (IntVar condition, IntExpr expr, long 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 (String explanation) |
| Constraint | makeIsEqualCstCt (IntExpr var, long value, IntVar boolvar) |
| boolvar == (var == value) More... | |
| IntVar | makeIsEqualCstVar (IntExpr var, long value) |
| status var of (var == value) More... | |
| Constraint | makeIsEqualVar (IntExpr v1, IntExpr v2, IntVar b) |
| b == (v1 == v2) More... | |
| IntVar | makeIsEqualVar (IntExpr v1, IntExpr v2) |
| status var of (v1 == v2) More... | |
| Constraint | makeEquality (IntExpr left, IntExpr right) |
| left == right More... | |
| Constraint | makeEquality (IntExpr expr, long value) |
| expr == value More... | |
| Constraint | makeEquality (IntExpr expr, int value) |
| expr == value More... | |
| Constraint | makeIsDifferentCstCt (IntExpr var, long value, IntVar boolvar) |
| boolvar == (var != value) More... | |
| IntVar | makeIsDifferentCstVar (IntExpr var, long value) |
| status var of (var != value) More... | |
| IntVar | makeIsDifferentCstVar (IntExpr v1, IntExpr v2) |
| status var of (v1 != v2) More... | |
| Constraint | makeIsDifferentCstCt (IntExpr v1, IntExpr v2, IntVar b) |
| b == (v1 != v2) More... | |
| Constraint | makeNonEquality (IntExpr left, IntExpr right) |
| left != right More... | |
| Constraint | makeNonEquality (IntExpr expr, long value) |
| expr != value More... | |
| Constraint | makeNonEquality (IntExpr expr, int value) |
| expr != value More... | |
| Constraint | makeIsLessOrEqualCstCt (IntExpr var, long value, IntVar boolvar) |
| boolvar == (var <= value) More... | |
| IntVar | makeIsLessOrEqualCstVar (IntExpr var, long value) |
| status var of (var <= value) More... | |
| IntVar | makeIsLessOrEqualVar (IntExpr left, IntExpr right) |
| status var of (left <= right) More... | |
| Constraint | makeIsLessOrEqualCt (IntExpr left, IntExpr right, IntVar b) |
| b == (left <= right) More... | |
| Constraint | makeLessOrEqual (IntExpr left, IntExpr right) |
| left <= right More... | |
| Constraint | makeLessOrEqual (IntExpr expr, long value) |
| expr <= value More... | |
| Constraint | makeLessOrEqual (IntExpr expr, int value) |
| expr <= value More... | |
| Constraint | makeIsGreaterOrEqualCstCt (IntExpr var, long value, IntVar boolvar) |
| boolvar == (var >= value) More... | |
| IntVar | makeIsGreaterOrEqualCstVar (IntExpr var, long value) |
| status var of (var >= value) More... | |
| IntVar | makeIsGreaterOrEqualVar (IntExpr left, IntExpr right) |
| status var of (left >= right) More... | |
| Constraint | makeIsGreaterOrEqualCt (IntExpr left, IntExpr right, IntVar b) |
| b == (left >= right) More... | |
| Constraint | makeGreaterOrEqual (IntExpr left, IntExpr right) |
| left >= right More... | |
| Constraint | makeGreaterOrEqual (IntExpr expr, long value) |
| expr >= value More... | |
| Constraint | makeGreaterOrEqual (IntExpr expr, int value) |
| expr >= value More... | |
| Constraint | makeIsGreaterCstCt (IntExpr v, long c, IntVar b) |
| b == (v > c) More... | |
| IntVar | makeIsGreaterCstVar (IntExpr var, long value) |
| status var of (var > value) More... | |
| IntVar | makeIsGreaterVar (IntExpr left, IntExpr right) |
| status var of (left > right) More... | |
| Constraint | makeIsGreaterCt (IntExpr left, IntExpr right, IntVar b) |
| b == (left > right) More... | |
| Constraint | makeGreater (IntExpr left, IntExpr right) |
| left > right More... | |
| Constraint | makeGreater (IntExpr expr, long value) |
| expr > value More... | |
| Constraint | makeGreater (IntExpr expr, int value) |
| expr > value More... | |
| Constraint | makeIsLessCstCt (IntExpr v, long c, IntVar b) |
| b == (v < c) More... | |
| IntVar | makeIsLessCstVar (IntExpr var, long value) |
| status var of (var < value) More... | |
| IntVar | makeIsLessVar (IntExpr left, IntExpr right) |
| status var of (left < right) More... | |
| Constraint | makeIsLessCt (IntExpr left, IntExpr right, IntVar b) |
| b == (left < right) More... | |
| Constraint | makeLess (IntExpr left, IntExpr right) |
| left < right More... | |
| Constraint | makeLess (IntExpr expr, long value) |
| expr < value More... | |
| Constraint | makeLess (IntExpr expr, int value) |
| expr < value More... | |
| Constraint | makeSumLessOrEqual (IntVar[] vars, long cst) |
| Variation on arrays. More... | |
| Constraint | makeSumGreaterOrEqual (IntVar[] vars, long cst) |
| Constraint | makeSumEquality (IntVar[] vars, long cst) |
| Constraint | makeSumEquality (IntVar[] vars, IntVar var) |
| Constraint | makeScalProdEquality (IntVar[] vars, long[] coefficients, long cst) |
| Constraint | makeScalProdEquality (IntVar[] vars, int[] coefficients, long cst) |
| Constraint | makeScalProdEquality (IntVar[] vars, long[] coefficients, IntVar target) |
| Constraint | makeScalProdEquality (IntVar[] vars, int[] coefficients, IntVar target) |
| Constraint | makeScalProdGreaterOrEqual (IntVar[] vars, long[] coeffs, long cst) |
| Constraint | makeScalProdGreaterOrEqual (IntVar[] vars, int[] coeffs, long cst) |
| Constraint | makeScalProdLessOrEqual (IntVar[] vars, long[] coefficients, long cst) |
| Constraint | makeScalProdLessOrEqual (IntVar[] vars, int[] coefficients, long cst) |
| Constraint | makeMinEquality (IntVar[] vars, IntVar min_var) |
| Constraint | makeMaxEquality (IntVar[] vars, IntVar max_var) |
| Constraint | makeElementEquality (long[] vals, IntVar index, IntVar target) |
| Constraint | makeElementEquality (int[] vals, IntVar index, IntVar target) |
| Constraint | makeElementEquality (IntVar[] vars, IntVar index, IntVar target) |
| Constraint | makeElementEquality (IntVar[] vars, IntVar index, long target) |
| Constraint | makeAbsEquality (IntVar var, IntVar abs_var) |
| Creates the constraint abs(var) == abs_var. More... | |
| Constraint | makeIndexOfConstraint (IntVar[] vars, IntVar index, long 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 ct) |
| This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'. More... | |
| Demon | makeDelayedConstraintInitialPropagateCallback (Constraint ct) |
| This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority. More... | |
| Demon | makeClosureDemon (Runnable closure) |
| Creates a demon from a closure. More... | |
| Constraint | makeBetweenCt (IntExpr expr, long l, long u) |
| (l <= expr <= u) More... | |
| Constraint | makeNotBetweenCt (IntExpr expr, long l, long u) |
| (expr < l || expr > u) This constraint is lazy as it will not make holes in the domain of variables. More... | |
| Constraint | makeIsBetweenCt (IntExpr expr, long l, long u, IntVar b) |
| b == (l <= expr <= u) More... | |
| IntVar | makeIsBetweenVar (IntExpr v, long l, long u) |
| Constraint | makeMemberCt (IntExpr expr, long[] values) |
| expr in set. More... | |
| Constraint | makeMemberCt (IntExpr expr, int[] values) |
| Constraint | makeNotMemberCt (IntExpr expr, long[] values) |
| expr not in set. More... | |
| Constraint | makeNotMemberCt (IntExpr expr, int[] values) |
| Constraint | makeNotMemberCt (IntExpr expr, long[] starts, long[] ends) |
| expr should not be in the list of forbidden intervals [start[i]..end[i]]. More... | |
| Constraint | makeNotMemberCt (IntExpr expr, int[] starts, int[] ends) |
| expr should not be in the list of forbidden intervals [start[i]..end[i]]. More... | |
| Constraint | makeIsMemberCt (IntExpr expr, long[] values, IntVar boolvar) |
| boolvar == (expr in set) More... | |
| Constraint | makeIsMemberCt (IntExpr expr, int[] values, IntVar boolvar) |
| IntVar | makeIsMemberVar (IntExpr expr, long[] values) |
| IntVar | makeIsMemberVar (IntExpr expr, int[] values) |
| Constraint | makeCount (IntVar[] vars, long value, long max_count) |
| |{i | vars[i] == value}| == max_count More... | |
| Constraint | makeCount (IntVar[] vars, long value, IntVar max_count) |
| |{i | vars[i] == value}| == max_count More... | |
| Constraint | makeDistribute (IntVar[] vars, long[] values, IntVar[] cards) |
| Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. More... | |
| Constraint | makeDistribute (IntVar[] vars, int[] values, IntVar[] cards) |
| Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. More... | |
| Constraint | makeDistribute (IntVar[] vars, IntVar[] cards) |
| Aggregated version of count: |{i | v[i] == j}| == cards[j]. More... | |
| Constraint | makeDistribute (IntVar[] vars, long card_min, long card_max, long card_size) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint | makeDistribute (IntVar[] vars, long[] card_min, long[] card_max) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint | makeDistribute (IntVar[] vars, int[] card_min, int[] card_max) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint | makeDistribute (IntVar[] vars, long[] values, long[] card_min, long[] card_max) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint | makeDistribute (IntVar[] vars, int[] values, int[] card_min, int[] card_max) |
| Aggregated version of count with bounded cardinalities: forall j in 0 . More... | |
| Constraint | makeDeviation (IntVar[] vars, IntVar deviation_var, long 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 (IntVar[] vars) |
| All variables are pairwise different. More... | |
| Constraint | makeAllDifferent (IntVar[] vars, boolean stronger_propagation) |
| All variables are pairwise different. More... | |
| Constraint | makeAllDifferentExcept (IntVar[] vars, long escape_value) |
| All variables are pairwise different, unless they are assigned to the escape value. More... | |
| Constraint | makeSortingConstraint (IntVar[] vars, 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 (IntVar[] left, IntVar[] right) |
| Creates a constraint that enforces that left is lexicographically less than right. More... | |
| Constraint | makeLexicalLessOrEqual (IntVar[] left, IntVar[] right) |
| Creates a constraint that enforces that left is lexicographically less than or equal to right. More... | |
| Constraint | makeInversePermutationConstraint (IntVar[] left, 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, 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, IntVar[] vars) |
| Creates a constraint that binds the index variable to the index of the first variable with the minimum value. More... | |
| Constraint | makeNullIntersect (IntVar[] first_vars, 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 (IntVar[] first_vars, IntVar[] second_vars, long 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 (IntVar[] nexts, IntVar[] active, LongPredicate sink_handler) |
| Prevent cycles. More... | |
| Constraint | makeNoCycle (IntVar[] nexts, IntVar[] active) |
| Prevent cycles. More... | |
| Constraint | makeNoCycle (IntVar[] nexts, IntVar[] active, LongPredicate sink_handler, boolean assume_paths) |
| Constraint | makeCircuit (IntVar[] nexts) |
| Force the "nexts" variable to create a complete Hamiltonian path. More... | |
| Constraint | makeSubCircuit (IntVar[] nexts) |
| Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves. More... | |
| Constraint | makePathCumul (IntVar[] nexts, IntVar[] active, IntVar[] cumuls, IntVar[] transits) |
| Creates a constraint which accumulates values along a path such that: cumuls[next[i]] = cumuls[i] + transits[i]. More... | |
| Constraint | makeDelayedPathCumul (IntVar[] nexts, IntVar[] active, IntVar[] cumuls, IntVar[] transits) |
| Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated. More... | |
| Constraint | makePathCumul (IntVar[] nexts, IntVar[] active, IntVar[] cumuls, LongBinaryOperator 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 (IntVar[] nexts, IntVar[] active, IntVar[] cumuls, IntVar[] slacks, LongBinaryOperator 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 (IntVar[] nexts, long[] sources, long[] sinks, 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 | makeMapDomain (IntVar var, IntVar[] actives) |
| This constraint maps the domain of 'var' onto the array of variables 'actives'. More... | |
| Constraint | makeAllowedAssignment (IntVar[] vars, IntTupleSet tuples) |
| This method creates a constraint where the graph of the relation between the variables is given in extension. More... | |
| Constraint | makeTransitionConstraint (IntVar[] vars, IntTupleSet transition_table, long initial_state, long[] final_states) |
| This constraint create a finite automaton that will check the sequence of variables vars. More... | |
| Constraint | makeTransitionConstraint (IntVar[] vars, IntTupleSet transition_table, long initial_state, int[] final_states) |
| This constraint create a finite automaton that will check the sequence of variables vars. More... | |
| Constraint | makeNonOverlappingBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, IntVar[] x_size, IntVar[] y_size) |
| This constraint states that all the boxes must not overlap. More... | |
| Constraint | makeNonOverlappingBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, long[] x_size, long[] y_size) |
| Constraint | makeNonOverlappingBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, int[] x_size, int[] y_size) |
| Constraint | makeNonOverlappingNonStrictBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, IntVar[] x_size, IntVar[] y_size) |
| This constraint states that all the boxes must not overlap. More... | |
| Constraint | makeNonOverlappingNonStrictBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, long[] x_size, long[] y_size) |
| Constraint | makeNonOverlappingNonStrictBoxesConstraint (IntVar[] x_vars, IntVar[] y_vars, int[] x_size, int[] y_size) |
| Pack | makePack (IntVar[] vars, int number_of_bins) |
| This constraint packs all variables onto 'number_of_bins' variables. More... | |
| IntervalVar | makeFixedDurationIntervalVar (long start_min, long start_max, long duration, boolean optional, String name) |
| Creates an interval var with a fixed duration. More... | |
| IntervalVar | makeFixedDurationIntervalVar (IntVar start_variable, long duration, String name) |
| Creates a performed interval var with a fixed duration. More... | |
| IntervalVar | makeFixedDurationIntervalVar (IntVar start_variable, long duration, IntVar performed_variable, String name) |
| Creates an interval var with a fixed duration, and performed_variable. More... | |
| IntervalVar | makeFixedInterval (long start, long duration, String name) |
| Creates a fixed and performed interval. More... | |
| IntervalVar | makeIntervalVar (long start_min, long start_max, long duration_min, long duration_max, long end_min, long end_max, boolean optional, String name) |
| Creates an interval var by specifying the bounds on start, duration, and end. More... | |
| IntervalVar | makeMirrorInterval (IntervalVar 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 interval_var, long duration, long 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 interval_var, long duration, long 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 interval_var, long duration, long 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 interval_var, long duration, long 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 interval_var) |
| Creates and returns an interval variable that wraps around the given one, relaxing the min start and end. More... | |
| IntervalVar | makeIntervalRelaxedMax (IntervalVar interval_var) |
| Creates and returns an interval variable that wraps around the given one, relaxing the max start and end. More... | |
| Constraint | makeIntervalVarRelation (IntervalVar t, int r, long d) |
| This method creates a relation between an interval var and a date. More... | |
| Constraint | makeIntervalVarRelation (IntervalVar t1, int r, IntervalVar t2) |
| This method creates a relation between two interval vars. More... | |
| Constraint | makeIntervalVarRelationWithDelay (IntervalVar t1, int r, IntervalVar t2, long delay) |
| This method creates a relation between two interval vars. More... | |
| Constraint | makeTemporalDisjunction (IntervalVar t1, IntervalVar t2, IntVar alt) |
| This constraint implements a temporal disjunction between two interval vars t1 and t2. More... | |
| Constraint | makeTemporalDisjunction (IntervalVar t1, IntervalVar t2) |
| This constraint implements a temporal disjunction between two interval vars. More... | |
| DisjunctiveConstraint | makeDisjunctiveConstraint (IntervalVar[] intervals, String name) |
| This constraint forces all interval vars into an non-overlapping sequence. More... | |
| DisjunctiveConstraint | makeStrictDisjunctiveConstraint (IntervalVar[] intervals, String name) |
| This constraint forces all interval vars into an non-overlapping sequence. More... | |
| Constraint | makeCumulative (IntervalVar[] intervals, long[] demands, long capacity, 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 (IntervalVar[] intervals, int[] demands, long capacity, 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 (IntervalVar[] intervals, long[] demands, IntVar capacity, 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 (IntervalVar[] intervals, int[] demands, IntVar capacity, 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 (IntervalVar[] intervals, IntVar[] demands, long capacity, 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 (IntervalVar[] intervals, IntVar[] demands, IntVar capacity, 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 (IntervalVar[] vars, IntervalVar target_var) |
| This constraint states that the target_var is the convex hull of the intervals. More... | |
| Constraint | makeEquality (IntervalVar var1, IntervalVar var2) |
| This constraints states that the two interval variables are equal. More... | |
| Assignment | makeAssignment () |
| This method creates an empty assignment. More... | |
| Assignment | makeAssignment (Assignment a) |
| This method creates an assignment which is a copy of 'a'. More... | |
| SolutionCollector | makeFirstSolutionCollector (Assignment assignment) |
| Collect the first solution of the search. More... | |
| SolutionCollector | makeFirstSolutionCollector () |
| Collect the first solution of the search. More... | |
| SolutionCollector | makeLastSolutionCollector (Assignment assignment) |
| Collect the last solution of the search. More... | |
| SolutionCollector | makeLastSolutionCollector () |
| Collect the last solution of the search. More... | |
| SolutionCollector | makeBestValueSolutionCollector (Assignment assignment, boolean 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 (boolean 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 (Assignment assignment, int solution_count, boolean maximize) |
| Same as MakeBestValueSolutionCollector but collects the best solution_count solutions. More... | |
| SolutionCollector | makeNBestValueSolutionCollector (int solution_count, boolean maximize) |
| SolutionCollector | makeAllSolutionCollector (Assignment assignment) |
| Collect all solutions of the search. More... | |
| SolutionCollector | makeAllSolutionCollector () |
| Collect all solutions of the search. More... | |
| OptimizeVar | makeMinimize (IntVar v, long step) |
| Creates a minimization objective. More... | |
| OptimizeVar | makeMaximize (IntVar v, long step) |
| Creates a maximization objective. More... | |
| OptimizeVar | makeOptimize (boolean maximize, IntVar v, long step) |
| Creates a objective with a given sense (true = maximization). More... | |
| OptimizeVar | makeWeightedMinimize (IntVar[] sub_objectives, long[] weights, long step) |
| Creates a minimization weighted objective. More... | |
| OptimizeVar | makeWeightedMinimize (IntVar[] sub_objectives, int[] weights, long step) |
| Creates a minimization weighted objective. More... | |
| OptimizeVar | makeWeightedMaximize (IntVar[] sub_objectives, long[] weights, long step) |
| Creates a maximization weigthed objective. More... | |
| OptimizeVar | makeWeightedMaximize (IntVar[] sub_objectives, int[] weights, long step) |
| Creates a maximization weigthed objective. More... | |
| OptimizeVar | makeWeightedOptimize (boolean maximize, IntVar[] sub_objectives, long[] weights, long step) |
| Creates a weighted objective with a given sense (true = maximization). More... | |
| OptimizeVar | makeWeightedOptimize (boolean maximize, IntVar[] sub_objectives, int[] weights, long step) |
| Creates a weighted objective with a given sense (true = maximization). More... | |
| SearchMonitor | makeTabuSearch (boolean maximize, IntVar v, long step, IntVar[] vars, long keep_tenure, long forbid_tenure, double tabu_factor) |
| MetaHeuristics which try to get the search out of local optima. More... | |
| SearchMonitor | makeGenericTabuSearch (boolean maximize, IntVar v, long step, IntVar[] tabu_vars, long forbid_tenure) |
| Creates a Tabu Search based on the vars |vars|. More... | |
| SearchMonitor | makeSimulatedAnnealing (boolean maximize, IntVar v, long step, long initial_temperature) |
| Creates a Simulated Annealing monitor. More... | |
| SearchMonitor | makeGuidedLocalSearch (boolean maximize, IntVar objective, LongBinaryOperator objective_function, long step, IntVar[] vars, double penalty_factor) |
| Creates a Guided Local Search monitor. More... | |
| SearchMonitor | makeGuidedLocalSearch (boolean maximize, IntVar objective, LongTernaryOperator objective_function, long step, IntVar[] vars, 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... | |
| RegularLimit | makeTimeLimit (long time_in_ms) |
| Creates a search limit that constrains the running time given in milliseconds. More... | |
| RegularLimit | makeBranchesLimit (long branches) |
| Creates a search limit that constrains the number of branches explored in the search tree. More... | |
| RegularLimit | makeFailuresLimit (long failures) |
| Creates a search limit that constrains the number of failures that can happen when exploring the search tree. More... | |
| RegularLimit | makeSolutionsLimit (long solutions) |
| Creates a search limit that constrains the number of solutions found during the search. More... | |
| RegularLimit | makeLimit (long time, long branches, long failures, long solutions) |
| Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits. More... | |
| RegularLimit | makeLimit (long time, long branches, long failures, long solutions, boolean smart_time_check) |
| Version reducing calls to wall timer by estimating number of remaining calls. More... | |
| RegularLimit | makeLimit (long time, long branches, long failures, long solutions, boolean smart_time_check, boolean cumulative) |
| Creates a search limit which can either apply cumulatively or search-by-search. More... | |
| RegularLimit | makeLimit (com.google.ortools.constraintsolver.RegularLimitParameters proto) |
| Creates a search limit from its protobuf description. More... | |
| com.google.ortools.constraintsolver.RegularLimitParameters | makeDefaultRegularLimitParameters () |
| Creates a regular limit proto containing default values. More... | |
| SearchLimit | makeLimit (SearchLimit limit_1, SearchLimit limit_2) |
| Creates a search limit that is reached when either of the underlying limit is reached. More... | |
| SearchLimit | makeCustomLimit (BooleanSupplier 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 var) |
| At each solution, this monitor also display the var value. More... | |
| SearchMonitor | makeSearchLog (int branch_period, Supplier< String > display_callback) |
At each solution, this monitor will also display result of display_callback. More... | |
| SearchMonitor | makeSearchLog (int branch_period, IntVar var, Supplier< 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 opt_var) |
| OptimizeVar Search Logs At each solution, this monitor will also display the 'opt_var' value. More... | |
| SearchMonitor | makeSearchLog (int branch_period, OptimizeVar opt_var, Supplier< String > display_callback) |
| Creates a search monitor that will also print the result of the display callback. More... | |
| SearchMonitor | makeSearchTrace (String prefix) |
| Creates a search monitor that will trace precisely the behavior of the search. More... | |
| SearchMonitor | makeEnterSearchCallback (Runnable callback) |
| --— Callback-based search monitors --— More... | |
| SearchMonitor | makeExitSearchCallback (Runnable callback) |
| SearchMonitor | makeAtSolutionCallback (Runnable callback) |
| ModelVisitor | makePrintModelVisitor () |
| Prints the model. More... | |
| ModelVisitor | makeStatisticsModelVisitor () |
| Displays some nice statistics on the model. More... | |
| SearchMonitor | makeSymmetryManager (SymmetryBreaker[] visitors) |
| Symmetry Breaking. More... | |
| SearchMonitor | makeSymmetryManager (SymmetryBreaker v1) |
| SearchMonitor | makeSymmetryManager (SymmetryBreaker v1, SymmetryBreaker v2) |
| SearchMonitor | makeSymmetryManager (SymmetryBreaker v1, SymmetryBreaker v2, SymmetryBreaker v3) |
| SearchMonitor | makeSymmetryManager (SymmetryBreaker v1, SymmetryBreaker v2, SymmetryBreaker v3, SymmetryBreaker v4) |
| Decision | makeAssignVariableValue (IntVar var, long val) |
| Decisions. More... | |
| Decision | makeVariableLessOrEqualValue (IntVar var, long value) |
| Decision | makeVariableGreaterOrEqualValue (IntVar var, long value) |
| Decision | makeSplitVariableDomain (IntVar var, long val, boolean start_with_lower_half) |
| Decision | makeAssignVariableValueOrFail (IntVar var, long value) |
| Decision | MakeAssignVariableValueOrDoNothing (IntVar var, long value) |
| Decision | makeAssignVariablesValues (IntVar[] vars, long[] values) |
| Decision | makeFailDecision () |
| Decision | makeDecision (Consumer< Solver > apply, Consumer< Solver > refute) |
| DecisionBuilder | compose (DecisionBuilder db1, DecisionBuilder db2) |
| Creates a decision builder which sequentially composes decision builders. More... | |
| DecisionBuilder | compose (DecisionBuilder db1, DecisionBuilder db2, DecisionBuilder db3) |
| DecisionBuilder | compose (DecisionBuilder db1, DecisionBuilder db2, DecisionBuilder db3, DecisionBuilder db4) |
| DecisionBuilder | compose (DecisionBuilder[] dbs) |
| DecisionBuilder | tryDecisions (DecisionBuilder db1, DecisionBuilder 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 | tryDecisions (DecisionBuilder db1, DecisionBuilder db2, DecisionBuilder db3) |
| DecisionBuilder | tryDecisions (DecisionBuilder db1, DecisionBuilder db2, DecisionBuilder db3, DecisionBuilder db4) |
| DecisionBuilder | tryDecisions (DecisionBuilder[] dbs) |
| DecisionBuilder | makePhase (IntVar[] vars, int var_str, int val_str) |
| Phases on IntVar arrays. More... | |
| DecisionBuilder | makePhase (IntVar[] vars, LongUnaryOperator var_evaluator, int val_str) |
| DecisionBuilder | makePhase (IntVar[] vars, int var_str, LongBinaryOperator value_evaluator) |
| DecisionBuilder | makePhase (IntVar[] vars, int var_str, LongTernaryPredicate 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 (IntVar[] vars, LongUnaryOperator var_evaluator, LongBinaryOperator value_evaluator) |
| DecisionBuilder | makePhase (IntVar[] vars, int var_str, LongBinaryOperator value_evaluator, LongUnaryOperator tie_breaker) |
| DecisionBuilder | makePhase (IntVar[] vars, LongUnaryOperator var_evaluator, LongBinaryOperator value_evaluator, LongUnaryOperator tie_breaker) |
| DecisionBuilder | makeDefaultPhase (IntVar[] vars) |
| DecisionBuilder | makeDefaultPhase (IntVar[] vars, DefaultPhaseParameters parameters) |
| DecisionBuilder | makePhase (IntVar v0, int var_str, int val_str) |
| Shortcuts for small arrays. More... | |
| DecisionBuilder | makePhase (IntVar v0, IntVar v1, int var_str, int val_str) |
| DecisionBuilder | makePhase (IntVar v0, IntVar v1, IntVar v2, int var_str, int val_str) |
| DecisionBuilder | makePhase (IntVar v0, IntVar v1, IntVar v2, IntVar v3, int var_str, int val_str) |
| Decision | makeScheduleOrPostpone (IntervalVar var, long est, int[] marker) |
| Returns a decision that tries to schedule a task at a given time. More... | |
| Decision | makeScheduleOrExpedite (IntervalVar var, long est, int[] marker) |
| Returns a decision that tries to schedule a task at a given time. More... | |
| Decision | makeRankFirstInterval (SequenceVar sequence, int index) |
| Returns a decision that tries to rank first the ith interval var in the sequence variable. More... | |
| Decision | makeRankLastInterval (SequenceVar sequence, int index) |
| Returns a decision that tries to rank last the ith interval var in the sequence variable. More... | |
| DecisionBuilder | makePhase (IntVar[] vars, LongBinaryOperator eval, int str) |
| Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. More... | |
| DecisionBuilder | makePhase (IntVar[] vars, LongBinaryOperator eval, LongUnaryOperator tie_breaker, int str) |
| Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. More... | |
| DecisionBuilder | makePhase (IntervalVar[] intervals, int str) |
| Scheduling phases. More... | |
| DecisionBuilder | makePhase (SequenceVar[] sequences, int str) |
| DecisionBuilder | makeDecisionBuilderFromAssignment (Assignment assignment, DecisionBuilder db, 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 ct) |
| Returns a decision builder that will add the given constraint to the model. More... | |
| DecisionBuilder | makeSolveOnce (DecisionBuilder 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 db, SearchMonitor monitor1) |
| DecisionBuilder | makeSolveOnce (DecisionBuilder db, SearchMonitor monitor1, SearchMonitor monitor2) |
| DecisionBuilder | makeSolveOnce (DecisionBuilder db, SearchMonitor monitor1, SearchMonitor monitor2, SearchMonitor monitor3) |
| DecisionBuilder | makeSolveOnce (DecisionBuilder db, SearchMonitor monitor1, SearchMonitor monitor2, SearchMonitor monitor3, SearchMonitor monitor4) |
| DecisionBuilder | makeSolveOnce (DecisionBuilder db, SearchMonitor[] monitors) |
| DecisionBuilder | makeNestedOptimize (DecisionBuilder db, Assignment solution, boolean maximize, long 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 db, Assignment solution, boolean maximize, long step, SearchMonitor monitor1) |
| DecisionBuilder | makeNestedOptimize (DecisionBuilder db, Assignment solution, boolean maximize, long step, SearchMonitor monitor1, SearchMonitor monitor2) |
| DecisionBuilder | makeNestedOptimize (DecisionBuilder db, Assignment solution, boolean maximize, long step, SearchMonitor monitor1, SearchMonitor monitor2, SearchMonitor monitor3) |
| DecisionBuilder | makeNestedOptimize (DecisionBuilder db, Assignment solution, boolean maximize, long step, SearchMonitor monitor1, SearchMonitor monitor2, SearchMonitor monitor3, SearchMonitor monitor4) |
| DecisionBuilder | makeNestedOptimize (DecisionBuilder db, Assignment solution, boolean maximize, long step, 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 (IntVar[] vars, int op) |
| Local Search Operators. More... | |
| LocalSearchOperator | makeOperator (IntVar[] vars, IntVar[] secondary_vars, int op) |
| LocalSearchOperator | makeOperator (IntVar[] vars, LongTernaryOperator evaluator, int op) |
| LocalSearchOperator | makeOperator (IntVar[] vars, IntVar[] secondary_vars, LongTernaryOperator evaluator, int op) |
| LocalSearchOperator | makeRandomLnsOperator (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 (IntVar[] vars, int number_of_variables, int seed) |
| LocalSearchOperator | makeMoveTowardTargetOperator (Assignment target) |
| Creates a local search operator that tries to move the assignment of some variables toward a target. More... | |
| LocalSearchOperator | makeMoveTowardTargetOperator (IntVar[] variables, long[] target_values) |
| Creates a local search operator that tries to move the assignment of some variables toward a target. More... | |
| LocalSearchOperator | concatenateOperators (LocalSearchOperator[] ops) |
| Creates a local search operator which concatenates a vector of operators. More... | |
| LocalSearchOperator | concatenateOperators (LocalSearchOperator[] ops, boolean restart) |
| LocalSearchOperator | concatenateOperators (LocalSearchOperator[] ops, IntIntToLongFunction evaluator) |
| LocalSearchOperator | randomConcatenateOperators (LocalSearchOperator[] ops) |
| Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). More... | |
| LocalSearchOperator | randomConcatenateOperators (LocalSearchOperator[] ops, int seed) |
| Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). More... | |
| LocalSearchOperator | makeNeighborhoodLimit (LocalSearchOperator op, long 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 assignment, LocalSearchPhaseParameters parameters) |
| Local Search decision builders factories. More... | |
| DecisionBuilder | makeLocalSearchPhase (IntVar[] vars, DecisionBuilder first_solution, LocalSearchPhaseParameters parameters) |
| DecisionBuilder | makeLocalSearchPhase (IntVar[] vars, DecisionBuilder first_solution, DecisionBuilder first_solution_sub_decision_builder, LocalSearchPhaseParameters parameters) |
| Variant with a sub_decison_builder specific to the first solution. More... | |
| DecisionBuilder | makeLocalSearchPhase (SequenceVar[] vars, DecisionBuilder first_solution, LocalSearchPhaseParameters parameters) |
| SolutionPool | makeDefaultSolutionPool () |
| Solution Pool. More... | |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder) |
| Local Search Phase Parameters. More... | |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder, RegularLimit limit) |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder, RegularLimit limit, LocalSearchFilter[] filters) |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, SolutionPool pool, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder) |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, SolutionPool pool, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder, RegularLimit limit) |
| LocalSearchPhaseParameters | makeLocalSearchPhaseParameters (IntVar objective, SolutionPool pool, LocalSearchOperator ls_operator, DecisionBuilder sub_decision_builder, RegularLimit limit, LocalSearchFilter[] filters) |
| LocalSearchFilter | MakeAcceptFilter () |
| Local Search Filters. More... | |
| LocalSearchFilter | MakeRejectFilter () |
| LocalSearchFilter | makeVariableDomainFilter () |
| IntVarLocalSearchFilter | makeSumObjectiveFilter (IntVar[] vars, LongBinaryOperator values, int filter_enum) |
| IntVarLocalSearchFilter | makeSumObjectiveFilter (IntVar[] vars, IntVar[] secondary_vars, LongTernaryOperator values, int 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 () |
| Gets the search depth of the current active search. More... | |
| int | searchLeftDepth () |
| Gets the search left depth of the current active search. More... | |
| int | solveDepth () |
| Gets the number of nested searches. More... | |
| long | rand64 (long size) |
| Returns a random value between 0 and 'size' - 1;. More... | |
| int | rand32 (int size) |
| Returns a random value between 0 and 'size' - 1;. More... | |
| void | reSeed (int seed) |
| Reseed the solver random generator. More... | |
| void | exportProfilingOverview (String filename) |
| Exports the profiling information in a human readable overview. More... | |
| String | localSearchProfile () |
| Returns local search profiling information in a human readable format. More... | |
| boolean | currentlyInSolve () |
| Returns true whether the current search has been created using a Solve() call instead of a NewSearch one. More... | |
| int | constraints () |
| Counts the number of constraints that have been added to the solver before the search. More... | |
| void | accept (ModelVisitor visitor) |
| Accepts the given model visitor. More... | |
| Decision | balancing_decision () |
| void | clear_fail_intercept () |
| Internal. More... | |
| void | SetUseFastLocalSearch (boolean use_fast_local_search) |
| enabled for metaheuristics. More... | |
| boolean | UseFastLocalSearch () |
| Returns true if fast local search is enabled. More... | |
| boolean | hasName (PropagationBaseObject object) |
| Returns whether the object has been named or not. More... | |
| Demon | registerDemon (Demon demon) |
| Adds a new demon and wraps it inside a DemonProfiler if necessary. More... | |
| IntExpr | registerIntExpr (IntExpr expr) |
| Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary. More... | |
| IntVar | registerIntVar (IntVar var) |
| Registers a new IntVar and wraps it inside a TraceIntVar if necessary. More... | |
| IntervalVar | registerIntervalVar (IntervalVar var) |
| Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary. More... | |
| ModelCache | cache () |
| Returns the cache of the model. More... | |
| boolean | instrumentsDemons () |
| Returns whether we are instrumenting demons. More... | |
| boolean | isProfilingEnabled () |
| Returns whether we are profiling the solver. More... | |
| boolean | isLocalSearchProfilingEnabled () |
| Returns whether we are profiling local search. More... | |
| boolean | instrumentsVariables () |
| Returns whether we are tracing variables. More... | |
| boolean | nameAllVariables () |
| Returns whether all variables should be named. More... | |
| String | model_name () |
| Returns the name of the model. More... | |
| PropagationMonitor | getPropagationMonitor () |
| Returns the propagation monitor. More... | |
| void | addPropagationMonitor (PropagationMonitor monitor) |
| Adds the propagation monitor to the solver. More... | |
| LocalSearchMonitor | getLocalSearchMonitor () |
| Returns the local search monitor. More... | |
| void | addLocalSearchMonitor (LocalSearchMonitor monitor) |
| Adds the local search monitor to the solver. More... | |
| Assignment | GetOrCreateLocalSearchState () |
| Returns (or creates) an assignment representing the state of local search. More... | |
| void | ClearLocalSearchState () |
| Clears the local search state. More... | |
| void | setTmp_vector_ (long[] value) |
| Unsafe temporary vector. More... | |
| long[] | getTmp_vector_ () |
| Unsafe temporary vector. More... | |
| IntExpr | castExpression (IntVar var) |
| Internal. 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 () |
Static Public Member Functions | |
| static com.google.ortools.constraintsolver.ConstraintSolverParameters | defaultSolverParameters () |
| Create a ConstraintSolverParameters proto with all the default values. More... | |
| static long | memoryUsage () |
| Current memory usage in bytes. More... | |
Static Public Attributes | |
| static final int | kNumPriorities = mainJNI.Solver_kNumPriorities_get() |
| Number of priorities for demons. More... | |
| static final int | INT_VAR_DEFAULT = mainJNI.Solver_INT_VAR_DEFAULT_get() |
| This enum describes the strategy used to select the next branching variable at each node during the search. More... | |
| static final int | INT_VAR_SIMPLE = mainJNI.Solver_INT_VAR_SIMPLE_get() |
| The simple selection is CHOOSE_FIRST_UNBOUND. More... | |
| static final int | CHOOSE_FIRST_UNBOUND = mainJNI.Solver_CHOOSE_FIRST_UNBOUND_get() |
| Select the first unbound variable. More... | |
| static final int | CHOOSE_RANDOM = mainJNI.Solver_CHOOSE_RANDOM_get() |
| Randomly select one of the remaining unbound variables. More... | |
| static final int | CHOOSE_MIN_SIZE_LOWEST_MIN = mainJNI.Solver_CHOOSE_MIN_SIZE_LOWEST_MIN_get() |
| Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values. More... | |
| static final int | CHOOSE_MIN_SIZE_HIGHEST_MIN = mainJNI.Solver_CHOOSE_MIN_SIZE_HIGHEST_MIN_get() |
| Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values. More... | |
| static final int | CHOOSE_MIN_SIZE_LOWEST_MAX = mainJNI.Solver_CHOOSE_MIN_SIZE_LOWEST_MAX_get() |
| Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values. More... | |
| static final int | CHOOSE_MIN_SIZE_HIGHEST_MAX = mainJNI.Solver_CHOOSE_MIN_SIZE_HIGHEST_MAX_get() |
| Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values. More... | |
| static final int | CHOOSE_LOWEST_MIN = mainJNI.Solver_CHOOSE_LOWEST_MIN_get() |
| Among unbound variables, select the variable with the smallest minimal value. More... | |
| static final int | CHOOSE_HIGHEST_MAX = mainJNI.Solver_CHOOSE_HIGHEST_MAX_get() |
| Among unbound variables, select the variable with the highest maximal value. More... | |
| static final int | CHOOSE_MIN_SIZE = mainJNI.Solver_CHOOSE_MIN_SIZE_get() |
| Among unbound variables, select the variable with the smallest size. More... | |
| static final int | CHOOSE_MAX_SIZE = mainJNI.Solver_CHOOSE_MAX_SIZE_get() |
| Among unbound variables, select the variable with the highest size. More... | |
| static final int | CHOOSE_MAX_REGRET_ON_MIN = mainJNI.Solver_CHOOSE_MAX_REGRET_ON_MIN_get() |
| Among unbound variables, select the variable with the largest gap between the first and the second values of the domain. More... | |
| static final int | CHOOSE_PATH = mainJNI.Solver_CHOOSE_PATH_get() |
| Selects the next unbound variable on a path, the path being defined by the variables: var[i] corresponds to the index of the next of i. More... | |
| static final int | INT_VALUE_DEFAULT = mainJNI.Solver_INT_VALUE_DEFAULT_get() |
| This enum describes the strategy used to select the next variable value to set. More... | |
| static final int | INT_VALUE_SIMPLE = mainJNI.Solver_INT_VALUE_SIMPLE_get() |
| The simple selection is ASSIGN_MIN_VALUE. More... | |
| static final int | ASSIGN_MIN_VALUE = mainJNI.Solver_ASSIGN_MIN_VALUE_get() |
| Selects the min value of the selected variable. More... | |
| static final int | ASSIGN_MAX_VALUE = mainJNI.Solver_ASSIGN_MAX_VALUE_get() |
| Selects the max value of the selected variable. More... | |
| static final int | ASSIGN_RANDOM_VALUE = mainJNI.Solver_ASSIGN_RANDOM_VALUE_get() |
| Selects randomly one of the possible values of the selected variable. More... | |
| static final int | ASSIGN_CENTER_VALUE = mainJNI.Solver_ASSIGN_CENTER_VALUE_get() |
| Selects the first possible value which is the closest to the center of the domain of the selected variable. More... | |
| static final int | SPLIT_LOWER_HALF = mainJNI.Solver_SPLIT_LOWER_HALF_get() |
| Split the domain in two around the center, and choose the lower part first. More... | |
| static final int | SPLIT_UPPER_HALF = mainJNI.Solver_SPLIT_UPPER_HALF_get() |
| Split the domain in two around the center, and choose the lower part first. More... | |
| static final int | CHOOSE_STATIC_GLOBAL_BEST = mainJNI.Solver_CHOOSE_STATIC_GLOBAL_BEST_get() |
| This enum is used by Solver::MakePhase to specify how to select variables and values during the search. More... | |
| static final int | CHOOSE_DYNAMIC_GLOBAL_BEST = mainJNI.Solver_CHOOSE_DYNAMIC_GLOBAL_BEST_get() |
| Pairs are compared each time a variable is selected. More... | |
| static final int | SEQUENCE_DEFAULT = mainJNI.Solver_SEQUENCE_DEFAULT_get() |
| Used for scheduling. More... | |
| static final int | SEQUENCE_SIMPLE = mainJNI.Solver_SEQUENCE_SIMPLE_get() |
| static final int | CHOOSE_MIN_SLACK_RANK_FORWARD = mainJNI.Solver_CHOOSE_MIN_SLACK_RANK_FORWARD_get() |
| static final int | CHOOSE_RANDOM_RANK_FORWARD = mainJNI.Solver_CHOOSE_RANDOM_RANK_FORWARD_get() |
| static final int | INTERVAL_DEFAULT = mainJNI.Solver_INTERVAL_DEFAULT_get() |
| This enum describes the straregy used to select the next interval variable and its value to be fixed. More... | |
| static final int | INTERVAL_SIMPLE = mainJNI.Solver_INTERVAL_SIMPLE_get() |
| The simple is INTERVAL_SET_TIMES_FORWARD. More... | |
| static final int | INTERVAL_SET_TIMES_FORWARD = mainJNI.Solver_INTERVAL_SET_TIMES_FORWARD_get() |
| Selects the variable with the lowest starting time of all variables, and fixes its starting time to this lowest value. More... | |
| static final int | INTERVAL_SET_TIMES_BACKWARD = mainJNI.Solver_INTERVAL_SET_TIMES_BACKWARD_get() |
| Selects the variable with the highest ending time of all variables, and fixes the ending time to this highest values. More... | |
| static final int | TWOOPT = mainJNI.Solver_TWOOPT_get() |
| This enum is used in Solver::MakeOperator to specify the neighborhood to create. More... | |
| static final int | OROPT = mainJNI.Solver_OROPT_get() |
| Relocate: OROPT and RELOCATE. More... | |
| static final int | RELOCATE = mainJNI.Solver_RELOCATE_get() |
| Relocate neighborhood with length of 1 (see OROPT comment). More... | |
| static final int | EXCHANGE = mainJNI.Solver_EXCHANGE_get() |
| Operator which exchanges the positions of two nodes. More... | |
| static final int | CROSS = mainJNI.Solver_CROSS_get() |
| Operator which cross exchanges the starting chains of 2 paths, including exchanging the whole paths. More... | |
| static final int | MAKEACTIVE = mainJNI.Solver_MAKEACTIVE_get() |
| Operator which inserts an inactive node into a path. More... | |
| static final int | MAKEINACTIVE = mainJNI.Solver_MAKEINACTIVE_get() |
| Operator which makes path nodes inactive. More... | |
| static final int | MAKECHAININACTIVE = mainJNI.Solver_MAKECHAININACTIVE_get() |
| Operator which makes a "chain" of path nodes inactive. More... | |
| static final int | SWAPACTIVE = mainJNI.Solver_SWAPACTIVE_get() |
| Operator which replaces an active node by an inactive one. More... | |
| static final int | EXTENDEDSWAPACTIVE = mainJNI.Solver_EXTENDEDSWAPACTIVE_get() |
| Operator which makes an inactive node active and an active one inactive. More... | |
| static final int | PATHLNS = mainJNI.Solver_PATHLNS_get() |
| Operator which relaxes two sub-chains of three consecutive arcs each. More... | |
| static final int | FULLPATHLNS = mainJNI.Solver_FULLPATHLNS_get() |
| Operator which relaxes one entire path and all inactive nodes, thus defining num_paths neighbors. More... | |
| static final int | UNACTIVELNS = mainJNI.Solver_UNACTIVELNS_get() |
| Operator which relaxes all inactive nodes and one sub-chain of six consecutive arcs. More... | |
| static final int | INCREMENT = mainJNI.Solver_INCREMENT_get() |
| Operator which defines one neighbor per variable. More... | |
| static final int | DECREMENT = mainJNI.Solver_DECREMENT_get() |
| Operator which defines a neighborhood to decrement values. More... | |
| static final int | SIMPLELNS = mainJNI.Solver_SIMPLELNS_get() |
| Operator which defines one neighbor per variable. More... | |
| static final int | LK = mainJNI.Solver_LK_get() |
| This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create. More... | |
| static final int | TSPOPT = mainJNI.Solver_TSPOPT_get() |
| Sliding TSP operator. More... | |
| static final int | TSPLNS = mainJNI.Solver_TSPLNS_get() |
| TSP-base LNS. More... | |
| static final int | GE = mainJNI.Solver_GE_get() |
| This enum is used in Solver::MakeLocalSearchObjectiveFilter. More... | |
| static final int | LE = mainJNI.Solver_LE_get() |
| Move is accepted when the current objective value <= objective.Max. More... | |
| static final int | EQ = mainJNI.Solver_EQ_get() |
| Move is accepted when the current objective value is in the interval objective.Min . More... | |
| static final int | DELAYED_PRIORITY = mainJNI.Solver_DELAYED_PRIORITY_get() |
| This enum represents the three possible priorities for a demon in the Solver queue. More... | |
| static final int | VAR_PRIORITY = mainJNI.Solver_VAR_PRIORITY_get() |
| VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY. More... | |
| static final int | NORMAL_PRIORITY = mainJNI.Solver_NORMAL_PRIORITY_get() |
| NORMAL_PRIORITY is the highest priority: Demons will be processed first. More... | |
| static final int | ENDS_AFTER_END = mainJNI.Solver_ENDS_AFTER_END_get() |
| This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2. More... | |
| static final int | ENDS_AFTER_START = mainJNI.Solver_ENDS_AFTER_START_get() |
| t1 ends after t2 start, i.e. More... | |
| static final int | ENDS_AT_END = mainJNI.Solver_ENDS_AT_END_get() |
| t1 ends at t2 end, i.e. More... | |
| static final int | ENDS_AT_START = mainJNI.Solver_ENDS_AT_START_get() |
| t1 ends at t2 start, i.e. More... | |
| static final int | STARTS_AFTER_END = mainJNI.Solver_STARTS_AFTER_END_get() |
| t1 starts after t2 end, i.e. More... | |
| static final int | STARTS_AFTER_START = mainJNI.Solver_STARTS_AFTER_START_get() |
| t1 starts after t2 start, i.e. More... | |
| static final int | STARTS_AT_END = mainJNI.Solver_STARTS_AT_END_get() |
| t1 starts at t2 end, i.e. More... | |
| static final int | STARTS_AT_START = mainJNI.Solver_STARTS_AT_START_get() |
| t1 starts at t2 start, i.e. More... | |
| static final int | STAYS_IN_SYNC = mainJNI.Solver_STAYS_IN_SYNC_get() |
| STARTS_AT_START and ENDS_AT_END at the same time. More... | |
| static final int | ENDS_AFTER = mainJNI.Solver_ENDS_AFTER_get() |
| This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d. More... | |
| static final int | ENDS_AT = mainJNI.Solver_ENDS_AT_get() |
| t ends at d, i.e. More... | |
| static final int | ENDS_BEFORE = mainJNI.Solver_ENDS_BEFORE_get() |
| t ends before d, i.e. More... | |
| static final int | STARTS_AFTER = mainJNI.Solver_STARTS_AFTER_get() |
| t starts after d, i.e. More... | |
| static final int | STARTS_AT = mainJNI.Solver_STARTS_AT_get() |
| t starts at d, i.e. More... | |
| static final int | STARTS_BEFORE = mainJNI.Solver_STARTS_BEFORE_get() |
| t starts before d, i.e. More... | |
| static final int | CROSS_DATE = mainJNI.Solver_CROSS_DATE_get() |
| STARTS_BEFORE and ENDS_AFTER at the same time, i.e. More... | |
| static final int | AVOID_DATE = mainJNI.Solver_AVOID_DATE_get() |
| STARTS_AFTER or ENDS_BEFORE, i.e. More... | |
| static final int | NO_CHANGE = mainJNI.Solver_NO_CHANGE_get() |
| The Solver is responsible for creating the search tree. More... | |
| static final int | KEEP_LEFT = mainJNI.Solver_KEEP_LEFT_get() |
| Right branches are ignored. More... | |
| static final int | KEEP_RIGHT = mainJNI.Solver_KEEP_RIGHT_get() |
| Left branches are ignored. More... | |
| static final int | KILL_BOTH = mainJNI.Solver_KILL_BOTH_get() |
| Backtracks to the previous decisions, i.e. More... | |
| static final int | SWITCH_BRANCHES = mainJNI.Solver_SWITCH_BRANCHES_get() |
| Applies right branch first. More... | |
| static final int | SENTINEL = mainJNI.Solver_SENTINEL_get() |
| This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree. More... | |
| static final int | SIMPLE_MARKER = mainJNI.Solver_SIMPLE_MARKER_get() |
| static final int | CHOICE_POINT = mainJNI.Solver_CHOICE_POINT_get() |
| static final int | REVERSIBLE_ACTION = mainJNI.Solver_REVERSIBLE_ACTION_get() |
| static final int | OUTSIDE_SEARCH = mainJNI.Solver_OUTSIDE_SEARCH_get() |
| This enum represents the state of the solver w.r.t. More... | |
| static final int | IN_ROOT_NODE = mainJNI.Solver_IN_ROOT_NODE_get() |
| Executing the root node. More... | |
| static final int | IN_SEARCH = mainJNI.Solver_IN_SEARCH_get() |
| Executing the search code. More... | |
| static final int | AT_SOLUTION = mainJNI.Solver_AT_SOLUTION_get() |
| After successful NextSolution and before EndSearch. More... | |
| static final int | NO_MORE_SOLUTIONS = mainJNI.Solver_NO_MORE_SOLUTIONS_get() |
| After failed NextSolution and before EndSearch. More... | |
| static final int | PROBLEM_INFEASIBLE = mainJNI.Solver_PROBLEM_INFEASIBLE_get() |
| After search, the model is infeasible. More... | |
| static final int | NOT_SET = mainJNI.Solver_NOT_SET_get() |
| Optimization directions. More... | |
| static final int | MAXIMIZATION = mainJNI.Solver_MAXIMIZATION_get() |
| static final int | MINIMIZATION = mainJNI.Solver_MINIMIZATION_get() |
Protected Member Functions | |
| Solver (long cPtr, boolean cMemoryOwn) | |
Constructor & Destructor Documentation
◆ Solver() [1/3]
|
inlineprotected |
Definition at line 61 of file Solver.java.
◆ Solver() [2/3]
|
inline |
Solver API.
Definition at line 236 of file Solver.java.
◆ Solver() [3/3]
|
inline |
Definition at line 240 of file Solver.java.
Member Function Documentation
◆ accept()
|
inline |
Accepts the given model visitor.
Definition at line 3052 of file Solver.java.
◆ acceptedNeighbors()
|
inline |
The number of accepted neighbors.
Definition at line 480 of file Solver.java.
◆ addCastConstraint()
|
inline |
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 286 of file Solver.java.
◆ addConstraint()
|
inline |
Adds the constraint 'c' to the model.
After calling this method, and until there is a backtrack that undoes the addition, any assignment of variables to values must satisfy the given constraint in order to be considered feasible. There are two fairly different use cases: - the most common use case is modeling: the given constraint is really part of the problem that the user is trying to solve. In this use case, AddConstraint is called outside of search (i.e., with
). Most users should only use AddConstraint in this way. In this case, the constraint will belong to the model forever: it cannot not be removed by backtracking. - a rarer use case is that 'c' is not a real constraint of the model. It may be a constraint generated by a branching decision (a constraint whose goal is to restrict the search space), a symmetry breaking constraint (a constraint that does restrict the search space, but in a way that cannot have an impact on the quality of the solutions in the subtree), or an inferred constraint that, while having no semantic value to the model (it does not restrict the set of solutions), is worth having because we believe it may strengthen the propagation. In these cases, it happens that the constraint is added during the search (i.e., with state() == IN_SEARCH or state() == IN_ROOT_NODE). When a constraint is added during a search, it applies only to the subtree of the search tree rooted at the current node, and will be automatically removed by backtracking. This method does not take ownership of the constraint. If the constraint has been created by any factory method (Solver::MakeXXX), it will automatically be deleted. However, power users who implement their own constraints should do: solver.AddConstraint(solver.RevAlloc(new MyConstraint(...));
Definition at line 279 of file Solver.java.
◆ addLocalSearchMonitor()
|
inline |
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 3197 of file Solver.java.
◆ addPropagationMonitor()
|
inline |
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 3182 of file Solver.java.
◆ balancing_decision()
|
inline |
Definition at line 3056 of file Solver.java.
◆ branches()
|
inline |
The number of branches explored since the creation of the solver.
Definition at line 431 of file Solver.java.
◆ cache()
|
inline |
Returns the cache of the model.
Definition at line 3124 of file Solver.java.
◆ castExpression()
Internal.
If the variables is the result of expr->Var(), this method returns expr, nullptr otherwise.
Definition at line 3233 of file Solver.java.
◆ checkAssignment()
|
inline |
Checks whether the given assignment satisfies all relevant constraints.
Definition at line 382 of file Solver.java.
◆ checkConstraint()
|
inline |
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 389 of file Solver.java.
◆ checkFail()
|
inline |
Definition at line 3256 of file Solver.java.
◆ clear_fail_intercept()
|
inline |
Internal.
Definition at line 3064 of file Solver.java.
◆ ClearLocalSearchState()
|
inline |
Clears the local search state.
Definition at line 3212 of file Solver.java.
◆ compose() [1/4]
|
inline |
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 |
Definition at line 2489 of file Solver.java.
◆ compose() [2/4]
|
inline |
Definition at line 2494 of file Solver.java.
◆ compose() [3/4]
|
inline |
Definition at line 2499 of file Solver.java.
◆ compose() [4/4]
|
inline |
Definition at line 2504 of file Solver.java.
◆ concatenateOperators() [1/3]
|
inline |
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 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 2820 of file Solver.java.
◆ concatenateOperators() [2/3]
|
inline |
Definition at line 2825 of file Solver.java.
◆ concatenateOperators() [3/3]
|
inline |
Definition at line 2830 of file Solver.java.
◆ constraints()
|
inline |
Counts the number of constraints that have been added to the solver before the search.
Definition at line 3045 of file Solver.java.
◆ currentlyInSolve()
|
inline |
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 3038 of file Solver.java.
◆ defaultSolverParameters()
|
inlinestatic |
Create a ConstraintSolverParameters proto with all the default values.
Definition at line 263 of file Solver.java.
◆ delete()
|
inline |
Definition at line 75 of file Solver.java.
◆ demon_runs()
|
inline |
The number of demons executed during search for a given priority.
Definition at line 452 of file Solver.java.
◆ endSearch()
|
inline |
Definition at line 352 of file Solver.java.
◆ exportProfilingOverview()
|
inline |
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 3024 of file Solver.java.
◆ fail()
|
inline |
Abandon the current branch in the search tree.
A backtrack will follow.
Definition at line 403 of file Solver.java.
◆ fail_stamp()
|
inline |
The fail_stamp() is incremented after each backtrack.
Definition at line 494 of file Solver.java.
◆ failures()
|
inline |
The number of failures encountered since the creation of the solver.
Definition at line 459 of file Solver.java.
◆ filteredNeighbors()
|
inline |
The number of filtered neighbors (neighbors accepted by filters).
Definition at line 473 of file Solver.java.
◆ finishCurrentSearch()
|
inline |
Tells the solver to kill or restart the current search.
Definition at line 3241 of file Solver.java.
◆ getLocalSearchMonitor()
|
inline |
Returns the local search monitor.
Definition at line 3189 of file Solver.java.
◆ GetOrCreateLocalSearchState()
|
inline |
Returns (or creates) an assignment representing the state of local search.
Definition at line 3204 of file Solver.java.
◆ getPropagationMonitor()
|
inline |
Returns the propagation monitor.
Definition at line 3174 of file Solver.java.
◆ getTmp_vector_()
|
inline |
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 3226 of file Solver.java.
◆ hasName()
|
inline |
Returns whether the object has been named or not.
Definition at line 3085 of file Solver.java.
◆ instrumentsDemons()
|
inline |
Returns whether we are instrumenting demons.
Definition at line 3132 of file Solver.java.
◆ instrumentsVariables()
|
inline |
Returns whether we are tracing variables.
Definition at line 3153 of file Solver.java.
◆ isLocalSearchProfilingEnabled()
|
inline |
Returns whether we are profiling local search.
Definition at line 3146 of file Solver.java.
◆ isProfilingEnabled()
|
inline |
Returns whether we are profiling the solver.
Definition at line 3139 of file Solver.java.
◆ localSearchProfile()
|
inline |
Returns local search profiling information in a human readable format.
search profiles.
Definition at line 3031 of file Solver.java.
◆ makeAbs()
|expr|
Definition at line 688 of file Solver.java.
◆ makeAbsEquality()
|
inline |
Creates the constraint abs(var) == abs_var.
Definition at line 1330 of file Solver.java.
◆ MakeAcceptFilter()
|
inline |
Local Search Filters.
Definition at line 2929 of file Solver.java.
◆ makeAllDifferent() [1/2]
|
inline |
All variables are pairwise different.
This corresponds to the stronger version of the propagation algorithm.
Definition at line 1552 of file Solver.java.
◆ makeAllDifferent() [2/2]
|
inline |
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 1560 of file Solver.java.
◆ makeAllDifferentExcept()
|
inline |
All variables are pairwise different, unless they are assigned to the escape value.
Definition at line 1568 of file Solver.java.
◆ makeAllowedAssignment()
|
inline |
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 1725 of file Solver.java.
◆ makeAllSolutionCollector() [1/2]
|
inline |
Collect all solutions of the search.
The variables will need to be added later.
Definition at line 2094 of file Solver.java.
◆ makeAllSolutionCollector() [2/2]
|
inline |
Collect all solutions of the search.
Definition at line 2086 of file Solver.java.
◆ makeAssignment() [1/2]
|
inline |
This method creates an empty assignment.
Definition at line 2009 of file Solver.java.
◆ makeAssignment() [2/2]
|
inline |
This method creates an assignment which is a copy of 'a'.
Definition at line 2017 of file Solver.java.
◆ makeAssignVariablesValues()
Definition at line 2471 of file Solver.java.
◆ makeAssignVariableValue()
Decisions.
Definition at line 2441 of file Solver.java.
◆ MakeAssignVariableValueOrDoNothing()
Definition at line 2466 of file Solver.java.
◆ makeAssignVariableValueOrFail()
Definition at line 2461 of file Solver.java.
◆ makeAtSolutionCallback()
|
inline |
Definition at line 2389 of file Solver.java.
◆ makeBestValueSolutionCollector() [1/2]
|
inline |
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).
Definition at line 2057 of file Solver.java.
◆ makeBestValueSolutionCollector() [2/2]
|
inline |
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.
Definition at line 2065 of file Solver.java.
◆ makeBetweenCt()
|
inline |
(l <= expr <= u)
Definition at line 1370 of file Solver.java.
◆ makeBoolVar() [1/2]
|
inline |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 568 of file Solver.java.
◆ makeBoolVar() [2/2]
|
inline |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 560 of file Solver.java.
◆ makeBoolVarArray() [1/2]
|
inline |
Definition at line 115 of file Solver.java.
◆ makeBoolVarArray() [2/2]
|
inline |
Definition at line 123 of file Solver.java.
◆ makeBranchesLimit()
|
inline |
Creates a search limit that constrains the number of branches explored in the search tree.
Definition at line 2235 of file Solver.java.
◆ makeCircuit()
|
inline |
Force the "nexts" variable to create a complete Hamiltonian path.
Definition at line 1661 of file Solver.java.
◆ makeClosureDemon()
|
inline |
Creates a demon from a closure.
Definition at line 1362 of file Solver.java.
◆ makeConditionalExpression()
Conditional Expr condition ? expr : unperformed_value.
Definition at line 872 of file Solver.java.
◆ makeConstantRestart()
|
inline |
This search monitor will restart the search periodically after 'frequency' failures.
Definition at line 2219 of file Solver.java.
◆ makeConstraintAdder()
|
inline |
Returns a decision builder that will add the given constraint to the model.
Definition at line 2678 of file Solver.java.
◆ makeConstraintInitialPropagateCallback()
|
inline |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 1346 of file Solver.java.
◆ makeConvexPiecewiseExpr()
|
inline |
Convex piecewise function.
Definition at line 840 of file Solver.java.
◆ makeCount() [1/2]
|
inline |
|{i | vars[i] == value}| == max_count
Definition at line 1472 of file Solver.java.
◆ makeCount() [2/2]
|
inline |
|{i | vars[i] == value}| == max_count
Definition at line 1464 of file Solver.java.
◆ makeCover()
|
inline |
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 1993 of file Solver.java.
◆ makeCumulative() [1/6]
|
inline |
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 1969 of file Solver.java.
◆ makeCumulative() [2/6]
|
inline |
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 1953 of file Solver.java.
◆ makeCumulative() [3/6]
|
inline |
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 1985 of file Solver.java.
◆ makeCumulative() [4/6]
|
inline |
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 1977 of file Solver.java.
◆ makeCumulative() [5/6]
|
inline |
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 1961 of file Solver.java.
◆ makeCumulative() [6/6]
|
inline |
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 1945 of file Solver.java.
◆ makeCustomLimit()
|
inline |
Callback-based search limit.
Search stops when limiter returns true; if this happens at a leaf the corresponding solution will be rejected.
Definition at line 2315 of file Solver.java.
◆ makeDecision()
Definition at line 2481 of file Solver.java.
◆ makeDecisionBuilderFromAssignment()
|
inline |
Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'.
Definition at line 2670 of file Solver.java.
◆ makeDefaultPhase() [1/2]
|
inline |
Definition at line 2573 of file Solver.java.
◆ makeDefaultPhase() [2/2]
|
inline |
Definition at line 2578 of file Solver.java.
◆ makeDefaultRegularLimitParameters()
|
inline |
Creates a regular limit proto containing default values.
Definition at line 2291 of file Solver.java.
◆ makeDefaultSolutionPool()
|
inline |
Solution Pool.
Definition at line 2888 of file Solver.java.
◆ makeDelayedConstraintInitialPropagateCallback()
|
inline |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority.
Definition at line 1354 of file Solver.java.
◆ makeDelayedPathCumul()
|
inline |
Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated.
Definition at line 1685 of file Solver.java.
◆ makeDeviation()
|
inline |
Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = #vars.
Definition at line 1544 of file Solver.java.
◆ makeDifference() [1/2]
left - right
Definition at line 632 of file Solver.java.
◆ makeDifference() [2/2]
value - expr
Definition at line 640 of file Solver.java.
◆ makeDisjunctiveConstraint()
|
inline |
This constraint forces all interval vars into an non-overlapping sequence.
Intervals with zero duration can be scheduled anywhere.
Definition at line 1929 of file Solver.java.
◆ makeDistribute() [1/8]
|
inline |
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 1520 of file Solver.java.
◆ makeDistribute() [2/8]
|
inline |
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 1536 of file Solver.java.
◆ makeDistribute() [3/8]
|
inline |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
Definition at line 1488 of file Solver.java.
◆ makeDistribute() [4/8]
|
inline |
Aggregated version of count: |{i | v[i] == j}| == cards[j].
Definition at line 1496 of file Solver.java.
◆ makeDistribute() [5/8]
|
inline |
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 1504 of file Solver.java.
◆ makeDistribute() [6/8]
|
inline |
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 1512 of file Solver.java.
◆ makeDistribute() [7/8]
|
inline |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
Definition at line 1480 of file Solver.java.
◆ makeDistribute() [8/8]
|
inline |
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 1528 of file Solver.java.
◆ makeDiv() [1/2]
expr / value (integer division)
Definition at line 672 of file Solver.java.
◆ makeDiv() [2/2]
numerator / denominator (integer division).
Terms need to be positive.
Definition at line 680 of file Solver.java.
◆ makeElement() [1/5]
values[index]
Definition at line 720 of file Solver.java.
◆ makeElement() [2/5]
vars[expr]
Definition at line 752 of file Solver.java.
◆ makeElement() [3/5]
values[index]
Definition at line 712 of file Solver.java.
◆ makeElement() [4/5]
2D version of function-based element expression, values(expr1, expr2).
Definition at line 744 of file Solver.java.
◆ makeElement() [5/5]
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 728 of file Solver.java.
◆ makeElementEquality() [1/4]
|
inline |
Definition at line 1312 of file Solver.java.
◆ makeElementEquality() [2/4]
|
inline |
Definition at line 1317 of file Solver.java.
◆ makeElementEquality() [3/4]
|
inline |
Definition at line 1322 of file Solver.java.
◆ makeElementEquality() [4/4]
|
inline |
Definition at line 1307 of file Solver.java.
◆ makeEnterSearchCallback()
|
inline |
--— Callback-based search monitors --—
Definition at line 2379 of file Solver.java.
◆ makeEquality() [1/4]
|
inline |
This constraints states that the two interval variables are equal.
Definition at line 2001 of file Solver.java.
◆ makeEquality() [2/4]
|
inline |
expr == value
Definition at line 949 of file Solver.java.
◆ makeEquality() [3/4]
|
inline |
expr == value
Definition at line 941 of file Solver.java.
◆ makeEquality() [4/4]
|
inline |
left == right
Definition at line 933 of file Solver.java.
◆ makeExitSearchCallback()
|
inline |
Definition at line 2384 of file Solver.java.
◆ makeFailDecision()
|
inline |
Definition at line 2476 of file Solver.java.
◆ makeFailuresLimit()
|
inline |
Creates a search limit that constrains the number of failures that can happen when exploring the search tree.
Definition at line 2243 of file Solver.java.
◆ makeFalseConstraint() [1/2]
|
inline |
This constraint always fails.
Definition at line 888 of file Solver.java.
◆ makeFalseConstraint() [2/2]
|
inline |
Definition at line 893 of file Solver.java.
◆ makeFirstSolutionCollector() [1/2]
|
inline |
Collect the first solution of the search.
The variables will need to be added later.
Definition at line 2033 of file Solver.java.
◆ makeFirstSolutionCollector() [2/2]
|
inline |
Collect the first solution of the search.
Definition at line 2025 of file Solver.java.
◆ makeFixedDurationEndSyncedOnEndIntervalVar()
|
inline |
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 1865 of file Solver.java.
◆ makeFixedDurationEndSyncedOnStartIntervalVar()
|
inline |
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 1857 of file Solver.java.
◆ makeFixedDurationIntervalVar() [1/3]
|
inline |
Creates an interval var with a fixed duration, and performed_variable.
The duration must be greater than 0.
Definition at line 1809 of file Solver.java.
◆ makeFixedDurationIntervalVar() [2/3]
|
inline |
Creates a performed interval var with a fixed duration.
The duration must be greater than 0.
Definition at line 1801 of file Solver.java.
◆ makeFixedDurationIntervalVar() [3/3]
|
inline |
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 1793 of file Solver.java.
◆ makeFixedDurationIntervalVarArray() [1/2]
|
inline |
Definition at line 132 of file Solver.java.
◆ makeFixedDurationIntervalVarArray() [2/2]
|
inline |
Definition at line 148 of file Solver.java.
◆ makeFixedDurationStartSyncedOnEndIntervalVar()
|
inline |
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 1849 of file Solver.java.
◆ makeFixedDurationStartSyncedOnStartIntervalVar()
|
inline |
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 1841 of file Solver.java.
◆ makeFixedInterval()
|
inline |
Creates a fixed and performed interval.
Definition at line 1817 of file Solver.java.
◆ makeGenericTabuSearch()
|
inline |
Creates a Tabu Search based on the vars |vars|.
A solution is "tabu" if all the vars in |vars| keep their value.
Definition at line 2182 of file Solver.java.
◆ makeGreater() [1/3]
|
inline |
expr > value
Definition at line 1173 of file Solver.java.
◆ makeGreater() [2/3]
|
inline |
expr > value
Definition at line 1165 of file Solver.java.
◆ makeGreater() [3/3]
|
inline |
left > right
Definition at line 1157 of file Solver.java.
◆ makeGreaterOrEqual() [1/3]
|
inline |
expr >= value
Definition at line 1117 of file Solver.java.
◆ makeGreaterOrEqual() [2/3]
|
inline |
expr >= value
Definition at line 1109 of file Solver.java.
◆ makeGreaterOrEqual() [3/3]
|
inline |
left >= right
Definition at line 1101 of file Solver.java.
◆ makeGuidedLocalSearch() [1/2]
|
inline |
Creates a Guided Local Search monitor.
Description here: http://en.wikipedia.org/wiki/Guided_Local_Search
Definition at line 2198 of file Solver.java.
◆ makeGuidedLocalSearch() [2/2]
|
inline |
Definition at line 2203 of file Solver.java.
◆ makeIfThenElseCt()
|
inline |
Special cases with arrays of size two.
Definition at line 768 of file Solver.java.
◆ makeIndexExpression()
Returns the expression expr such that vars[expr] == value.
It assumes that vars are all different.
Definition at line 760 of file Solver.java.
◆ makeIndexOfConstraint()
|
inline |
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 1338 of file Solver.java.
◆ makeIndexOfFirstMaxValueConstraint()
|
inline |
Creates a constraint that binds the index variable to the index of the first variable with the maximum value.
Definition at line 1608 of file Solver.java.
◆ makeIndexOfFirstMinValueConstraint()
|
inline |
Creates a constraint that binds the index variable to the index of the first variable with the minimum value.
Definition at line 1616 of file Solver.java.
◆ makeIntConst() [1/2]
|
inline |
IntConst will create a constant expression.
Definition at line 584 of file Solver.java.
◆ makeIntConst() [2/2]
|
inline |
IntConst will create a constant expression.
Definition at line 576 of file Solver.java.
◆ makeIntervalRelaxedMax()
|
inline |
Creates and returns an interval variable that wraps around the given one, relaxing the max start and end.
Relaxing means making unbounded when optional. If the variable is non optional, this method returns interval_var. More precisely, such an interval variable behaves as follows: * When the underlying must be performed, the returned interval variable behaves exactly as the underlying; * When the underlying may or may not be performed, the returned interval variable behaves like the underlying, except that it is unbounded on the max side; * When the underlying cannot be performed, the returned interval variable is of duration 0 and must be performed in an interval unbounded on both sides. This is very useful for implementing propagators that may only modify the start min or end min.
Definition at line 1881 of file Solver.java.
◆ makeIntervalRelaxedMin()
|
inline |
Creates and returns an interval variable that wraps around the given one, relaxing the min start and end.
Relaxing means making unbounded when optional. If the variable is non-optional, this method returns interval_var. More precisely, such an interval variable behaves as follows: * When the underlying must be performed, the returned interval variable behaves exactly as the underlying; * When the underlying may or may not be performed, the returned interval variable behaves like the underlying, except that it is unbounded on the min side; * When the underlying cannot be performed, the returned interval variable is of duration 0 and must be performed in an interval unbounded on both sides. This is very useful to implement propagators that may only modify the start max or end max.
Definition at line 1873 of file Solver.java.
◆ makeIntervalVar()
|
inline |
Creates an interval var by specifying the bounds on start, duration, and end.
Definition at line 1825 of file Solver.java.
◆ makeIntervalVarRelation() [1/2]
|
inline |
This method creates a relation between an interval var and a date.
Definition at line 1889 of file Solver.java.
◆ makeIntervalVarRelation() [2/2]
|
inline |
This method creates a relation between two interval vars.
Definition at line 1897 of file Solver.java.
◆ makeIntervalVarRelationWithDelay()
|
inline |
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 1905 of file Solver.java.
◆ makeIntVar() [1/6]
|
inline |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 552 of file Solver.java.
◆ makeIntVar() [2/6]
|
inline |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 528 of file Solver.java.
◆ makeIntVar() [3/6]
|
inline |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 536 of file Solver.java.
◆ makeIntVar() [4/6]
|
inline |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 512 of file Solver.java.
◆ makeIntVar() [5/6]
|
inline |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 544 of file Solver.java.
◆ makeIntVar() [6/6]
|
inline |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 520 of file Solver.java.
◆ makeIntVarArray() [1/2]
|
inline |
Definition at line 98 of file Solver.java.
◆ makeIntVarArray() [2/2]
|
inline |
Definition at line 106 of file Solver.java.
◆ makeInversePermutationConstraint()
|
inline |
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 1600 of file Solver.java.
◆ makeIsBetweenCt()
|
inline |
b == (l <= expr <= u)
Definition at line 1386 of file Solver.java.
◆ makeIsBetweenVar()
Definition at line 1391 of file Solver.java.
◆ makeIsDifferentCstCt() [1/2]
|
inline |
b == (v1 != v2)
Definition at line 981 of file Solver.java.
◆ makeIsDifferentCstCt() [2/2]
|
inline |
boolvar == (var != value)
Definition at line 957 of file Solver.java.
◆ makeIsDifferentCstVar() [1/2]
status var of (v1 != v2)
Definition at line 973 of file Solver.java.
◆ makeIsDifferentCstVar() [2/2]
status var of (var != value)
Definition at line 965 of file Solver.java.
◆ makeIsEqualCstCt()
|
inline |
boolvar == (var == value)
Definition at line 901 of file Solver.java.
◆ makeIsEqualCstVar()
status var of (var == value)
Definition at line 909 of file Solver.java.
◆ makeIsEqualVar() [1/2]
status var of (v1 == v2)
Definition at line 925 of file Solver.java.
◆ makeIsEqualVar() [2/2]
|
inline |
b == (v1 == v2)
Definition at line 917 of file Solver.java.
◆ makeIsGreaterCstCt()
|
inline |
b == (v > c)
Definition at line 1125 of file Solver.java.
◆ makeIsGreaterCstVar()
status var of (var > value)
Definition at line 1133 of file Solver.java.
◆ makeIsGreaterCt()
|
inline |
b == (left > right)
Definition at line 1149 of file Solver.java.
◆ makeIsGreaterOrEqualCstCt()
|
inline |
boolvar == (var >= value)
Definition at line 1069 of file Solver.java.
◆ makeIsGreaterOrEqualCstVar()
status var of (var >= value)
Definition at line 1077 of file Solver.java.
◆ makeIsGreaterOrEqualCt()
|
inline |
b == (left >= right)
Definition at line 1093 of file Solver.java.
◆ makeIsGreaterOrEqualVar()
status var of (left >= right)
Definition at line 1085 of file Solver.java.
◆ makeIsGreaterVar()
status var of (left > right)
Definition at line 1141 of file Solver.java.
◆ makeIsLessCstCt()
|
inline |
b == (v < c)
Definition at line 1181 of file Solver.java.
◆ makeIsLessCstVar()
status var of (var < value)
Definition at line 1189 of file Solver.java.
◆ makeIsLessCt()
|
inline |
b == (left < right)
Definition at line 1205 of file Solver.java.
◆ makeIsLessOrEqualCstCt()
|
inline |
boolvar == (var <= value)
Definition at line 1013 of file Solver.java.
◆ makeIsLessOrEqualCstVar()
status var of (var <= value)
Definition at line 1021 of file Solver.java.
◆ makeIsLessOrEqualCt()
|
inline |
b == (left <= right)
Definition at line 1037 of file Solver.java.
◆ makeIsLessOrEqualVar()
status var of (left <= right)
Definition at line 1029 of file Solver.java.
◆ makeIsLessVar()
status var of (left < right)
Definition at line 1197 of file Solver.java.
◆ makeIsMemberCt() [1/2]
|
inline |
Definition at line 1446 of file Solver.java.
◆ makeIsMemberCt() [2/2]
|
inline |
boolvar == (expr in set)
Definition at line 1441 of file Solver.java.
◆ makeIsMemberVar() [1/2]
Definition at line 1456 of file Solver.java.
◆ makeIsMemberVar() [2/2]
Definition at line 1451 of file Solver.java.
◆ makeLastSolutionCollector() [1/2]
|
inline |
Collect the last solution of the search.
The variables will need to be added later.
Definition at line 2049 of file Solver.java.
◆ makeLastSolutionCollector() [2/2]
|
inline |
Collect the last solution of the search.
Definition at line 2041 of file Solver.java.
◆ makeLess() [1/3]
|
inline |
expr < value
Definition at line 1229 of file Solver.java.
◆ makeLess() [2/3]
|
inline |
expr < value
Definition at line 1221 of file Solver.java.
◆ makeLess() [3/3]
|
inline |
left < right
Definition at line 1213 of file Solver.java.
◆ makeLessOrEqual() [1/3]
|
inline |
expr <= value
Definition at line 1061 of file Solver.java.
◆ makeLessOrEqual() [2/3]
|
inline |
expr <= value
Definition at line 1053 of file Solver.java.
◆ makeLessOrEqual() [3/3]
|
inline |
left <= right
Definition at line 1045 of file Solver.java.
◆ makeLexicalLess()
|
inline |
Creates a constraint that enforces that left is lexicographically less than right.
Definition at line 1584 of file Solver.java.
◆ makeLexicalLessOrEqual()
|
inline |
Creates a constraint that enforces that left is lexicographically less than or equal to right.
Definition at line 1592 of file Solver.java.
◆ makeLimit() [1/5]
|
inline |
Creates a search limit from its protobuf description.
Definition at line 2283 of file Solver.java.
◆ makeLimit() [2/5]
|
inline |
Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits.
Definition at line 2259 of file Solver.java.
◆ makeLimit() [3/5]
|
inline |
Version reducing calls to wall timer by estimating number of remaining calls.
Definition at line 2267 of file Solver.java.
◆ makeLimit() [4/5]
|
inline |
Creates a search limit which can either apply cumulatively or search-by-search.
Definition at line 2275 of file Solver.java.
◆ makeLimit() [5/5]
|
inline |
Creates a search limit that is reached when either of the underlying limit is reached.
That is, the returned limit is more stringent than both argument limits.
Definition at line 2307 of file Solver.java.
◆ makeLocalSearchPhase() [1/4]
|
inline |
Local Search decision builders factories.
Local search is used to improve a given solution. This initial solution can be specified either by an Assignment or by a DecisionBulder, and the corresponding variables, the initial solution being the first solution found by the DecisionBuilder. The LocalSearchPhaseParameters parameter holds the actual definition of the local search phase: - a local search operator used to explore the neighborhood of the current solution, - a decision builder to instantiate unbound variables once a neighbor has been defined; in the case of LNS-based operators instantiates fragment variables; search monitors can be added to this sub-search by wrapping the decision builder with MakeSolveOnce. - a search limit specifying how long local search looks for neighbors before accepting one; the last neighbor is always taken and in the case of a greedy search, this corresponds to the best local neighbor; first-accept (which is the default behavior) can be modeled using a solution found limit of 1, - a vector of local search filters used to speed up the search by pruning unfeasible neighbors. Metaheuristics can be added by defining specialized search monitors; currently down/up-hill climbing is available through OptimizeVar, as well as Guided Local Search, Tabu Search and Simulated Annealing.
Definition at line 2862 of file Solver.java.
◆ makeLocalSearchPhase() [2/4]
|
inline |
Variant with a sub_decison_builder specific to the first solution.
Definition at line 2875 of file Solver.java.
◆ makeLocalSearchPhase() [3/4]
|
inline |
Definition at line 2867 of file Solver.java.
◆ makeLocalSearchPhase() [4/4]
|
inline |
Definition at line 2880 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [1/6]
|
inline |
Local Search Phase Parameters.
Definition at line 2896 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [2/6]
|
inline |
Definition at line 2901 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [3/6]
|
inline |
Definition at line 2906 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [4/6]
|
inline |
Definition at line 2911 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [5/6]
|
inline |
Definition at line 2916 of file Solver.java.
◆ makeLocalSearchPhaseParameters() [6/6]
|
inline |
Definition at line 2921 of file Solver.java.
◆ makeLubyRestart()
|
inline |
This search monitor will restart the search periodically.
At the iteration n, it will restart after scale_factor * Luby(n) failures where Luby is the Luby Strategy (i.e. 1 1 2 1 1 2 4 1 1 2 1 1 2 4 8...).
Definition at line 2211 of file Solver.java.
◆ makeMapDomain()
|
inline |
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 1717 of file Solver.java.
◆ makeMax() [1/4]
std::max(expr, value)
Definition at line 832 of file Solver.java.
◆ makeMax() [2/4]
std::max(expr, value)
Definition at line 824 of file Solver.java.
◆ makeMax() [3/4]
std::max(left, right)
Definition at line 816 of file Solver.java.
◆ makeMax() [4/4]
std::max(vars)
Definition at line 808 of file Solver.java.
◆ makeMaxEquality()
|
inline |
Definition at line 1302 of file Solver.java.
◆ makeMaximize()
|
inline |
Creates a maximization objective.
Definition at line 2110 of file Solver.java.
◆ makeMemberCt() [1/2]
|
inline |
Definition at line 1404 of file Solver.java.
◆ makeMemberCt() [2/2]
|
inline |
expr in set.
Propagation is lazy, i.e. this constraint does not creates holes in the domain of the variable.
Definition at line 1399 of file Solver.java.
◆ makeMin() [1/4]
std::min(expr, value)
Definition at line 800 of file Solver.java.
◆ makeMin() [2/4]
std::min(expr, value)
Definition at line 792 of file Solver.java.
◆ makeMin() [3/4]
std::min (left, right)
Definition at line 784 of file Solver.java.
◆ makeMin() [4/4]
std::min(vars)
Definition at line 776 of file Solver.java.
◆ makeMinEquality()
|
inline |
Definition at line 1297 of file Solver.java.
◆ makeMinimize()
|
inline |
Creates a minimization objective.
Definition at line 2102 of file Solver.java.
◆ makeMirrorInterval()
|
inline |
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 1833 of file Solver.java.
◆ makeModulo() [1/2]
Modulo expression x % mod (with the python convention for modulo).
Definition at line 864 of file Solver.java.
◆ makeModulo() [2/2]
General piecewise-linear function expression, built from f(x) where f is piecewise-linear.
The resulting expression is f(expr). expressions. Modulo expression x % mod (with the python convention for modulo).
Definition at line 856 of file Solver.java.
◆ makeMonotonicElement()
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 736 of file Solver.java.
◆ makeMoveTowardTargetOperator() [1/2]
|
inline |
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 2804 of file Solver.java.
◆ makeMoveTowardTargetOperator() [2/2]
|
inline |
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 2812 of file Solver.java.
◆ makeNBestValueSolutionCollector() [1/2]
|
inline |
Same as MakeBestValueSolutionCollector but collects the best solution_count solutions.
Collected solutions are sorted in increasing optimality order (the best solution is the last one).
Definition at line 2073 of file Solver.java.
◆ makeNBestValueSolutionCollector() [2/2]
|
inline |
Definition at line 2078 of file Solver.java.
◆ makeNeighborhoodLimit()
|
inline |
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 2854 of file Solver.java.
◆ makeNestedOptimize() [1/6]
|
inline |
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.
Definition at line 2719 of file Solver.java.
◆ makeNestedOptimize() [2/6]
|
inline |
Definition at line 2724 of file Solver.java.
◆ makeNestedOptimize() [3/6]
|
inline |
Definition at line 2729 of file Solver.java.
◆ makeNestedOptimize() [4/6]
|
inline |
Definition at line 2734 of file Solver.java.
◆ makeNestedOptimize() [5/6]
|
inline |
Definition at line 2739 of file Solver.java.
◆ makeNestedOptimize() [6/6]
|
inline |
Definition at line 2744 of file Solver.java.
◆ makeNoCycle() [1/3]
|
inline |
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 1648 of file Solver.java.
◆ makeNoCycle() [2/3]
|
inline |
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 1640 of file Solver.java.
◆ makeNoCycle() [3/3]
|
inline |
Definition at line 1653 of file Solver.java.
◆ makeNonEquality() [1/3]
|
inline |
expr != value
Definition at line 1005 of file Solver.java.
◆ makeNonEquality() [2/3]
|
inline |
expr != value
Definition at line 997 of file Solver.java.
◆ makeNonEquality() [3/3]
|
inline |
left != right
Definition at line 989 of file Solver.java.
◆ makeNonOverlappingBoxesConstraint() [1/3]
|
inline |
Definition at line 1759 of file Solver.java.
◆ makeNonOverlappingBoxesConstraint() [2/3]
|
inline |
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 1749 of file Solver.java.
◆ makeNonOverlappingBoxesConstraint() [3/3]
|
inline |
Definition at line 1754 of file Solver.java.
◆ makeNonOverlappingNonStrictBoxesConstraint() [1/3]
|
inline |
Definition at line 1777 of file Solver.java.
◆ makeNonOverlappingNonStrictBoxesConstraint() [2/3]
|
inline |
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 1767 of file Solver.java.
◆ makeNonOverlappingNonStrictBoxesConstraint() [3/3]
|
inline |
Definition at line 1772 of file Solver.java.
◆ makeNotBetweenCt()
|
inline |
(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 1378 of file Solver.java.
◆ makeNotMemberCt() [1/4]
|
inline |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1433 of file Solver.java.
◆ makeNotMemberCt() [2/4]
|
inline |
Definition at line 1417 of file Solver.java.
◆ makeNotMemberCt() [3/4]
|
inline |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1425 of file Solver.java.
◆ makeNotMemberCt() [4/4]
|
inline |
expr not in set.
Definition at line 1412 of file Solver.java.
◆ makeNullIntersect()
|
inline |
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 1624 of file Solver.java.
◆ makeNullIntersectExcept()
|
inline |
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 1632 of file Solver.java.
◆ makeOperator() [1/4]
|
inline |
Local Search Operators.
Definition at line 2768 of file Solver.java.
◆ makeOperator() [2/4]
|
inline |
Definition at line 2773 of file Solver.java.
◆ makeOperator() [3/4]
|
inline |
Definition at line 2783 of file Solver.java.
◆ makeOperator() [4/4]
|
inline |
Definition at line 2778 of file Solver.java.
◆ makeOpposite()
-expr
Definition at line 648 of file Solver.java.
◆ makeOptimize()
|
inline |
Creates a objective with a given sense (true = maximization).
Definition at line 2118 of file Solver.java.
◆ makePack()
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.
Definition at line 1785 of file Solver.java.
◆ makePathConnected()
|
inline |
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 1709 of file Solver.java.
◆ makePathCumul() [1/3]
|
inline |
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 1701 of file Solver.java.
◆ makePathCumul() [2/3]
|
inline |
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 1677 of file Solver.java.
◆ makePathCumul() [3/3]
|
inline |
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 1693 of file Solver.java.
◆ makePhase() [1/15]
|
inline |
Scheduling phases.
Definition at line 2657 of file Solver.java.
◆ makePhase() [2/15]
|
inline |
Shortcuts for small arrays.
Definition at line 2586 of file Solver.java.
◆ makePhase() [3/15]
|
inline |
Definition at line 2591 of file Solver.java.
◆ makePhase() [4/15]
|
inline |
Definition at line 2596 of file Solver.java.
◆ makePhase() [5/15]
|
inline |
Definition at line 2601 of file Solver.java.
◆ makePhase() [6/15]
|
inline |
Phases on IntVar arrays.
for all other functions that have several homonyms in this .h).
Definition at line 2535 of file Solver.java.
◆ makePhase() [7/15]
|
inline |
Definition at line 2545 of file Solver.java.
◆ makePhase() [8/15]
|
inline |
Definition at line 2563 of file Solver.java.
◆ makePhase() [9/15]
|
inline |
var_val1_val2_comparator(var, val1, val2) is true iff assigning value "val1" to variable "var" is better than assigning value "val2".
Definition at line 2553 of file Solver.java.
◆ makePhase() [10/15]
|
inline |
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.
Definition at line 2641 of file Solver.java.
◆ makePhase() [11/15]
|
inline |
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.
Definition at line 2649 of file Solver.java.
◆ makePhase() [12/15]
|
inline |
Definition at line 2540 of file Solver.java.
◆ makePhase() [13/15]
|
inline |
Definition at line 2558 of file Solver.java.
◆ makePhase() [14/15]
|
inline |
Definition at line 2568 of file Solver.java.
◆ makePhase() [15/15]
|
inline |
Definition at line 2662 of file Solver.java.
◆ makePower()
expr ^ n (n > 0)
Definition at line 704 of file Solver.java.
◆ makePrintModelVisitor()
|
inline |
Prints the model.
Definition at line 2397 of file Solver.java.
◆ makeProd() [1/2]
expr * value
Definition at line 664 of file Solver.java.
◆ makeProd() [2/2]
left * right
Definition at line 656 of file Solver.java.
◆ makeRandomLnsOperator() [1/2]
|
inline |
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 2791 of file Solver.java.
◆ makeRandomLnsOperator() [2/2]
|
inline |
Definition at line 2796 of file Solver.java.
◆ makeRankFirstInterval()
|
inline |
Returns a decision that tries to rank first the ith interval var in the sequence variable.
Definition at line 2625 of file Solver.java.
◆ makeRankLastInterval()
|
inline |
Returns a decision that tries to rank last the ith interval var in the sequence variable.
Definition at line 2633 of file Solver.java.
◆ MakeRejectFilter()
|
inline |
Definition at line 2934 of file Solver.java.
◆ makeRestoreAssignment()
|
inline |
Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore())
Definition at line 2752 of file Solver.java.
◆ makeScalProd() [1/2]
scalar product
Definition at line 624 of file Solver.java.
◆ makeScalProd() [2/2]
scalar product
Definition at line 616 of file Solver.java.
◆ makeScalProdEquality() [1/4]
|
inline |
Definition at line 1272 of file Solver.java.
◆ makeScalProdEquality() [2/4]
|
inline |
Definition at line 1262 of file Solver.java.
◆ makeScalProdEquality() [3/4]
|
inline |
Definition at line 1267 of file Solver.java.
◆ makeScalProdEquality() [4/4]
|
inline |
Definition at line 1257 of file Solver.java.
◆ makeScalProdGreaterOrEqual() [1/2]
|
inline |
Definition at line 1282 of file Solver.java.
◆ makeScalProdGreaterOrEqual() [2/2]
|
inline |
Definition at line 1277 of file Solver.java.
◆ makeScalProdLessOrEqual() [1/2]
|
inline |
Definition at line 1292 of file Solver.java.
◆ makeScalProdLessOrEqual() [2/2]
|
inline |
Definition at line 1287 of file Solver.java.
◆ makeScheduleOrExpedite()
|
inline |
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 2617 of file Solver.java.
◆ makeScheduleOrPostpone()
|
inline |
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 2609 of file Solver.java.
◆ makeSearchLog() [1/6]
|
inline |
The SearchMonitors below will display a periodic search log on LOG(INFO) every branch_period branches explored.
Definition at line 2323 of file Solver.java.
◆ makeSearchLog() [2/6]
|
inline |
At each solution, this monitor also display the var value.
Definition at line 2331 of file Solver.java.
◆ makeSearchLog() [3/6]
|
inline |
At each solution, this monitor will display the 'var' value and the result of display_callback.
Definition at line 2347 of file Solver.java.
◆ makeSearchLog() [4/6]
|
inline |
OptimizeVar Search Logs At each solution, this monitor will also display the 'opt_var' value.
Definition at line 2355 of file Solver.java.
◆ makeSearchLog() [5/6]
|
inline |
Creates a search monitor that will also print the result of the display callback.
Definition at line 2363 of file Solver.java.
◆ makeSearchLog() [6/6]
|
inline |
At each solution, this monitor will also display result of display_callback.
Definition at line 2339 of file Solver.java.
◆ makeSearchTrace()
|
inline |
Creates a search monitor that will trace precisely the behavior of the search.
Use this only for low level debugging.
Definition at line 2371 of file Solver.java.
◆ makeSemiContinuousExpr()
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0.
Definition at line 848 of file Solver.java.
◆ makeSimulatedAnnealing()
|
inline |
Creates a Simulated Annealing monitor.
Definition at line 2190 of file Solver.java.
◆ makeSolutionsLimit()
|
inline |
Creates a search limit that constrains the number of solutions found during the search.
Definition at line 2251 of file Solver.java.
◆ makeSolveOnce() [1/6]
|
inline |
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.
Definition at line 2686 of file Solver.java.
◆ makeSolveOnce() [2/6]
|
inline |
Definition at line 2691 of file Solver.java.
◆ makeSolveOnce() [3/6]
|
inline |
Definition at line 2696 of file Solver.java.
◆ makeSolveOnce() [4/6]
|
inline |
Definition at line 2701 of file Solver.java.
◆ makeSolveOnce() [5/6]
|
inline |
Definition at line 2706 of file Solver.java.
◆ makeSolveOnce() [6/6]
|
inline |
Definition at line 2711 of file Solver.java.
◆ makeSortingConstraint()
|
inline |
Creates a constraint binding the arrays of variables "vars" and "sorted_vars": sorted_vars[0] must be equal to the minimum of all variables in vars, and so on: the value of sorted_vars[i] must be equal to the i-th value of variables invars.
This constraint propagates in both directions: from "vars" to "sorted_vars" and vice-versa. Behind the scenes, this constraint maintains that: - sorted is always increasing. - whatever the values of vars, there exists a permutation that injects its values into the sorted variables. For more info, please have a look at: https://mpi-inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Thiel.pdf
Definition at line 1576 of file Solver.java.
◆ makeSplitVariableDomain()
Definition at line 2456 of file Solver.java.
◆ makeSquare()
expr * expr
Definition at line 696 of file Solver.java.
◆ makeStatisticsModelVisitor()
|
inline |
Displays some nice statistics on the model.
Definition at line 2405 of file Solver.java.
◆ makeStoreAssignment()
|
inline |
Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store())
Definition at line 2760 of file Solver.java.
◆ makeStrictDisjunctiveConstraint()
|
inline |
This constraint forces all interval vars into an non-overlapping sequence.
Intervals with zero durations cannot overlap with over intervals.
Definition at line 1937 of file Solver.java.
◆ makeSubCircuit()
|
inline |
Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves.
Definition at line 1669 of file Solver.java.
◆ makeSum() [1/3]
expr + value.
Definition at line 600 of file Solver.java.
◆ makeSum() [2/3]
left + right.
Definition at line 592 of file Solver.java.
◆ makeSum() [3/3]
sum of all vars.
Definition at line 608 of file Solver.java.
◆ makeSumEquality() [1/2]
|
inline |
Definition at line 1252 of file Solver.java.
◆ makeSumEquality() [2/2]
|
inline |
Definition at line 1247 of file Solver.java.
◆ makeSumGreaterOrEqual()
|
inline |
Definition at line 1242 of file Solver.java.
◆ makeSumLessOrEqual()
|
inline |
Variation on arrays.
Definition at line 1237 of file Solver.java.
◆ makeSumObjectiveFilter() [1/2]
|
inline |
Definition at line 2949 of file Solver.java.
◆ makeSumObjectiveFilter() [2/2]
|
inline |
Definition at line 2944 of file Solver.java.
◆ makeSymmetryManager() [1/5]
|
inline |
Definition at line 2418 of file Solver.java.
◆ makeSymmetryManager() [2/5]
|
inline |
Definition at line 2423 of file Solver.java.
◆ makeSymmetryManager() [3/5]
|
inline |
Definition at line 2428 of file Solver.java.
◆ makeSymmetryManager() [4/5]
|
inline |
Definition at line 2433 of file Solver.java.
◆ makeSymmetryManager() [5/5]
|
inline |
Symmetry Breaking.
Definition at line 2413 of file Solver.java.
◆ makeTabuSearch()
|
inline |
MetaHeuristics which try to get the search out of local optima.
Creates a Tabu Search monitor. In the context of local search the behavior is similar to MakeOptimize(), creating an objective in a given sense. The behavior differs once a local optimum is reached: thereafter solutions which degrade the value of the objective are allowed if they are not "tabu". A solution is "tabu" if it doesn't respect the following rules: - improving the best solution found so far - variables in the "keep" list must keep their value, variables in the "forbid" list must not take the value they have in the list. Variables with new values enter the tabu lists after each new solution found and leave the lists after a given number of iterations (called tenure). Only the variables passed to the method can enter the lists. The tabu criterion is softened by the tabu factor which gives the number of "tabu" violations which is tolerated; a factor of 1 means no violations allowed; a factor of 0 means all violations are allowed.
Definition at line 2174 of file Solver.java.
◆ makeTemporalDisjunction() [1/2]
|
inline |
This constraint implements a temporal disjunction between two interval vars.
Definition at line 1921 of file Solver.java.
◆ makeTemporalDisjunction() [2/2]
|
inline |
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 1913 of file Solver.java.
◆ makeTimeLimit()
|
inline |
Creates a search limit that constrains the running time given in milliseconds.
Definition at line 2227 of file Solver.java.
◆ makeTransitionConstraint() [1/2]
|
inline |
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 1741 of file Solver.java.
◆ makeTransitionConstraint() [2/2]
|
inline |
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 1733 of file Solver.java.
◆ makeTrueConstraint()
|
inline |
This constraint always succeeds.
Definition at line 880 of file Solver.java.
◆ makeVariableDomainFilter()
|
inline |
Definition at line 2939 of file Solver.java.
◆ makeVariableGreaterOrEqualValue()
Definition at line 2451 of file Solver.java.
◆ makeVariableLessOrEqualValue()
Definition at line 2446 of file Solver.java.
◆ makeWeightedMaximize() [1/2]
|
inline |
Creates a maximization weigthed objective.
Definition at line 2150 of file Solver.java.
◆ makeWeightedMaximize() [2/2]
|
inline |
Creates a maximization weigthed objective.
Definition at line 2142 of file Solver.java.
◆ makeWeightedMinimize() [1/2]
|
inline |
Creates a minimization weighted objective.
The actual objective is scalar_prod(sub_objectives, weights).
Definition at line 2134 of file Solver.java.
◆ makeWeightedMinimize() [2/2]
|
inline |
Creates a minimization weighted objective.
The actual objective is scalar_prod(sub_objectives, weights).
Definition at line 2126 of file Solver.java.
◆ makeWeightedOptimize() [1/2]
|
inline |
Creates a weighted objective with a given sense (true = maximization).
Definition at line 2166 of file Solver.java.
◆ makeWeightedOptimize() [2/2]
|
inline |
Creates a weighted objective with a given sense (true = maximization).
Definition at line 2158 of file Solver.java.
◆ memoryUsage()
|
inlinestatic |
Current memory usage in bytes.
Definition at line 417 of file Solver.java.
◆ model_name()
|
inline |
Returns the name of the model.
Definition at line 3167 of file Solver.java.
◆ nameAllVariables()
|
inline |
Returns whether all variables should be named.
Definition at line 3160 of file Solver.java.
◆ neighbors()
|
inline |
The number of neighbors created.
Definition at line 466 of file Solver.java.
◆ newSearch() [1/6]
|
inline |
Definition at line 324 of file Solver.java.
◆ newSearch() [2/6]
|
inline |
Definition at line 328 of file Solver.java.
◆ newSearch() [3/6]
|
inline |
Definition at line 332 of file Solver.java.
◆ newSearch() [4/6]
|
inline |
Definition at line 336 of file Solver.java.
◆ newSearch() [5/6]
|
inline |
Definition at line 340 of file Solver.java.
◆ newSearch() [6/6]
|
inline |
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 320 of file Solver.java.
◆ nextSolution()
|
inline |
Definition at line 344 of file Solver.java.
◆ optimization_direction()
|
inline |
The direction of optimization, getter and setter.
Definition at line 501 of file Solver.java.
◆ parameters()
|
inline |
Stored Parameters.
Definition at line 247 of file Solver.java.
◆ popState()
|
inline |
Definition at line 2975 of file Solver.java.
◆ pushState()
|
inline |
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 2971 of file Solver.java.
◆ rand32()
|
inline |
Returns a random value between 0 and 'size' - 1;.
Definition at line 3010 of file Solver.java.
◆ rand64()
|
inline |
Returns a random value between 0 and 'size' - 1;.
Definition at line 3003 of file Solver.java.
◆ randomConcatenateOperators() [1/2]
|
inline |
Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor().
Definition at line 2838 of file Solver.java.
◆ randomConcatenateOperators() [2/2]
|
inline |
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 2846 of file Solver.java.
◆ registerDemon()
Adds a new demon and wraps it inside a DemonProfiler if necessary.
Definition at line 3092 of file Solver.java.
◆ registerIntervalVar()
|
inline |
Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary.
Definition at line 3116 of file Solver.java.
◆ registerIntExpr()
Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary.
Definition at line 3100 of file Solver.java.
◆ registerIntVar()
Registers a new IntVar and wraps it inside a TraceIntVar if necessary.
Definition at line 3108 of file Solver.java.
◆ reSeed()
|
inline |
Reseed the solver random generator.
Definition at line 3017 of file Solver.java.
◆ restartCurrentSearch()
|
inline |
Definition at line 3245 of file Solver.java.
◆ restartSearch()
|
inline |
Definition at line 348 of file Solver.java.
◆ searchDepth()
|
inline |
Gets the search depth of the current active search.
Returns -1 if there is no active search opened.
Definition at line 2982 of file Solver.java.
◆ searchLeftDepth()
|
inline |
Gets the search left depth of the current active search.
Returns -1 if there is no active search opened.
Definition at line 2989 of file Solver.java.
◆ set_optimization_direction()
|
inline |
Definition at line 505 of file Solver.java.
◆ setTmp_vector_()
|
inline |
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 3219 of file Solver.java.
◆ SetUseFastLocalSearch()
|
inline |
enabled for metaheuristics.
Disables/enables fast local search.
Definition at line 3071 of file Solver.java.
◆ shouldFail()
|
inline |
These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail.
Definition at line 3252 of file Solver.java.
◆ solutions()
|
inline |
The number of solutions found since the start of the search.
Definition at line 438 of file Solver.java.
◆ solve() [1/6]
|
inline |
Definition at line 297 of file Solver.java.
◆ solve() [2/6]
|
inline |
Definition at line 301 of file Solver.java.
◆ solve() [3/6]
|
inline |
Definition at line 305 of file Solver.java.
◆ solve() [4/6]
|
inline |
Definition at line 309 of file Solver.java.
◆ solve() [5/6]
|
inline |
Definition at line 313 of file Solver.java.
◆ solve() [6/6]
|
inline |
Solves the problem using the given DecisionBuilder and returns true if a solution was found and accepted.
These methods are the ones most users should use to search for a solution. Note that the definition of 'solution' is subtle. A solution here is defined as a leaf of the search tree with respect to the given decision builder for which there is no failure. What this means is that, contrary to intuition, a solution may not have all variables of the model bound. It is the responsibility of the decision builder to keep returning decisions until all variables are indeed bound. The most extreme counterexample is calling Solve with a trivial decision builder whose Next() method always returns nullptr. In this case, Solve immediately returns 'true', since not assigning any variable to any value is a solution, unless the root node propagation discovers that the model is infeasible. This function must be called either from outside of search, or from within the Next() method of a decision builder. Solve will terminate whenever any of the following event arise: * A search monitor asks the solver to terminate the search by calling solver()->FinishCurrentSearch(). * A solution is found that is accepted by all search monitors, and none of the search monitors decides to search for another one. Upon search termination, there will be a series of backtracks all the way to the top level. This means that a user cannot expect to inspect the solution by querying variables after a call to Solve(): all the information will be lost. In order to do something with the solution, the user must either: * Use a search monitor that can process such a leaf. See, in particular, the SolutionCollector class. * Do not use Solve. Instead, use the more fine-grained approach using methods NewSearch(...), NextSolution(), and EndSearch().
- Parameters
-
db The decision builder that will generate the search tree. monitors A vector of search monitors that will be notified of various events during the search. In their reaction to these events, such monitors may influence the search.
Definition at line 293 of file Solver.java.
◆ solveAndCommit() [1/5]
|
inline |
Definition at line 363 of file Solver.java.
◆ solveAndCommit() [2/5]
|
inline |
Definition at line 367 of file Solver.java.
◆ solveAndCommit() [3/5]
|
inline |
Definition at line 371 of file Solver.java.
◆ solveAndCommit() [4/5]
|
inline |
Definition at line 375 of file Solver.java.
◆ solveAndCommit() [5/5]
|
inline |
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 359 of file Solver.java.
◆ solveDepth()
|
inline |
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 2996 of file Solver.java.
◆ stamp()
|
inline |
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 487 of file Solver.java.
◆ state()
|
inline |
State of the solver.
Definition at line 396 of file Solver.java.
◆ topPeriodicCheck()
|
inline |
Performs PeriodicCheck on the top-level search; for instance, can be called from a nested solve to check top-level limits.
Definition at line 2957 of file Solver.java.
◆ topProgressPercent()
|
inline |
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 2964 of file Solver.java.
◆ toString()
|
inline |
misc debug string.
Definition at line 410 of file Solver.java.
◆ tryDecisions() [1/4]
|
inline |
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.
Definition at line 2512 of file Solver.java.
◆ tryDecisions() [2/4]
|
inline |
Definition at line 2517 of file Solver.java.
◆ tryDecisions() [3/4]
|
inline |
Definition at line 2522 of file Solver.java.
◆ tryDecisions() [4/4]
|
inline |
Definition at line 2527 of file Solver.java.
◆ unchecked_solutions()
|
inline |
The number of unchecked solutions found by local search.
Definition at line 445 of file Solver.java.
◆ UseFastLocalSearch()
|
inline |
Returns true if fast local search is enabled.
Definition at line 3078 of file Solver.java.
◆ wallTime()
|
inline |
DEPRECATED: Use Now() instead.
Time elapsed, in ms since the creation of the solver.
Definition at line 424 of file Solver.java.
Member Data Documentation
◆ ASSIGN_CENTER_VALUE
|
static |
Selects the first possible value which is the closest to the center of the domain of the selected variable.
The center is defined as (min + max) / 2.
Definition at line 3354 of file Solver.java.
◆ ASSIGN_MAX_VALUE
|
static |
Selects the max value of the selected variable.
Definition at line 3346 of file Solver.java.
◆ ASSIGN_MIN_VALUE
|
static |
Selects the min value of the selected variable.
Definition at line 3342 of file Solver.java.
◆ ASSIGN_RANDOM_VALUE
|
static |
Selects randomly one of the possible values of the selected variable.
Definition at line 3350 of file Solver.java.
◆ AT_SOLUTION
|
static |
After successful NextSolution and before EndSearch.
Definition at line 3670 of file Solver.java.
◆ AVOID_DATE
|
static |
STARTS_AFTER or ENDS_BEFORE, i.e.
d is not in t. t starts after d, i.e. Start(t) >= d. t ends before d, i.e. End(t) <= d.
Definition at line 3612 of file Solver.java.
◆ CHOICE_POINT
|
static |
Definition at line 3647 of file Solver.java.
◆ CHOOSE_DYNAMIC_GLOBAL_BEST
|
static |
Pairs are compared each time a variable is selected.
That way all pairs are relevant and evaluation is accurate. This strategy runs in O(number-of-pairs) at each variable selection, versus O(1) in the static version.
Definition at line 3376 of file Solver.java.
◆ CHOOSE_FIRST_UNBOUND
|
static |
Select the first unbound variable.
Variables are considered in the order of the vector of IntVars used to create the selector.
Definition at line 3280 of file Solver.java.
◆ CHOOSE_HIGHEST_MAX
|
static |
Among unbound variables, select the variable with the highest maximal value.
In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3308 of file Solver.java.
◆ CHOOSE_LOWEST_MIN
|
static |
Among unbound variables, select the variable with the smallest minimal value.
In case of a tie, the first one is selected, "first" defined by the order in the vector of IntVars used to create the selector.
Definition at line 3304 of file Solver.java.
◆ CHOOSE_MAX_REGRET_ON_MIN
|
static |
Among unbound variables, select the variable with the largest gap between the first and the second values of the domain.
Definition at line 3320 of file Solver.java.
◆ CHOOSE_MAX_SIZE
|
static |
Among unbound variables, select the variable with the highest size.
In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3316 of file Solver.java.
◆ CHOOSE_MIN_SIZE
|
static |
Among unbound variables, select the variable with the smallest size.
In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3312 of file Solver.java.
◆ CHOOSE_MIN_SIZE_HIGHEST_MAX
|
static |
Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values.
In case of a tie, the selected variable is the one with the highest max value. In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3300 of file Solver.java.
◆ CHOOSE_MIN_SIZE_HIGHEST_MIN
|
static |
Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values.
In case of a tie, the selected variable is the one with the highest min value. In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3292 of file Solver.java.
◆ CHOOSE_MIN_SIZE_LOWEST_MAX
|
static |
Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values.
In case of a tie, the selected variables is the one with the lowest max value. In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3296 of file Solver.java.
◆ CHOOSE_MIN_SIZE_LOWEST_MIN
|
static |
Among unbound variables, select the variable with the smallest size, i.e., the smallest number of possible values.
In case of a tie, the selected variables is the one with the lowest min value. In case of a tie, the first one is selected, first being defined by the order in the vector of IntVars used to create the selector.
Definition at line 3288 of file Solver.java.
◆ CHOOSE_MIN_SLACK_RANK_FORWARD
|
static |
Definition at line 3385 of file Solver.java.
◆ CHOOSE_PATH
|
static |
Selects the next unbound variable on a path, the path being defined by the variables: var[i] corresponds to the index of the next of i.
Definition at line 3324 of file Solver.java.
◆ CHOOSE_RANDOM
|
static |
Randomly select one of the remaining unbound variables.
Definition at line 3284 of file Solver.java.
◆ CHOOSE_RANDOM_RANK_FORWARD
|
static |
Definition at line 3386 of file Solver.java.
◆ CHOOSE_STATIC_GLOBAL_BEST
|
static |
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. Pairs are compared at the first call of the selector, and results are cached. Next calls to the selector use the previous computation, and so are not up-to-date, e.g. some <variable, value> pairs may not be possible anymore due to propagation since the first to call.
Definition at line 3372 of file Solver.java.
◆ CROSS
|
static |
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
Definition at line 3434 of file Solver.java.
◆ CROSS_DATE
|
static |
STARTS_BEFORE and ENDS_AFTER at the same time, i.e.
d is in t. t starts before d, i.e. Start(t) <= d. t ends after d, i.e. End(t) >= d.
Definition at line 3608 of file Solver.java.
◆ DECREMENT
|
static |
Operator which defines a neighborhood to decrement values.
The behavior is the same as INCREMENT, except values are decremented instead of incremented.
Definition at line 3474 of file Solver.java.
◆ DELAYED_PRIORITY
|
static |
This enum represents the three possible priorities for a demon in the Solver queue.
Note: this is for advanced users only. DELAYED_PRIORITY is the lowest priority: Demons will be processed after VAR_PRIORITY and NORMAL_PRIORITY demons.
Definition at line 3524 of file Solver.java.
◆ ENDS_AFTER
|
static |
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d.
t ends after d, i.e. End(t) >= d.
Definition at line 3584 of file Solver.java.
◆ ENDS_AFTER_END
|
static |
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2.
t1 ends after t2 end, i.e. End(t1) >= End(t2) + delay.
Definition at line 3542 of file Solver.java.
◆ ENDS_AFTER_START
|
static |
t1 ends after t2 start, i.e.
End(t1) >= Start(t2) + delay.
Definition at line 3546 of file Solver.java.
◆ ENDS_AT
|
static |
◆ ENDS_AT_END
|
static |
◆ ENDS_AT_START
|
static |
t1 ends at t2 start, i.e.
End(t1) == Start(t2) + delay.
Definition at line 3554 of file Solver.java.
◆ ENDS_BEFORE
|
static |
◆ EQ
|
static |
Move is accepted when the current objective value is in the interval objective.Min .
. objective.Max.
Definition at line 3514 of file Solver.java.
◆ EXCHANGE
|
static |
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
Definition at line 3430 of file Solver.java.
◆ EXTENDEDSWAPACTIVE
|
static |
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
Definition at line 3454 of file Solver.java.
◆ FULLPATHLNS
|
static |
Operator which relaxes one entire path and all inactive nodes, thus defining num_paths neighbors.
Definition at line 3462 of file Solver.java.
◆ GE
|
static |
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. Move is accepted when the current objective value >= objective.Min.
Definition at line 3506 of file Solver.java.
◆ IN_ROOT_NODE
|
static |
Executing the root node.
Definition at line 3662 of file Solver.java.
◆ IN_SEARCH
|
static |
Executing the search code.
Definition at line 3666 of file Solver.java.
◆ INCREMENT
|
static |
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.
Definition at line 3470 of file Solver.java.
◆ INT_VALUE_DEFAULT
|
static |
This enum describes the strategy used to select the next variable value to set.
The default behavior is ASSIGN_MIN_VALUE.
Definition at line 3334 of file Solver.java.
◆ INT_VALUE_SIMPLE
|
static |
The simple selection is ASSIGN_MIN_VALUE.
Definition at line 3338 of file Solver.java.
◆ INT_VAR_DEFAULT
|
static |
This enum describes the strategy used to select the next branching variable at each node during the search.
The default behavior is CHOOSE_FIRST_UNBOUND.
Definition at line 3272 of file Solver.java.
◆ INT_VAR_SIMPLE
|
static |
The simple selection is CHOOSE_FIRST_UNBOUND.
Definition at line 3276 of file Solver.java.
◆ INTERVAL_DEFAULT
|
static |
This enum describes the straregy used to select the next interval variable and its value to be fixed.
The default is INTERVAL_SET_TIMES_FORWARD.
Definition at line 3396 of file Solver.java.
◆ INTERVAL_SET_TIMES_BACKWARD
|
static |
Selects the variable with the highest ending time of all variables, and fixes the ending time to this highest values.
Definition at line 3408 of file Solver.java.
◆ INTERVAL_SET_TIMES_FORWARD
|
static |
Selects the variable with the lowest starting time of all variables, and fixes its starting time to this lowest value.
Definition at line 3404 of file Solver.java.
◆ INTERVAL_SIMPLE
|
static |
The simple is INTERVAL_SET_TIMES_FORWARD.
Definition at line 3400 of file Solver.java.
◆ KEEP_LEFT
|
static |
Right branches are ignored.
This is used to make the code faster when backtrack makes no sense or is not useful. This is faster as there is no need to create one new node per decision.
Definition at line 3626 of file Solver.java.
◆ KEEP_RIGHT
|
static |
Left branches are ignored.
This is used to make the code faster when backtrack makes no sense or is not useful. This is faster as there is no need to create one new node per decision.
Definition at line 3630 of file Solver.java.
◆ KILL_BOTH
|
static |
Backtracks to the previous decisions, i.e.
left and right branches are not applied.
Definition at line 3634 of file Solver.java.
◆ kNumPriorities
|
static |
Number of priorities for demons.
Definition at line 3263 of file Solver.java.
◆ LE
|
static |
Move is accepted when the current objective value <= objective.Max.
Definition at line 3510 of file Solver.java.
◆ LK
|
static |
This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create.
Lin-Kernighan local search. While the accumulated local gain is positive, perform a 2opt or a 3opt move followed by a series of 2opt moves. Return a neighbor for which the global gain is positive.
Definition at line 3488 of file Solver.java.
◆ MAKEACTIVE
|
static |
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
Definition at line 3438 of file Solver.java.
◆ MAKECHAININACTIVE
|
static |
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
Definition at line 3446 of file Solver.java.
◆ MAKEINACTIVE
|
static |
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
Definition at line 3442 of file Solver.java.
◆ MAXIMIZATION
|
static |
Definition at line 3686 of file Solver.java.
◆ MINIMIZATION
|
static |
Definition at line 3687 of file Solver.java.
◆ NO_CHANGE
|
static |
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. Keeps the default behavior, i.e. apply left branch first, and then right branch in case of backtracking.
Definition at line 3622 of file Solver.java.
◆ NO_MORE_SOLUTIONS
|
static |
After failed NextSolution and before EndSearch.
Definition at line 3674 of file Solver.java.
◆ NORMAL_PRIORITY
|
static |
NORMAL_PRIORITY is the highest priority: Demons will be processed first.
Definition at line 3532 of file Solver.java.
◆ NOT_SET
|
static |
Optimization directions.
Definition at line 3685 of file Solver.java.
◆ OROPT
|
static |
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).
Definition at line 3422 of file Solver.java.
◆ OUTSIDE_SEARCH
|
static |
This enum represents the state of the solver w.r.t.
the search. Before search, after search.
Definition at line 3658 of file Solver.java.
◆ PATHLNS
|
static |
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.
Definition at line 3458 of file Solver.java.
◆ PROBLEM_INFEASIBLE
|
static |
After search, the model is infeasible.
Definition at line 3678 of file Solver.java.
◆ RELOCATE
|
static |
Relocate neighborhood with length of 1 (see OROPT comment).
Definition at line 3426 of file Solver.java.
◆ REVERSIBLE_ACTION
|
static |
Definition at line 3648 of file Solver.java.
◆ SENTINEL
|
static |
This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree.
Definition at line 3645 of file Solver.java.
◆ SEQUENCE_DEFAULT
|
static |
◆ SEQUENCE_SIMPLE
|
static |
Definition at line 3384 of file Solver.java.
◆ SIMPLE_MARKER
|
static |
Definition at line 3646 of file Solver.java.
◆ SIMPLELNS
|
static |
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 3478 of file Solver.java.
◆ SPLIT_LOWER_HALF
|
static |
Split the domain in two around the center, and choose the lower part first.
Definition at line 3358 of file Solver.java.
◆ SPLIT_UPPER_HALF
|
static |
Split the domain in two around the center, and choose the lower part first.
Definition at line 3362 of file Solver.java.
◆ STARTS_AFTER
|
static |
◆ STARTS_AFTER_END
|
static |
t1 starts after t2 end, i.e.
Start(t1) >= End(t2) + delay.
Definition at line 3558 of file Solver.java.
◆ STARTS_AFTER_START
|
static |
t1 starts after t2 start, i.e.
Start(t1) >= Start(t2) + delay.
Definition at line 3562 of file Solver.java.
◆ STARTS_AT
|
static |
◆ STARTS_AT_END
|
static |
t1 starts at t2 end, i.e.
Start(t1) == End(t2) + delay.
Definition at line 3566 of file Solver.java.
◆ STARTS_AT_START
|
static |
t1 starts at t2 start, i.e.
Start(t1) == Start(t2) + delay.
Definition at line 3570 of file Solver.java.
◆ STARTS_BEFORE
|
static |
◆ STAYS_IN_SYNC
|
static |
STARTS_AT_START and ENDS_AT_END at the same time.
t1 starts at t2 start, i.e. Start(t1) == Start(t2) + delay. t1 ends at t2 end, i.e. End(t1) == End(t2).
Definition at line 3574 of file Solver.java.
◆ SWAPACTIVE
|
static |
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
Definition at line 3450 of file Solver.java.
◆ SWITCH_BRANCHES
|
static |
Applies right branch first.
Left branch will be applied in case of backtracking.
Definition at line 3638 of file Solver.java.
◆ TSPLNS
|
static |
TSP-base LNS.
Randomly merge consecutive nodes until n "meta"-nodes remain and solve the corresponding TSP. This is an "unlimited" neighborhood which must be stopped by search limits. To force diversification, the operator iteratively forces each node to serve as base of a meta-node.
Definition at line 3496 of file Solver.java.
◆ TSPOPT
|
static |
Sliding TSP operator.
Uses an exact dynamic programming algorithm to solve the TSP corresponding to path sub-chains. For a subchain 1 -> 2 -> 3 -> 4 -> 5 -> 6, solves the TSP on nodes A, 2, 3, 4, 5, where A is a merger of nodes 1 and 6 such that cost(A,i) = cost(1,i) and cost(i,A) = cost(i,6).
Definition at line 3492 of file Solver.java.
◆ TWOOPT
|
static |
This enum is used in Solver::MakeOperator to specify the neighborhood to create.
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
Definition at line 3418 of file Solver.java.
◆ UNACTIVELNS
|
static |
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.
Definition at line 3466 of file Solver.java.
◆ VAR_PRIORITY
|
static |
VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY.
Definition at line 3528 of file Solver.java.
The documentation for this class was generated from the following file: