Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Public Member Functions | |
__init__ (self, *args) | |
Parameters (self) | |
AddConstraint (self, c) | |
Solve (self, *args) | |
NewSearch (self, *args) | |
NextSolution (self) | |
RestartSearch (self) | |
EndSearch (self) | |
SolveAndCommit (self, *args) | |
CheckAssignment (self, solution) | |
CheckConstraint (self, ct) | |
Fail (self) | |
WallTime (self) | |
Branches (self) | |
Solutions (self) | |
Failures (self) | |
AcceptedNeighbors (self) | |
Stamp (self) | |
FailStamp (self) | |
IntVar (self, *args) | |
BoolVar (self, *args) | |
IntConst (self, *args) | |
Sum (self, vars) | |
ScalProd (self, *args) | |
MonotonicElement (self, values, increasing, index) | |
Element (self, *args) | |
IndexExpression (self, vars, value) | |
Min (self, *args) | |
Max (self, *args) | |
ConvexPiecewiseExpr (self, expr, early_cost, early_date, late_date, late_cost) | |
SemiContinuousExpr (self, expr, fixed_charge, step) | |
ConditionalExpression (self, condition, expr, unperformed_value) | |
TrueConstraint (self) | |
FalseConstraint (self, *args) | |
IsEqualCstCt (self, var, value, boolvar) | |
IsEqualCstVar (self, var, value) | |
IsEqualCt (self, v1, v2, b) | |
IsEqualVar (self, v1, v2) | |
IsDifferentCstCt (self, var, value, boolvar) | |
IsDifferentCstVar (self, var, value) | |
IsDifferentVar (self, v1, v2) | |
IsDifferentCt (self, v1, v2, b) | |
IsLessOrEqualCstCt (self, var, value, boolvar) | |
IsLessOrEqualCstVar (self, var, value) | |
IsLessOrEqualVar (self, left, right) | |
IsLessOrEqualCt (self, left, right, b) | |
IsGreaterOrEqualCstCt (self, var, value, boolvar) | |
IsGreaterOrEqualCstVar (self, var, value) | |
IsGreaterOrEqualVar (self, left, right) | |
IsGreaterOrEqualCt (self, left, right, b) | |
IsGreaterCstCt (self, v, c, b) | |
IsGreaterCstVar (self, var, value) | |
IsGreaterVar (self, left, right) | |
IsGreaterCt (self, left, right, b) | |
IsLessCstCt (self, v, c, b) | |
IsLessCstVar (self, var, value) | |
IsLessVar (self, left, right) | |
IsLessCt (self, left, right, b) | |
SumLessOrEqual (self, vars, cst) | |
SumGreaterOrEqual (self, vars, cst) | |
SumEquality (self, *args) | |
ScalProdEquality (self, *args) | |
ScalProdGreaterOrEqual (self, *args) | |
ScalProdLessOrEqual (self, *args) | |
MinEquality (self, vars, min_var) | |
MaxEquality (self, vars, max_var) | |
ElementEquality (self, *args) | |
AbsEquality (self, var, abs_var) | |
IndexOfConstraint (self, vars, index, target) | |
ConstraintInitialPropagateCallback (self, ct) | |
DelayedConstraintInitialPropagateCallback (self, ct) | |
ClosureDemon (self, closure) | |
BetweenCt (self, expr, l, u) | |
IsBetweenCt (self, expr, l, u, b) | |
IsBetweenVar (self, v, l, u) | |
MemberCt (self, *args) | |
NotMemberCt (self, *args) | |
IsMemberCt (self, *args) | |
IsMemberVar (self, *args) | |
Count (self, *args) | |
Distribute (self, *args) | |
Deviation (self, vars, deviation_var, total_sum) | |
AllDifferent (self, *args) | |
AllDifferentExcept (self, vars, escape_value) | |
SortingConstraint (self, vars, sorted) | |
LexicalLess (self, left, right) | |
LexicalLessOrEqual (self, left, right) | |
InversePermutationConstraint (self, left, right) | |
NullIntersect (self, first_vars, second_vars) | |
NullIntersectExcept (self, first_vars, second_vars, escape_value) | |
Circuit (self, nexts) | |
SubCircuit (self, nexts) | |
DelayedPathCumul (self, nexts, active, cumuls, transits) | |
PathCumul (self, *args) | |
AllowedAssignments (self, *args) | |
TransitionConstraint (self, *args) | |
NonOverlappingBoxesConstraint (self, *args) | |
Pack (self, vars, number_of_bins) | |
FixedDurationIntervalVar (self, *args) | |
FixedInterval (self, start, duration, name) | |
IntervalVar (self, start_min, start_max, duration_min, duration_max, end_min, end_max, optional, name) | |
MirrorInterval (self, interval_var) | |
FixedDurationStartSyncedOnStartIntervalVar (self, interval_var, duration, offset) | |
FixedDurationStartSyncedOnEndIntervalVar (self, interval_var, duration, offset) | |
FixedDurationEndSyncedOnStartIntervalVar (self, interval_var, duration, offset) | |
FixedDurationEndSyncedOnEndIntervalVar (self, interval_var, duration, offset) | |
IntervalRelaxedMin (self, interval_var) | |
IntervalRelaxedMax (self, interval_var) | |
TemporalDisjunction (self, *args) | |
DisjunctiveConstraint (self, intervals, name) | |
Cumulative (self, *args) | |
Cover (self, vars, target_var) | |
Assignment (self, *args) | |
FirstSolutionCollector (self, *args) | |
LastSolutionCollector (self, *args) | |
BestValueSolutionCollector (self, *args) | |
AllSolutionCollector (self, *args) | |
Minimize (self, v, step) | |
Maximize (self, v, step) | |
Optimize (self, maximize, v, step) | |
WeightedMinimize (self, *args) | |
WeightedMaximize (self, *args) | |
WeightedOptimize (self, *args) | |
TabuSearch (self, maximize, objective, step, vars, keep_tenure, forbid_tenure, tabu_factor) | |
SimulatedAnnealing (self, maximize, v, step, initial_temperature) | |
LubyRestart (self, scale_factor) | |
ConstantRestart (self, frequency) | |
TimeLimit (self, *args) | |
BranchesLimit (self, branches) | |
FailuresLimit (self, failures) | |
SolutionsLimit (self, solutions) | |
Limit (self, *args) | |
CustomLimit (self, limiter) | |
SearchLog (self, *args) | |
SearchTrace (self, prefix) | |
PrintModelVisitor (self) | |
StatisticsModelVisitor (self) | |
AssignVariableValue (self, var, val) | |
VariableLessOrEqualValue (self, var, value) | |
VariableGreaterOrEqualValue (self, var, value) | |
SplitVariableDomain (self, var, val, start_with_lower_half) | |
AssignVariableValueOrFail (self, var, value) | |
AssignVariablesValues (self, vars, values) | |
FailDecision (self) | |
Decision (self, apply, refute) | |
Compose (self, dbs) | |
Try (self, dbs) | |
DefaultPhase (self, *args) | |
ScheduleOrPostpone (self, var, est, marker) | |
ScheduleOrExpedite (self, var, est, marker) | |
RankFirstInterval (self, sequence, index) | |
RankLastInterval (self, sequence, index) | |
Phase (self, *args) | |
DecisionBuilderFromAssignment (self, assignment, db, vars) | |
ConstraintAdder (self, ct) | |
SolveOnce (self, db, monitors) | |
NestedOptimize (self, *args) | |
RestoreAssignment (self, assignment) | |
StoreAssignment (self, assignment) | |
Operator (self, *args) | |
RandomLnsOperator (self, *args) | |
MoveTowardTargetOperator (self, *args) | |
ConcatenateOperators (self, *args) | |
RandomConcatenateOperators (self, *args) | |
NeighborhoodLimit (self, op, limit) | |
LocalSearchPhase (self, *args) | |
LocalSearchPhaseParameters (self, *args) | |
TopProgressPercent (self) | |
SearchDepth (self) | |
SearchLeftDepth (self) | |
SolveDepth (self) | |
Rand64 (self, size) | |
Rand32 (self, size) | |
ReSeed (self, seed) | |
LocalSearchProfile (self) | |
Constraints (self) | |
Accept (self, visitor) | |
FinishCurrentSearch (self) | |
RestartCurrentSearch (self) | |
ShouldFail (self) | |
__str__ (self) | |
Add (self, ct) | |
TreeNoCycle (self, nexts, active, callback=0) | |
SearchLogWithCallback (self, period, callback) | |
ElementFunction (self, values, index) | |
VarEvalValStrPhase (self, vars, var_evaluator, val_str) | |
VarStrValEvalPhase (self, vars, var_str, val_eval) | |
VarEvalValEvalPhase (self, vars, var_eval, val_eval) | |
VarStrValEvalTieBreakPhase (self, vars, var_str, val_eval, tie_breaker) | |
VarEvalValEvalTieBreakPhase (self, vars, var_eval, val_eval, tie_breaker) | |
EvalEvalStrPhase (self, vars, evaluator, str) | |
EvalEvalStrTieBreakPhase (self, vars, evaluator, tie_breaker, str) | |
GuidedLocalSearch (self, *args) | |
SumObjectiveFilter (self, vars, values, filter_enum) | |
Static Public Member Functions | |
DefaultSolverParameters () | |
MemoryUsage () | |
Static Public Attributes | |
INT_VAR_DEFAULT = _pywrapcp.Solver_INT_VAR_DEFAULT | |
INT_VAR_SIMPLE = _pywrapcp.Solver_INT_VAR_SIMPLE | |
CHOOSE_FIRST_UNBOUND = _pywrapcp.Solver_CHOOSE_FIRST_UNBOUND | |
CHOOSE_RANDOM = _pywrapcp.Solver_CHOOSE_RANDOM | |
CHOOSE_MIN_SIZE_LOWEST_MIN = _pywrapcp.Solver_CHOOSE_MIN_SIZE_LOWEST_MIN | |
CHOOSE_MIN_SIZE_HIGHEST_MIN = _pywrapcp.Solver_CHOOSE_MIN_SIZE_HIGHEST_MIN | |
CHOOSE_MIN_SIZE_LOWEST_MAX = _pywrapcp.Solver_CHOOSE_MIN_SIZE_LOWEST_MAX | |
CHOOSE_MIN_SIZE_HIGHEST_MAX = _pywrapcp.Solver_CHOOSE_MIN_SIZE_HIGHEST_MAX | |
CHOOSE_LOWEST_MIN = _pywrapcp.Solver_CHOOSE_LOWEST_MIN | |
CHOOSE_HIGHEST_MAX = _pywrapcp.Solver_CHOOSE_HIGHEST_MAX | |
CHOOSE_MIN_SIZE = _pywrapcp.Solver_CHOOSE_MIN_SIZE | |
CHOOSE_MAX_SIZE = _pywrapcp.Solver_CHOOSE_MAX_SIZE | |
CHOOSE_MAX_REGRET_ON_MIN = _pywrapcp.Solver_CHOOSE_MAX_REGRET_ON_MIN | |
CHOOSE_PATH = _pywrapcp.Solver_CHOOSE_PATH | |
INT_VALUE_DEFAULT = _pywrapcp.Solver_INT_VALUE_DEFAULT | |
INT_VALUE_SIMPLE = _pywrapcp.Solver_INT_VALUE_SIMPLE | |
ASSIGN_MIN_VALUE = _pywrapcp.Solver_ASSIGN_MIN_VALUE | |
ASSIGN_MAX_VALUE = _pywrapcp.Solver_ASSIGN_MAX_VALUE | |
ASSIGN_RANDOM_VALUE = _pywrapcp.Solver_ASSIGN_RANDOM_VALUE | |
ASSIGN_CENTER_VALUE = _pywrapcp.Solver_ASSIGN_CENTER_VALUE | |
SPLIT_LOWER_HALF = _pywrapcp.Solver_SPLIT_LOWER_HALF | |
SPLIT_UPPER_HALF = _pywrapcp.Solver_SPLIT_UPPER_HALF | |
SEQUENCE_DEFAULT = _pywrapcp.Solver_SEQUENCE_DEFAULT | |
SEQUENCE_SIMPLE = _pywrapcp.Solver_SEQUENCE_SIMPLE | |
CHOOSE_MIN_SLACK_RANK_FORWARD = _pywrapcp.Solver_CHOOSE_MIN_SLACK_RANK_FORWARD | |
CHOOSE_RANDOM_RANK_FORWARD = _pywrapcp.Solver_CHOOSE_RANDOM_RANK_FORWARD | |
INTERVAL_DEFAULT = _pywrapcp.Solver_INTERVAL_DEFAULT | |
INTERVAL_SIMPLE = _pywrapcp.Solver_INTERVAL_SIMPLE | |
INTERVAL_SET_TIMES_FORWARD = _pywrapcp.Solver_INTERVAL_SET_TIMES_FORWARD | |
INTERVAL_SET_TIMES_BACKWARD = _pywrapcp.Solver_INTERVAL_SET_TIMES_BACKWARD | |
TWOOPT = _pywrapcp.Solver_TWOOPT | |
OROPT = _pywrapcp.Solver_OROPT | |
RELOCATE = _pywrapcp.Solver_RELOCATE | |
EXCHANGE = _pywrapcp.Solver_EXCHANGE | |
CROSS = _pywrapcp.Solver_CROSS | |
MAKEACTIVE = _pywrapcp.Solver_MAKEACTIVE | |
MAKEINACTIVE = _pywrapcp.Solver_MAKEINACTIVE | |
MAKECHAININACTIVE = _pywrapcp.Solver_MAKECHAININACTIVE | |
SWAPACTIVE = _pywrapcp.Solver_SWAPACTIVE | |
EXTENDEDSWAPACTIVE = _pywrapcp.Solver_EXTENDEDSWAPACTIVE | |
PATHLNS = _pywrapcp.Solver_PATHLNS | |
FULLPATHLNS = _pywrapcp.Solver_FULLPATHLNS | |
UNACTIVELNS = _pywrapcp.Solver_UNACTIVELNS | |
INCREMENT = _pywrapcp.Solver_INCREMENT | |
DECREMENT = _pywrapcp.Solver_DECREMENT | |
SIMPLELNS = _pywrapcp.Solver_SIMPLELNS | |
GE = _pywrapcp.Solver_GE | |
LE = _pywrapcp.Solver_LE | |
EQ = _pywrapcp.Solver_EQ | |
DELAYED_PRIORITY = _pywrapcp.Solver_DELAYED_PRIORITY | |
VAR_PRIORITY = _pywrapcp.Solver_VAR_PRIORITY | |
NORMAL_PRIORITY = _pywrapcp.Solver_NORMAL_PRIORITY | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
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 117 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.__init__ | ( | self, | |
* | args ) |
Definition at line 435 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.__str__ | ( | self | ) |
Definition at line 1870 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AbsEquality | ( | self, | |
var, | |||
abs_var ) |
Creates the constraint abs(var) == abs_var.
Definition at line 873 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Accept | ( | self, | |
visitor ) |
Accepts the given model visitor.
Definition at line 1852 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AcceptedNeighbors | ( | self | ) |
The number of accepted neighbors.
Definition at line 549 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Add | ( | self, | |
ct ) |
Definition at line 1873 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AddConstraint | ( | self, | |
c ) |
Adds the constraint 'c' to the model. After calling this method, and until there is a backtrack that undoes the addition, any assignment of variables to values must satisfy the given constraint in order to be considered feasible. There are two fairly different use cases: - the most common use case is modeling: the given constraint is really part of the problem that the user is trying to solve. In this use case, AddConstraint is called outside of search (i.e., with state() == OUTSIDE_SEARCH). Most users should only use AddConstraint in this way. In this case, the constraint will belong to the model forever: it cannot be removed by backtracking. - a rarer use case is that 'c' is not a real constraint of the model. It may be a constraint generated by a branching decision (a constraint whose goal is to restrict the search space), a symmetry breaking constraint (a constraint that does restrict the search space, but in a way that cannot have an impact on the quality of the solutions in the subtree), or an inferred constraint that, while having no semantic value to the model (it does not restrict the set of solutions), is worth having because we believe it may strengthen the propagation. In these cases, it happens that the constraint is added during the search (i.e., with state() == IN_SEARCH or state() == IN_ROOT_NODE). When a constraint is added during a search, it applies only to the subtree of the search tree rooted at the current node, and will be automatically removed by backtracking. This method does not take ownership of the constraint. If the constraint has been created by any factory method (Solver::MakeXXX), it will automatically be deleted. However, power users who implement their own constraints should do: solver.AddConstraint(solver.RevAlloc(new MyConstraint(...));
Definition at line 453 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AllDifferent | ( | self, | |
* | args ) |
*Overload 1:* All variables are pairwise different. This corresponds to the stronger version of the propagation algorithm. | *Overload 2:* 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 1014 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AllDifferentExcept | ( | self, | |
vars, | |||
escape_value ) |
All variables are pairwise different, unless they are assigned to the escape value.
Definition at line 1029 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AllowedAssignments | ( | self, | |
* | args ) |
*Overload 1:* 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. | *Overload 2:* Compatibility layer for Python API.
Definition at line 1146 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AllSolutionCollector | ( | self, | |
* | args ) |
*Overload 1:* Collect all solutions of the search. | *Overload 2:* Collect all solutions of the search. The variables will need to be added later.
Definition at line 1462 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Assignment | ( | self, | |
* | args ) |
*Overload 1:* This method creates an empty assignment. | *Overload 2:* This method creates an assignment which is a copy of 'a'.
Definition at line 1405 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AssignVariablesValues | ( | self, | |
vars, | |||
values ) |
Definition at line 1650 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AssignVariableValue | ( | self, | |
var, | |||
val ) |
Decisions.
Definition at line 1634 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.AssignVariableValueOrFail | ( | self, | |
var, | |||
value ) |
Definition at line 1647 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.BestValueSolutionCollector | ( | self, | |
* | args ) |
*Overload 1:* 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). | *Overload 2:* Collect the solution corresponding to the optimal value of the objective of the internal assignment; if this assignment does not have an objective no solution is collected. This collector only collects one solution corresponding to the best objective value (the first one found). The variables and objective(s) will need to be added later.
Definition at line 1443 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.BetweenCt | ( | self, | |
expr, | |||
l, | |||
u ) |
(l <= expr <= u)
Definition at line 905 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.BoolVar | ( | self, | |
* | args ) |
*Overload 1:* MakeBoolVar will create a variable with a {0, 1} domain. | *Overload 2:* MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 596 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Branches | ( | self | ) |
The number of branches explored since the creation of the solver.
Definition at line 537 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.BranchesLimit | ( | self, | |
branches ) |
Creates a search limit that constrains the number of branches explored in the search tree.
Definition at line 1568 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.CheckAssignment | ( | self, | |
solution ) |
Checks whether the given assignment satisfies all relevant constraints.
Definition at line 509 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.CheckConstraint | ( | self, | |
ct ) |
Checks whether adding this constraint will lead to an immediate failure. It will return false if the model is already inconsistent, or if adding the constraint makes it inconsistent.
Definition at line 513 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Circuit | ( | self, | |
nexts ) |
Force the "nexts" variable to create a complete Hamiltonian path.
Definition at line 1098 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ClosureDemon | ( | self, | |
closure ) |
Creates a demon from a closure.
Definition at line 901 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Compose | ( | self, | |
dbs ) |
Definition at line 1659 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConcatenateOperators | ( | self, | |
* | args ) |
Definition at line 1766 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConditionalExpression | ( | self, | |
condition, | |||
expr, | |||
unperformed_value ) |
Conditional Expr condition ? expr : unperformed_value
Definition at line 738 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConstantRestart | ( | self, | |
frequency ) |
This search monitor will restart the search periodically after 'frequency' failures.
Definition at line 1558 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConstraintAdder | ( | self, | |
ct ) |
Returns a decision builder that will add the given constraint to the model.
Definition at line 1712 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConstraintInitialPropagateCallback | ( | self, | |
ct ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 886 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Constraints | ( | self | ) |
Counts the number of constraints that have been added to the solver before the search.
Definition at line 1845 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ConvexPiecewiseExpr | ( | self, | |
expr, | |||
early_cost, | |||
early_date, | |||
late_date, | |||
late_cost ) |
Convex piecewise function.
Definition at line 727 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Count | ( | self, | |
* | args ) |
*Overload 1:* |{i | vars[i] == value}| == max_count | *Overload 2:* |{i | vars[i] == value}| == max_count
Definition at line 942 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Cover | ( | self, | |
vars, | |||
target_var ) |
This constraint states that the target_var is the convex hull of the intervals. If none of the interval variables is performed, then the target var is unperformed too. Also, if the target variable is unperformed, then all the intervals variables are unperformed too.
Definition at line 1395 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Cumulative | ( | self, | |
* | args ) |
*Overload 1:* 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. | *Overload 2:* 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. | *Overload 3:* 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. | *Overload 4:* 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. | *Overload 5:* 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. | *Overload 6:* 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 1319 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.CustomLimit | ( | self, | |
limiter ) |
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 1609 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Decision | ( | self, | |
apply, | |||
refute ) |
Definition at line 1656 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.DecisionBuilderFromAssignment | ( | self, | |
assignment, | |||
db, | |||
vars ) |
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 1705 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.DefaultPhase | ( | self, | |
* | args ) |
Definition at line 1665 of file pywrapcp.py.
|
static |
Create a ConstraintSolverParameters proto with all the default values.
Definition at line 449 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.DelayedConstraintInitialPropagateCallback | ( | self, | |
ct ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority.
Definition at line 893 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.DelayedPathCumul | ( | self, | |
nexts, | |||
active, | |||
cumuls, | |||
transits ) |
Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated.
Definition at line 1109 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Deviation | ( | self, | |
vars, | |||
deviation_var, | |||
total_sum ) |
Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = #vars
Definition at line 1005 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.DisjunctiveConstraint | ( | self, | |
intervals, | |||
name ) |
This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero duration can be scheduled anywhere.
Definition at line 1312 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Distribute | ( | self, | |
* | args ) |
*Overload 1:* Aggregated version of count: |{i | v[i] == values[j]}| == cards[j] | *Overload 2:* Aggregated version of count: |{i | v[i] == values[j]}| == cards[j] | *Overload 3:* Aggregated version of count: |{i | v[i] == j}| == cards[j] | *Overload 4:* Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min <= |{i | v[i] == j}| <= card_max | *Overload 5:* Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j] | *Overload 6:* Aggregated version of count with bounded cardinalities: forall j in 0 .. card_size - 1: card_min[j] <= |{i | v[i] == j}| <= card_max[j] | *Overload 7:* 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] | *Overload 8:* 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 954 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Element | ( | self, | |
* | args ) |
*Overload 1:* values[index] | *Overload 2:* values[index] | *Overload 3:* 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). | *Overload 4:* 2D version of function-based element expression, values(expr1, expr2). | *Overload 5:* vars[expr]
Definition at line 647 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ElementEquality | ( | self, | |
* | args ) |
Definition at line 870 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ElementFunction | ( | self, | |
values, | |||
index ) |
Definition at line 1885 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.EndSearch | ( | self | ) |
Definition at line 503 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.EvalEvalStrPhase | ( | self, | |
vars, | |||
evaluator, | |||
str ) |
Definition at line 1903 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.EvalEvalStrTieBreakPhase | ( | self, | |
vars, | |||
evaluator, | |||
tie_breaker, | |||
str ) |
Definition at line 1906 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Fail | ( | self | ) |
Abandon the current branch in the search tree. A backtrack will follow.
Definition at line 521 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FailDecision | ( | self | ) |
Definition at line 1653 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FailStamp | ( | self | ) |
The fail_stamp() is incremented after each backtrack.
Definition at line 560 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Failures | ( | self | ) |
The number of failures encountered since the creation of the solver.
Definition at line 545 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FailuresLimit | ( | self, | |
failures ) |
Creates a search limit that constrains the number of failures that can happen when exploring the search tree.
Definition at line 1575 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FalseConstraint | ( | self, | |
* | args ) |
Definition at line 746 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FinishCurrentSearch | ( | self | ) |
Tells the solver to kill or restart the current search.
Definition at line 1856 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FirstSolutionCollector | ( | self, | |
* | args ) |
*Overload 1:* Collect the first solution of the search. | *Overload 2:* Collect the first solution of the search. The variables will need to be added later.
Definition at line 1417 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedDurationEndSyncedOnEndIntervalVar | ( | self, | |
interval_var, | |||
duration, | |||
offset ) |
Creates an interval var with a fixed duration whose end is synchronized with the end of another interval, with a given offset. The performed status is also in sync with the performed status of the given interval variable.
Definition at line 1244 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedDurationEndSyncedOnStartIntervalVar | ( | self, | |
interval_var, | |||
duration, | |||
offset ) |
Creates an interval var with a fixed duration whose end is synchronized with the start of another interval, with a given offset. The performed status is also in sync with the performed status of the given interval variable.
Definition at line 1235 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedDurationIntervalVar | ( | self, | |
* | args ) |
*Overload 1:* 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. | *Overload 2:* Creates a performed interval var with a fixed duration. The duration must be greater than 0. | *Overload 3:* Creates an interval var with a fixed duration, and performed_variable. The duration must be greater than 0.
Definition at line 1177 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedDurationStartSyncedOnEndIntervalVar | ( | self, | |
interval_var, | |||
duration, | |||
offset ) |
Creates an interval var with a fixed duration whose start is synchronized with the end of another interval, with a given offset. The performed status is also in sync with the performed status of the given interval variable.
Definition at line 1226 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedDurationStartSyncedOnStartIntervalVar | ( | self, | |
interval_var, | |||
duration, | |||
offset ) |
Creates an interval var with a fixed duration whose start is synchronized with the start of another interval, with a given offset. The performed status is also in sync with the performed status of the given interval variable.
Definition at line 1217 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.FixedInterval | ( | self, | |
start, | |||
duration, | |||
name ) |
Creates a fixed and performed interval.
Definition at line 1199 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.GuidedLocalSearch | ( | self, | |
* | args ) |
Definition at line 1909 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IndexExpression | ( | self, | |
vars, | |||
value ) |
Returns the expression expr such that vars[expr] == value. It assumes that vars are all different.
Definition at line 676 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IndexOfConstraint | ( | self, | |
vars, | |||
index, | |||
target ) |
This constraint is a special case of the element constraint with an array of integer variables, where the variables are all different and the index variable is constrained such that vars[index] == target.
Definition at line 877 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IntConst | ( | self, | |
* | args ) |
*Overload 1:* IntConst will create a constant expression. | *Overload 2:* IntConst will create a constant expression.
Definition at line 608 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IntervalRelaxedMax | ( | self, | |
interval_var ) |
Creates and returns an interval variable that wraps around the given one, relaxing the max start and end. Relaxing means making unbounded when optional. If the variable is non optional, this method returns interval_var. More precisely, such an interval variable behaves as follows: 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 1275 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IntervalRelaxedMin | ( | self, | |
interval_var ) |
Creates and returns an interval variable that wraps around the given one, relaxing the min start and end. Relaxing means making unbounded when optional. If the variable is non-optional, this method returns interval_var. More precisely, such an interval variable behaves as follows: 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 1253 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IntervalVar | ( | self, | |
start_min, | |||
start_max, | |||
duration_min, | |||
duration_max, | |||
end_min, | |||
end_max, | |||
optional, | |||
name ) |
Creates an interval var by specifying the bounds on start, duration, and end.
Definition at line 1203 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IntVar | ( | self, | |
* | args ) |
*Overload 1:* MakeIntVar will create the best range based int var for the bounds given. | *Overload 2:* MakeIntVar will create a variable with the given sparse domain. | *Overload 3:* MakeIntVar will create a variable with the given sparse domain. | *Overload 4:* MakeIntVar will create the best range based int var for the bounds given. | *Overload 5:* MakeIntVar will create a variable with the given sparse domain. | *Overload 6:* MakeIntVar will create a variable with the given sparse domain.
Definition at line 564 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.InversePermutationConstraint | ( | self, | |
left, | |||
right ) |
Creates a constraint that enforces that 'left' and 'right' both represent permutations of [0..left.size()-1], and that 'right' is the inverse permutation of 'left', i.e. for all i in [0..left.size()-1], right[left[i]] = i.
Definition at line 1070 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsBetweenCt | ( | self, | |
expr, | |||
l, | |||
u, | |||
b ) |
b == (l <= expr <= u)
Definition at line 909 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsBetweenVar | ( | self, | |
v, | |||
l, | |||
u ) |
Definition at line 913 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsDifferentCstCt | ( | self, | |
var, | |||
value, | |||
boolvar ) |
boolvar == (var != value)
Definition at line 765 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsDifferentCstVar | ( | self, | |
var, | |||
value ) |
status var of (var != value)
Definition at line 769 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsDifferentCt | ( | self, | |
v1, | |||
v2, | |||
b ) |
b == (v1 != v2)
Definition at line 777 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsDifferentVar | ( | self, | |
v1, | |||
v2 ) |
status var of (v1 != v2)
Definition at line 773 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsEqualCstCt | ( | self, | |
var, | |||
value, | |||
boolvar ) |
boolvar == (var == value)
Definition at line 749 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsEqualCstVar | ( | self, | |
var, | |||
value ) |
status var of (var == value)
Definition at line 753 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsEqualCt | ( | self, | |
v1, | |||
v2, | |||
b ) |
b == (v1 == v2)
Definition at line 757 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsEqualVar | ( | self, | |
v1, | |||
v2 ) |
status var of (v1 == v2)
Definition at line 761 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterCstCt | ( | self, | |
v, | |||
c, | |||
b ) |
b == (v > c)
Definition at line 813 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterCstVar | ( | self, | |
var, | |||
value ) |
status var of (var > value)
Definition at line 817 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterCt | ( | self, | |
left, | |||
right, | |||
b ) |
b == (left > right)
Definition at line 825 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterOrEqualCstCt | ( | self, | |
var, | |||
value, | |||
boolvar ) |
boolvar == (var >= value)
Definition at line 797 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterOrEqualCstVar | ( | self, | |
var, | |||
value ) |
status var of (var >= value)
Definition at line 801 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterOrEqualCt | ( | self, | |
left, | |||
right, | |||
b ) |
b == (left >= right)
Definition at line 809 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterOrEqualVar | ( | self, | |
left, | |||
right ) |
status var of (left >= right)
Definition at line 805 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsGreaterVar | ( | self, | |
left, | |||
right ) |
status var of (left > right)
Definition at line 821 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessCstCt | ( | self, | |
v, | |||
c, | |||
b ) |
b == (v < c)
Definition at line 829 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessCstVar | ( | self, | |
var, | |||
value ) |
status var of (var < value)
Definition at line 833 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessCt | ( | self, | |
left, | |||
right, | |||
b ) |
b == (left < right)
Definition at line 841 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessOrEqualCstCt | ( | self, | |
var, | |||
value, | |||
boolvar ) |
boolvar == (var <= value)
Definition at line 781 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessOrEqualCstVar | ( | self, | |
var, | |||
value ) |
status var of (var <= value)
Definition at line 785 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessOrEqualCt | ( | self, | |
left, | |||
right, | |||
b ) |
b == (left <= right)
Definition at line 793 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessOrEqualVar | ( | self, | |
left, | |||
right ) |
status var of (left <= right)
Definition at line 789 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsLessVar | ( | self, | |
left, | |||
right ) |
status var of (left < right)
Definition at line 837 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsMemberCt | ( | self, | |
* | args ) |
Definition at line 936 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.IsMemberVar | ( | self, | |
* | args ) |
Definition at line 939 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LastSolutionCollector | ( | self, | |
* | args ) |
*Overload 1:* Collect the last solution of the search. | *Overload 2:* Collect the last solution of the search. The variables will need to be added later.
Definition at line 1430 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LexicalLess | ( | self, | |
left, | |||
right ) |
Creates a constraint that enforces that left is lexicographically less than right.
Definition at line 1056 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LexicalLessOrEqual | ( | self, | |
left, | |||
right ) |
Creates a constraint that enforces that left is lexicographically less than or equal to right.
Definition at line 1063 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Limit | ( | self, | |
* | args ) |
*Overload 1:* Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits. 'smart_time_check' reduces the calls to the wall | *Overload 2:* Creates a search limit from its protobuf description | *Overload 3:* 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 1589 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LocalSearchPhase | ( | self, | |
* | args ) |
Definition at line 1794 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LocalSearchPhaseParameters | ( | self, | |
* | args ) |
Definition at line 1797 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LocalSearchProfile | ( | self | ) |
Returns local search profiling information in a human readable format.
Definition at line 1841 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.LubyRestart | ( | self, | |
scale_factor ) |
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 1550 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Max | ( | self, | |
* | args ) |
*Overload 1:* std::max(vars) | *Overload 2:* std::max(left, right) | *Overload 3:* std::max(expr, value) | *Overload 4:* std::max(expr, value)
Definition at line 705 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MaxEquality | ( | self, | |
vars, | |||
max_var ) |
Definition at line 867 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Maximize | ( | self, | |
v, | |||
step ) |
Creates a maximization objective.
Definition at line 1479 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MemberCt | ( | self, | |
* | args ) |
Definition at line 916 of file pywrapcp.py.
|
static |
Current memory usage in bytes
Definition at line 526 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Min | ( | self, | |
* | args ) |
*Overload 1:* std::min(vars) | *Overload 2:* std::min (left, right) | *Overload 3:* std::min(expr, value) | *Overload 4:* std::min(expr, value)
Definition at line 683 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MinEquality | ( | self, | |
vars, | |||
min_var ) |
Definition at line 864 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Minimize | ( | self, | |
v, | |||
step ) |
Creates a minimization objective.
Definition at line 1475 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MirrorInterval | ( | self, | |
interval_var ) |
Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis.
Definition at line 1210 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MonotonicElement | ( | self, | |
values, | |||
increasing, | |||
index ) |
Function based element. The constraint takes ownership of the callback. The callback must be monotonic. It must be able to cope with any possible value in the domain of 'index' (potentially negative ones too). Furtermore, monotonicity is not checked. Thus giving a non-monotonic function, or specifying an incorrect increasing parameter will result in undefined behavior.
Definition at line 636 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.MoveTowardTargetOperator | ( | self, | |
* | args ) |
*Overload 1:* 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. | *Overload 2:* 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 1745 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NeighborhoodLimit | ( | self, | |
op, | |||
limit ) |
Creates a local search operator that wraps another local search operator and limits the number of neighbors explored (i.e., calls to MakeNextNeighbor from the current solution (between two calls to Start()). When this limit is reached, MakeNextNeighbor() returns false. The counter is cleared when Start() is called.
Definition at line 1784 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NestedOptimize | ( | self, | |
* | args ) |
Definition at line 1722 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NewSearch | ( | self, | |
* | args ) |
Definition at line 494 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NextSolution | ( | self | ) |
Definition at line 497 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NonOverlappingBoxesConstraint | ( | self, | |
* | args ) |
Definition at line 1164 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NotMemberCt | ( | self, | |
* | args ) |
*Overload 1:* expr not in set. | *Overload 2:* expr should not be in the list of forbidden intervals [start[i]..end[i]]. | *Overload 3:* expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 919 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NullIntersect | ( | self, | |
first_vars, | |||
second_vars ) |
Creates a constraint that states that all variables in the first vector are different from all variables in the second group. Thus the set of values in the first vector does not intersect with the set of values in the second vector.
Definition at line 1079 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.NullIntersectExcept | ( | self, | |
first_vars, | |||
second_vars, | |||
escape_value ) |
Creates a constraint that states that all variables in the first vector are different from all variables from the second group, unless they are assigned to the escape value. Thus the set of values in the first vector minus the escape value does not intersect with the set of values in the second vector.
Definition at line 1088 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Operator | ( | self, | |
* | args ) |
Definition at line 1739 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Optimize | ( | self, | |
maximize, | |||
v, | |||
step ) |
Creates a objective with a given sense (true = maximization).
Definition at line 1483 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Pack | ( | self, | |
vars, | |||
number_of_bins ) |
This constraint packs all variables onto 'number_of_bins' variables. For any given variable, a value of 'number_of_bins' indicates that the variable is not assigned to any bin. Dimensions, i.e., cumulative constraints on this packing, can be added directly from the pack class.
Definition at line 1167 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Parameters | ( | self | ) |
Stored Parameters.
Definition at line 444 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.PathCumul | ( | self, | |
* | args ) |
*Overload 1:* 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. | *Overload 2:* 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. | *Overload 3:* 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 1116 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Phase | ( | self, | |
* | args ) |
Definition at line 1702 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.PrintModelVisitor | ( | self | ) |
Prints the model.
Definition at line 1626 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Rand32 | ( | self, | |
size ) |
Returns a random value between 0 and 'size' - 1;
Definition at line 1833 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Rand64 | ( | self, | |
size ) |
Returns a random value between 0 and 'size' - 1;
Definition at line 1829 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RandomConcatenateOperators | ( | self, | |
* | args ) |
*Overload 1:* Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). | *Overload 2:* Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). The provided seed is used to initialize the random number generator.
Definition at line 1769 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RandomLnsOperator | ( | self, | |
* | args ) |
Definition at line 1742 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RankFirstInterval | ( | self, | |
sequence, | |||
index ) |
Returns a decision that tries to rank first the ith interval var in the sequence variable.
Definition at line 1688 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RankLastInterval | ( | self, | |
sequence, | |||
index ) |
Returns a decision that tries to rank last the ith interval var in the sequence variable.
Definition at line 1695 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ReSeed | ( | self, | |
seed ) |
Reseed the solver random generator.
Definition at line 1837 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RestartCurrentSearch | ( | self | ) |
Definition at line 1860 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RestartSearch | ( | self | ) |
Definition at line 500 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.RestoreAssignment | ( | self, | |
assignment ) |
Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore())
Definition at line 1725 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScalProd | ( | self, | |
* | args ) |
*Overload 1:* scalar product | *Overload 2:* scalar product
Definition at line 624 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScalProdEquality | ( | self, | |
* | args ) |
Definition at line 855 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScalProdGreaterOrEqual | ( | self, | |
* | args ) |
Definition at line 858 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScalProdLessOrEqual | ( | self, | |
* | args ) |
Definition at line 861 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScheduleOrExpedite | ( | self, | |
var, | |||
est, | |||
marker ) |
Returns a decision that tries to schedule a task at a given time. On the Apply branch, it will set that interval var as performed and set its end to 'est'. On the Refute branch, it will just update the 'marker' to 'est' - 1. This decision is used in the INTERVAL_SET_TIMES_BACKWARD strategy.
Definition at line 1678 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ScheduleOrPostpone | ( | self, | |
var, | |||
est, | |||
marker ) |
Returns a decision that tries to schedule a task at a given time. On the Apply branch, it will set that interval var as performed and set its start to 'est'. On the Refute branch, it will just update the 'marker' to 'est' + 1. This decision is used in the INTERVAL_SET_TIMES_FORWARD strategy.
Definition at line 1668 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SearchDepth | ( | self | ) |
Gets the search depth of the current active search. Returns -1 if there is no active search opened.
Definition at line 1808 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SearchLeftDepth | ( | self | ) |
Gets the search left depth of the current active search. Returns -1 if there is no active search opened.
Definition at line 1815 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SearchLog | ( | self, | |
* | args ) |
Definition at line 1616 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SearchLogWithCallback | ( | self, | |
period, | |||
callback ) |
Definition at line 1882 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SearchTrace | ( | self, | |
prefix ) |
Creates a search monitor that will trace precisely the behavior of the search. Use this only for low level debugging.
Definition at line 1619 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SemiContinuousExpr | ( | self, | |
expr, | |||
fixed_charge, | |||
step ) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0
Definition at line 731 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.ShouldFail | ( | self | ) |
These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail.
Definition at line 1863 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SimulatedAnnealing | ( | self, | |
maximize, | |||
v, | |||
step, | |||
initial_temperature ) |
Creates a Simulated Annealing monitor.
Definition at line 1546 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Solutions | ( | self | ) |
The number of solutions found since the start of the search.
Definition at line 541 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SolutionsLimit | ( | self, | |
solutions ) |
Creates a search limit that constrains the number of solutions found during the search.
Definition at line 1582 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Solve | ( | self, | |
* | args ) |
Definition at line 491 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SolveAndCommit | ( | self, | |
* | args ) |
Definition at line 506 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SolveDepth | ( | self | ) |
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 1822 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SolveOnce | ( | self, | |
db, | |||
monitors ) |
Definition at line 1719 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SortingConstraint | ( | self, | |
vars, | |||
sorted ) |
Creates a constraint binding the arrays of variables "vars" and "sorted_vars": sorted_vars[0] must be equal to the minimum of all variables in vars, and so on: the value of sorted_vars[i] must be equal to the i-th value of variables invars. This constraint propagates in both directions: from "vars" to "sorted_vars" and vice-versa. Behind the scenes, this constraint maintains that: - sorted is always increasing. - whatever the values of vars, there exists a permutation that injects its values into the sorted variables. For more info, please have a look at: https://mpi-inf.mpg.de/~mehlhorn/ftp/Mehlhorn-Thiel.pdf
Definition at line 1036 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SplitVariableDomain | ( | self, | |
var, | |||
val, | |||
start_with_lower_half ) |
Definition at line 1644 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Stamp | ( | self | ) |
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 553 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.StatisticsModelVisitor | ( | self | ) |
Displays some nice statistics on the model.
Definition at line 1630 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.StoreAssignment | ( | self, | |
assignment ) |
Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store())
Definition at line 1732 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SubCircuit | ( | self, | |
nexts ) |
Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves.
Definition at line 1102 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Sum | ( | self, | |
vars ) |
sum of all vars.
Definition at line 620 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SumEquality | ( | self, | |
* | args ) |
Definition at line 852 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SumGreaterOrEqual | ( | self, | |
vars, | |||
cst ) |
Definition at line 849 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SumLessOrEqual | ( | self, | |
vars, | |||
cst ) |
Variation on arrays.
Definition at line 845 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.SumObjectiveFilter | ( | self, | |
vars, | |||
values, | |||
filter_enum ) |
Definition at line 1912 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TabuSearch | ( | self, | |
maximize, | |||
objective, | |||
step, | |||
vars, | |||
keep_tenure, | |||
forbid_tenure, | |||
tabu_factor ) |
MetaHeuristics which try to get the search out of local optima. Creates a Tabu Search monitor. In the context of local search the behavior is similar to MakeOptimize(), creating an objective in a given sense. The behavior differs once a local optimum is reached: thereafter solutions which degrade the value of the objective are allowed if they are not "tabu". A solution is "tabu" if it doesn't respect the following rules: - improving the best solution found so far - variables in the "keep" list must keep their value, variables in the "forbid" list must not take the value they have in the list. Variables with new values enter the tabu lists after each new solution found and leave the lists after a given number of iterations (called tenure). Only the variables passed to the method can enter the lists. The tabu criterion is softened by the tabu factor which gives the number of "tabu" violations which is tolerated; a factor of 1 means no violations allowed; a factor of 0 means all violations are allowed.
Definition at line 1525 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TemporalDisjunction | ( | self, | |
* | args ) |
*Overload 1:* 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). | *Overload 2:* This constraint implements a temporal disjunction between two interval vars.
Definition at line 1297 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TimeLimit | ( | self, | |
* | args ) |
Definition at line 1565 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TopProgressPercent | ( | self | ) |
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 1800 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TransitionConstraint | ( | self, | |
* | args ) |
Definition at line 1161 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TreeNoCycle | ( | self, | |
nexts, | |||
active, | |||
callback = 0 ) |
Definition at line 1879 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.TrueConstraint | ( | self | ) |
This constraint always succeeds.
Definition at line 742 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.Try | ( | self, | |
dbs ) |
Definition at line 1662 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VarEvalValEvalPhase | ( | self, | |
vars, | |||
var_eval, | |||
val_eval ) |
Definition at line 1894 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VarEvalValEvalTieBreakPhase | ( | self, | |
vars, | |||
var_eval, | |||
val_eval, | |||
tie_breaker ) |
Definition at line 1900 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VarEvalValStrPhase | ( | self, | |
vars, | |||
var_evaluator, | |||
val_str ) |
Definition at line 1888 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VariableGreaterOrEqualValue | ( | self, | |
var, | |||
value ) |
Definition at line 1641 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VariableLessOrEqualValue | ( | self, | |
var, | |||
value ) |
Definition at line 1638 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VarStrValEvalPhase | ( | self, | |
vars, | |||
var_str, | |||
val_eval ) |
Definition at line 1891 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.VarStrValEvalTieBreakPhase | ( | self, | |
vars, | |||
var_str, | |||
val_eval, | |||
tie_breaker ) |
Definition at line 1897 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.WallTime | ( | self | ) |
DEPRECATED: Use Now() instead. Time elapsed, in ms since the creation of the solver.
Definition at line 530 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.WeightedMaximize | ( | self, | |
* | args ) |
*Overload 1:* Creates a maximization weigthed objective. | *Overload 2:* Creates a maximization weigthed objective.
Definition at line 1501 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.WeightedMinimize | ( | self, | |
* | args ) |
*Overload 1:* Creates a minimization weighted objective. The actual objective is scalar_prod(sub_objectives, weights). | *Overload 2:* Creates a minimization weighted objective. The actual objective is scalar_prod(sub_objectives, weights).
Definition at line 1487 of file pywrapcp.py.
ortools.constraint_solver.pywrapcp.Solver.WeightedOptimize | ( | self, | |
* | args ) |
*Overload 1:* Creates a weighted objective with a given sense (true = maximization). | *Overload 2:* Creates a weighted objective with a given sense (true = maximization).
Definition at line 1513 of file pywrapcp.py.
|
static |
Definition at line 234 of file pywrapcp.py.
|
static |
Definition at line 230 of file pywrapcp.py.
|
static |
Definition at line 228 of file pywrapcp.py.
|
static |
Definition at line 232 of file pywrapcp.py.
|
static |
Definition at line 144 of file pywrapcp.py.
|
static |
Definition at line 195 of file pywrapcp.py.
|
static |
Definition at line 188 of file pywrapcp.py.
|
static |
Definition at line 214 of file pywrapcp.py.
|
static |
Definition at line 208 of file pywrapcp.py.
|
static |
Definition at line 202 of file pywrapcp.py.
|
static |
Definition at line 179 of file pywrapcp.py.
|
static |
Definition at line 161 of file pywrapcp.py.
|
static |
Definition at line 170 of file pywrapcp.py.
|
static |
Definition at line 152 of file pywrapcp.py.
|
static |
Definition at line 252 of file pywrapcp.py.
|
static |
Definition at line 219 of file pywrapcp.py.
|
static |
Definition at line 150 of file pywrapcp.py.
|
static |
Definition at line 253 of file pywrapcp.py.
|
static |
Definition at line 309 of file pywrapcp.py.
|
static |
Definition at line 400 of file pywrapcp.py.
|
static |
Definition at line 425 of file pywrapcp.py.
|
static |
Definition at line 420 of file pywrapcp.py.
|
static |
Definition at line 299 of file pywrapcp.py.
|
static |
Definition at line 355 of file pywrapcp.py.
|
static |
Definition at line 378 of file pywrapcp.py.
|
static |
Definition at line 416 of file pywrapcp.py.
|
static |
Definition at line 389 of file pywrapcp.py.
|
static |
Definition at line 224 of file pywrapcp.py.
|
static |
Definition at line 226 of file pywrapcp.py.
|
static |
Definition at line 140 of file pywrapcp.py.
|
static |
Definition at line 142 of file pywrapcp.py.
|
static |
Definition at line 254 of file pywrapcp.py.
|
static |
Definition at line 263 of file pywrapcp.py.
|
static |
Definition at line 258 of file pywrapcp.py.
|
static |
Definition at line 256 of file pywrapcp.py.
|
static |
Definition at line 418 of file pywrapcp.py.
|
static |
Definition at line 321 of file pywrapcp.py.
|
static |
Definition at line 338 of file pywrapcp.py.
|
static |
Definition at line 330 of file pywrapcp.py.
|
static |
Definition at line 432 of file pywrapcp.py.
|
static |
Definition at line 280 of file pywrapcp.py.
|
static |
Definition at line 368 of file pywrapcp.py.
|
static |
Definition at line 297 of file pywrapcp.py.
|
static |
Definition at line 250 of file pywrapcp.py.
|
static |
Definition at line 251 of file pywrapcp.py.
|
static |
Definition at line 406 of file pywrapcp.py.
|
static |
Definition at line 240 of file pywrapcp.py.
|
static |
Definition at line 245 of file pywrapcp.py.
|
static |
Definition at line 347 of file pywrapcp.py.
|
static |
Definition at line 268 of file pywrapcp.py.
|
static |
Definition at line 383 of file pywrapcp.py.
|
static |
Definition at line 430 of file pywrapcp.py.
|
static |
Definition at line 138 of file pywrapcp.py.