Python Reference: Routing

Module pywrapcp

Expand source code
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _pywrapcp
else:
    import _pywrapcp

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "thisown":
            self.this.own(value)
        elif name == "this":
            set(self, name, value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import weakref

class DefaultPhaseParameters(object):
    r""" This struct holds all parameters for the default search. DefaultPhaseParameters is only used by Solver::MakeDefaultPhase methods. Note this is for advanced users only."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    CHOOSE_MAX_SUM_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_SUM_IMPACT
    CHOOSE_MAX_AVERAGE_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_AVERAGE_IMPACT
    CHOOSE_MAX_VALUE_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_VALUE_IMPACT
    SELECT_MIN_IMPACT = _pywrapcp.DefaultPhaseParameters_SELECT_MIN_IMPACT
    SELECT_MAX_IMPACT = _pywrapcp.DefaultPhaseParameters_SELECT_MAX_IMPACT
    NONE = _pywrapcp.DefaultPhaseParameters_NONE
    NORMAL = _pywrapcp.DefaultPhaseParameters_NORMAL
    VERBOSE = _pywrapcp.DefaultPhaseParameters_VERBOSE
    var_selection_schema = property(_pywrapcp.DefaultPhaseParameters_var_selection_schema_get, _pywrapcp.DefaultPhaseParameters_var_selection_schema_set, doc=r""" This parameter describes how the next variable to instantiate will be chosen.""")
    value_selection_schema = property(_pywrapcp.DefaultPhaseParameters_value_selection_schema_get, _pywrapcp.DefaultPhaseParameters_value_selection_schema_set, doc=r""" This parameter describes which value to select for a given var.""")
    initialization_splits = property(_pywrapcp.DefaultPhaseParameters_initialization_splits_get, _pywrapcp.DefaultPhaseParameters_initialization_splits_set, doc=r""" Maximum number of intervals that the initialization of impacts will scan per variable.""")
    run_all_heuristics = property(_pywrapcp.DefaultPhaseParameters_run_all_heuristics_get, _pywrapcp.DefaultPhaseParameters_run_all_heuristics_set, doc=r""" The default phase will run heuristics periodically. This parameter indicates if we should run all heuristics, or a randomly selected one.""")
    heuristic_period = property(_pywrapcp.DefaultPhaseParameters_heuristic_period_get, _pywrapcp.DefaultPhaseParameters_heuristic_period_set, doc=r""" The distance in nodes between each run of the heuristics. A negative or null value will mean that we will not run heuristics at all.""")
    heuristic_num_failures_limit = property(_pywrapcp.DefaultPhaseParameters_heuristic_num_failures_limit_get, _pywrapcp.DefaultPhaseParameters_heuristic_num_failures_limit_set, doc=r""" The failure limit for each heuristic that we run.""")
    persistent_impact = property(_pywrapcp.DefaultPhaseParameters_persistent_impact_get, _pywrapcp.DefaultPhaseParameters_persistent_impact_set, doc=r""" Whether to keep the impact from the first search for other searches, or to recompute the impact for each new search.""")
    random_seed = property(_pywrapcp.DefaultPhaseParameters_random_seed_get, _pywrapcp.DefaultPhaseParameters_random_seed_set, doc=r""" Seed used to initialize the random part in some heuristics.""")
    display_level = property(_pywrapcp.DefaultPhaseParameters_display_level_get, _pywrapcp.DefaultPhaseParameters_display_level_set, doc=r""" This represents the amount of information displayed by the default search. NONE means no display, VERBOSE means extra information.""")
    decision_builder = property(_pywrapcp.DefaultPhaseParameters_decision_builder_get, _pywrapcp.DefaultPhaseParameters_decision_builder_set, doc=r""" When defined, this overrides the default impact based decision builder.""")

    def __init__(self):
        _pywrapcp.DefaultPhaseParameters_swiginit(self, _pywrapcp.new_DefaultPhaseParameters())
    __swig_destroy__ = _pywrapcp.delete_DefaultPhaseParameters

# Register DefaultPhaseParameters in _pywrapcp:
_pywrapcp.DefaultPhaseParameters_swigregister(DefaultPhaseParameters)

class Solver(object):
    r""" 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."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    INT_VAR_DEFAULT = _pywrapcp.Solver_INT_VAR_DEFAULT
    r""" The default behavior is CHOOSE_FIRST_UNBOUND."""
    INT_VAR_SIMPLE = _pywrapcp.Solver_INT_VAR_SIMPLE
    r""" The simple selection is CHOOSE_FIRST_UNBOUND."""
    CHOOSE_FIRST_UNBOUND = _pywrapcp.Solver_CHOOSE_FIRST_UNBOUND
    r""" Select the first unbound variable. Variables are considered in the order of the vector of IntVars used to create the selector."""
    CHOOSE_RANDOM = _pywrapcp.Solver_CHOOSE_RANDOM
    r""" Randomly select one of the remaining unbound variables."""
    CHOOSE_MIN_SIZE_LOWEST_MIN = _pywrapcp.Solver_CHOOSE_MIN_SIZE_LOWEST_MIN
    r""" 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."""
    CHOOSE_MIN_SIZE_HIGHEST_MIN = _pywrapcp.Solver_CHOOSE_MIN_SIZE_HIGHEST_MIN
    r""" 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."""
    CHOOSE_MIN_SIZE_LOWEST_MAX = _pywrapcp.Solver_CHOOSE_MIN_SIZE_LOWEST_MAX
    r""" 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."""
    CHOOSE_MIN_SIZE_HIGHEST_MAX = _pywrapcp.Solver_CHOOSE_MIN_SIZE_HIGHEST_MAX
    r""" 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."""
    CHOOSE_LOWEST_MIN = _pywrapcp.Solver_CHOOSE_LOWEST_MIN
    r""" 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."""
    CHOOSE_HIGHEST_MAX = _pywrapcp.Solver_CHOOSE_HIGHEST_MAX
    r""" 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."""
    CHOOSE_MIN_SIZE = _pywrapcp.Solver_CHOOSE_MIN_SIZE
    r""" 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."""
    CHOOSE_MAX_SIZE = _pywrapcp.Solver_CHOOSE_MAX_SIZE
    r""" 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."""
    CHOOSE_MAX_REGRET_ON_MIN = _pywrapcp.Solver_CHOOSE_MAX_REGRET_ON_MIN
    r""" Among unbound variables, select the variable with the largest gap between the first and the second values of the domain."""
    CHOOSE_PATH = _pywrapcp.Solver_CHOOSE_PATH
    r""" 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."""
    INT_VALUE_DEFAULT = _pywrapcp.Solver_INT_VALUE_DEFAULT
    r""" The default behavior is ASSIGN_MIN_VALUE."""
    INT_VALUE_SIMPLE = _pywrapcp.Solver_INT_VALUE_SIMPLE
    r""" The simple selection is ASSIGN_MIN_VALUE."""
    ASSIGN_MIN_VALUE = _pywrapcp.Solver_ASSIGN_MIN_VALUE
    r""" Selects the min value of the selected variable."""
    ASSIGN_MAX_VALUE = _pywrapcp.Solver_ASSIGN_MAX_VALUE
    r""" Selects the max value of the selected variable."""
    ASSIGN_RANDOM_VALUE = _pywrapcp.Solver_ASSIGN_RANDOM_VALUE
    r""" Selects randomly one of the possible values of the selected variable."""
    ASSIGN_CENTER_VALUE = _pywrapcp.Solver_ASSIGN_CENTER_VALUE
    r""" 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."""
    SPLIT_LOWER_HALF = _pywrapcp.Solver_SPLIT_LOWER_HALF
    r""" Split the domain in two around the center, and choose the lower part first."""
    SPLIT_UPPER_HALF = _pywrapcp.Solver_SPLIT_UPPER_HALF
    r""" Split the domain in two around the center, and choose the lower part first."""
    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
    r""" The default is INTERVAL_SET_TIMES_FORWARD."""
    INTERVAL_SIMPLE = _pywrapcp.Solver_INTERVAL_SIMPLE
    r""" The simple is INTERVAL_SET_TIMES_FORWARD."""
    INTERVAL_SET_TIMES_FORWARD = _pywrapcp.Solver_INTERVAL_SET_TIMES_FORWARD
    r""" Selects the variable with the lowest starting time of all variables, and fixes its starting time to this lowest value."""
    INTERVAL_SET_TIMES_BACKWARD = _pywrapcp.Solver_INTERVAL_SET_TIMES_BACKWARD
    r""" Selects the variable with the highest ending time of all variables, and fixes the ending time to this highest values."""
    TWOOPT = _pywrapcp.Solver_TWOOPT
    r""" Operator which reverses a sub-chain of a path. It is called TwoOpt because it breaks two arcs on the path; resulting paths are called two-optimal. Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5 (where (1, 5) are first and last nodes of the path and can therefore not be moved):   1 -> [3 -> 2] -> 4  -> 5   1 -> [4 -> 3  -> 2] -> 5   1 ->  2 -> [4 -> 3] -> 5"""
    OROPT = _pywrapcp.Solver_OROPT
    r""" Relocate: OROPT and RELOCATE. Operator which moves a sub-chain of a path to another position; the specified chain length is the fixed length of the chains being moved. When this length is 1, the operator simply moves a node to another position. Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5, for a chain length of 2 (where (1, 5) are first and last nodes of the path and can therefore not be moved):   1 ->  4 -> [2 -> 3] -> 5   1 -> [3 -> 4] -> 2  -> 5 Using Relocate with chain lengths of 1, 2 and 3 together is equivalent to the OrOpt operator on a path. The OrOpt operator is a limited  version of 3Opt (breaks 3 arcs on a path)."""
    RELOCATE = _pywrapcp.Solver_RELOCATE
    r""" Relocate neighborhood with length of 1 (see OROPT comment)."""
    EXCHANGE = _pywrapcp.Solver_EXCHANGE
    r""" Operator which exchanges the positions of two nodes. Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5 (where (1, 5) are first and last nodes of the path and can therefore not be moved):   1 -> [3] -> [2] ->  4  -> 5   1 -> [4] ->  3  -> [2] -> 5   1 ->  2  -> [4] -> [3] -> 5"""
    CROSS = _pywrapcp.Solver_CROSS
    r""" Operator which cross exchanges the starting chains of 2 paths, including exchanging the whole paths. First and last nodes are not moved. Possible neighbors for the paths 1 -> 2 -> 3 -> 4 -> 5 and 6 -> 7 -> 8 (where (1, 5) and (6, 8) are first and last nodes of the paths and can therefore not be moved):   1 -> [7] -> 3 -> 4 -> 5  6 -> [2] -> 8   1 -> [7] -> 4 -> 5       6 -> [2 -> 3] -> 8   1 -> [7] -> 5            6 -> [2 -> 3 -> 4] -> 8"""
    MAKEACTIVE = _pywrapcp.Solver_MAKEACTIVE
    r""" Operator which inserts an inactive node into a path. Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 are first and last nodes of the path) are:   1 -> [5] ->  2  ->  3  -> 4   1 ->  2  -> [5] ->  3  -> 4   1 ->  2  ->  3  -> [5] -> 4"""
    MAKEINACTIVE = _pywrapcp.Solver_MAKEINACTIVE
    r""" Operator which makes path nodes inactive. Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first and last nodes of the path) are:   1 -> 3 -> 4 with 2 inactive   1 -> 2 -> 4 with 3 inactive"""
    MAKECHAININACTIVE = _pywrapcp.Solver_MAKECHAININACTIVE
    r""" Operator which makes a "chain" of path nodes inactive. Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first and last nodes of the path) are:   1 -> 3 -> 4 with 2 inactive   1 -> 2 -> 4 with 3 inactive   1 -> 4 with 2 and 3 inactive"""
    SWAPACTIVE = _pywrapcp.Solver_SWAPACTIVE
    r""" Operator which replaces an active node by an inactive one. Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 are first and last nodes of the path) are:   1 -> [5] ->  3  -> 4 with 2 inactive   1 ->  2  -> [5] -> 4 with 3 inactive"""
    EXTENDEDSWAPACTIVE = _pywrapcp.Solver_EXTENDEDSWAPACTIVE
    r""" Operator which makes an inactive node active and an active one inactive. It is similar to SwapActiveOperator except that it tries to insert the inactive node in all possible positions instead of just the position of the node made inactive. Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive (where 1 and 4 are first and last nodes of the path) are:   1 -> [5] ->  3  -> 4 with 2 inactive   1 ->  3  -> [5] -> 4 with 2 inactive   1 -> [5] ->  2  -> 4 with 3 inactive   1 ->  2  -> [5] -> 4 with 3 inactive"""
    PATHLNS = _pywrapcp.Solver_PATHLNS
    r""" Operator which relaxes two sub-chains of three consecutive arcs each. Each sub-chain is defined by a start node and the next three arcs. Those six arcs are relaxed to build a new neighbor. PATHLNS explores all possible pairs of starting nodes and so defines n^2 neighbors, n being the number of nodes. Note that the two sub-chains can be part of the same path; they even may overlap."""
    FULLPATHLNS = _pywrapcp.Solver_FULLPATHLNS
    r""" Operator which relaxes one entire path and all inactive nodes, thus defining num_paths neighbors."""
    UNACTIVELNS = _pywrapcp.Solver_UNACTIVELNS
    r""" Operator which relaxes all inactive nodes and one sub-chain of six consecutive arcs. That way the path can be improved by inserting inactive nodes or swapping arcs."""
    INCREMENT = _pywrapcp.Solver_INCREMENT
    r""" Operator which defines one neighbor per variable. Each neighbor tries to increment by one the value of the corresponding variable. When a new solution is found the neighborhood is rebuilt from scratch, i.e., tries to increment values in the variable order. Consider for instance variables x and y. x is incremented one by one to its max, and when it is not possible to increment x anymore, y is incremented once. If this is a solution, then next neighbor tries to increment x."""
    DECREMENT = _pywrapcp.Solver_DECREMENT
    r""" Operator which defines a neighborhood to decrement values. The behavior is the same as INCREMENT, except values are decremented instead of incremented."""
    SIMPLELNS = _pywrapcp.Solver_SIMPLELNS
    r""" 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."""
    GE = _pywrapcp.Solver_GE
    r""" Move is accepted when the current objective value >= objective.Min."""
    LE = _pywrapcp.Solver_LE
    r""" Move is accepted when the current objective value <= objective.Max."""
    EQ = _pywrapcp.Solver_EQ
    r""" Move is accepted when the current objective value is in the interval objective.Min .. objective.Max."""
    DELAYED_PRIORITY = _pywrapcp.Solver_DELAYED_PRIORITY
    r""" DELAYED_PRIORITY is the lowest priority: Demons will be processed after VAR_PRIORITY and NORMAL_PRIORITY demons."""
    VAR_PRIORITY = _pywrapcp.Solver_VAR_PRIORITY
    r""" VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY."""
    NORMAL_PRIORITY = _pywrapcp.Solver_NORMAL_PRIORITY
    r""" NORMAL_PRIORITY is the highest priority: Demons will be processed first."""

    def __init__(self, *args):
        _pywrapcp.Solver_swiginit(self, _pywrapcp.new_Solver(*args))

        self.__python_constraints = []



    __swig_destroy__ = _pywrapcp.delete_Solver

    def Parameters(self) -> "operations_research::ConstraintSolverParameters":
        r""" Stored Parameters."""
        return _pywrapcp.Solver_Parameters(self)

    @staticmethod
    def DefaultSolverParameters() -> "operations_research::ConstraintSolverParameters":
        r""" Create a ConstraintSolverParameters proto with all the default values."""
        return _pywrapcp.Solver_DefaultSolverParameters()

    def AddConstraint(self, c: "Constraint") -> "void":
        r""" Adds the constraint 'c' to the model. After calling this method, and until there is a backtrack that undoes the addition, any assignment of variables to values must satisfy the given constraint in order to be considered feasible. There are two fairly different use cases: - the most common use case is modeling: the given constraint is really part of the problem that the user is trying to solve. In this use case, AddConstraint is called outside of search (i.e., with state() == OUTSIDE_SEARCH). Most users should only use AddConstraint in this way. In this case, the constraint will belong to the model forever: it cannot not be removed by backtracking. - a rarer use case is that 'c' is not a real constraint of the model. It may be a constraint generated by a branching decision (a constraint whose goal is to restrict the search space), a symmetry breaking constraint (a constraint that does restrict the search space, but in a way that cannot have an impact on the quality of the solutions in the subtree), or an inferred constraint that, while having no semantic value to the model (it does not restrict the set of solutions), is worth having because we believe it may strengthen the propagation. In these cases, it happens that the constraint is added during the search (i.e., with state() == IN_SEARCH or state() == IN_ROOT_NODE). When a constraint is added during a search, it applies only to the subtree of the search tree rooted at the current node, and will be automatically removed by backtracking. This method does not take ownership of the constraint. If the constraint has been created by any factory method (Solver::MakeXXX), it will automatically be deleted. However, power users who implement their own constraints should do: solver.AddConstraint(solver.RevAlloc(new MyConstraint(...));"""
        return _pywrapcp.Solver_AddConstraint(self, c)

    def Solve(self, *args) -> "bool":
        return _pywrapcp.Solver_Solve(self, *args)

    def NewSearch(self, *args) -> "void":
        return _pywrapcp.Solver_NewSearch(self, *args)

    def NextSolution(self) -> "bool":
        return _pywrapcp.Solver_NextSolution(self)

    def RestartSearch(self) -> "void":
        return _pywrapcp.Solver_RestartSearch(self)

    def EndSearch(self) -> "void":
        return _pywrapcp.Solver_EndSearch(self)

    def SolveAndCommit(self, *args) -> "bool":
        return _pywrapcp.Solver_SolveAndCommit(self, *args)

    def CheckAssignment(self, solution: "Assignment") -> "bool":
        r""" Checks whether the given assignment satisfies all relevant constraints."""
        return _pywrapcp.Solver_CheckAssignment(self, solution)

    def CheckConstraint(self, ct: "Constraint") -> "bool":
        r""" 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."""
        return _pywrapcp.Solver_CheckConstraint(self, ct)

    def Fail(self) -> "void":
        r""" Abandon the current branch in the search tree. A backtrack will follow."""
        return _pywrapcp.Solver_Fail(self)

    @staticmethod
    def MemoryUsage() -> "int64":
        r""" Current memory usage in bytes"""
        return _pywrapcp.Solver_MemoryUsage()

    def WallTime(self) -> "int64":
        r""" DEPRECATED: Use Now() instead. Time elapsed, in ms since the creation of the solver."""
        return _pywrapcp.Solver_WallTime(self)

    def Branches(self) -> "int64":
        r""" The number of branches explored since the creation of the solver."""
        return _pywrapcp.Solver_Branches(self)

    def Solutions(self) -> "int64":
        r""" The number of solutions found since the start of the search."""
        return _pywrapcp.Solver_Solutions(self)

    def Failures(self) -> "int64":
        r""" The number of failures encountered since the creation of the solver."""
        return _pywrapcp.Solver_Failures(self)

    def AcceptedNeighbors(self) -> "int64":
        r""" The number of accepted neighbors."""
        return _pywrapcp.Solver_AcceptedNeighbors(self)

    def Stamp(self) -> "uint64":
        r""" 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."""
        return _pywrapcp.Solver_Stamp(self)

    def FailStamp(self) -> "uint64":
        r""" The fail_stamp() is incremented after each backtrack."""
        return _pywrapcp.Solver_FailStamp(self)

    def IntVar(self, *args) -> "operations_research::IntVar *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_IntVar(self, *args)

    def BoolVar(self, *args) -> "operations_research::IntVar *":
        r"""
        *Overload 1:*
        MakeBoolVar will create a variable with a {0, 1} domain.

        |

        *Overload 2:*
        MakeBoolVar will create a variable with a {0, 1} domain.
        """
        return _pywrapcp.Solver_BoolVar(self, *args)

    def IntConst(self, *args) -> "operations_research::IntVar *":
        r"""
        *Overload 1:*
        IntConst will create a constant expression.

        |

        *Overload 2:*
        IntConst will create a constant expression.
        """
        return _pywrapcp.Solver_IntConst(self, *args)

    def Sum(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::IntExpr *":
        r""" sum of all vars."""
        return _pywrapcp.Solver_Sum(self, vars)

    def ScalProd(self, *args) -> "operations_research::IntExpr *":
        r"""
        *Overload 1:*
        scalar product

        |

        *Overload 2:*
        scalar product
        """
        return _pywrapcp.Solver_ScalProd(self, *args)

    def MonotonicElement(self, values: "operations_research::Solver::IndexEvaluator1", increasing: "bool", index: "IntVar") -> "operations_research::IntExpr *":
        r""" 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."""
        return _pywrapcp.Solver_MonotonicElement(self, values, increasing, index)

    def Element(self, *args) -> "operations_research::IntExpr *":
        r"""
        *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]
        """
        return _pywrapcp.Solver_Element(self, *args)

    def IndexExpression(self, vars: "std::vector< operations_research::IntVar * > const &", value: "int64") -> "operations_research::IntExpr *":
        r""" Returns the expression expr such that vars[expr] == value. It assumes that vars are all different."""
        return _pywrapcp.Solver_IndexExpression(self, vars, value)

    def Min(self, *args) -> "operations_research::IntExpr *":
        r"""
        *Overload 1:*
        std::min(vars)

        |

        *Overload 2:*
        std::min (left, right)

        |

        *Overload 3:*
        std::min(expr, value)

        |

        *Overload 4:*
        std::min(expr, value)
        """
        return _pywrapcp.Solver_Min(self, *args)

    def Max(self, *args) -> "operations_research::IntExpr *":
        r"""
        *Overload 1:*
        std::max(vars)

        |

        *Overload 2:*
        std::max(left, right)

        |

        *Overload 3:*
        std::max(expr, value)

        |

        *Overload 4:*
        std::max(expr, value)
        """
        return _pywrapcp.Solver_Max(self, *args)

    def ConvexPiecewiseExpr(self, expr: "IntExpr", early_cost: "int64", early_date: "int64", late_date: "int64", late_cost: "int64") -> "operations_research::IntExpr *":
        r""" Convex piecewise function."""
        return _pywrapcp.Solver_ConvexPiecewiseExpr(self, expr, early_cost, early_date, late_date, late_cost)

    def SemiContinuousExpr(self, expr: "IntExpr", fixed_charge: "int64", step: "int64") -> "operations_research::IntExpr *":
        r""" Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0"""
        return _pywrapcp.Solver_SemiContinuousExpr(self, expr, fixed_charge, step)

    def ConditionalExpression(self, condition: "IntVar", expr: "IntExpr", unperformed_value: "int64") -> "operations_research::IntExpr *":
        r""" Conditional Expr condition ? expr : unperformed_value"""
        return _pywrapcp.Solver_ConditionalExpression(self, condition, expr, unperformed_value)

    def TrueConstraint(self) -> "operations_research::Constraint *":
        r""" This constraint always succeeds."""
        return _pywrapcp.Solver_TrueConstraint(self)

    def FalseConstraint(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_FalseConstraint(self, *args)

    def IsEqualCstCt(self, var: "IntExpr", value: "int64", boolvar: "IntVar") -> "operations_research::Constraint *":
        r""" boolvar == (var == value)"""
        return _pywrapcp.Solver_IsEqualCstCt(self, var, value, boolvar)

    def IsEqualCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var == value)"""
        return _pywrapcp.Solver_IsEqualCstVar(self, var, value)

    def IsEqualCt(self, v1: "IntExpr", v2: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (v1 == v2)"""
        return _pywrapcp.Solver_IsEqualCt(self, v1, v2, b)

    def IsEqualVar(self, v1: "IntExpr", v2: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (v1 == v2)"""
        return _pywrapcp.Solver_IsEqualVar(self, v1, v2)

    def IsDifferentCstCt(self, var: "IntExpr", value: "int64", boolvar: "IntVar") -> "operations_research::Constraint *":
        r""" boolvar == (var != value)"""
        return _pywrapcp.Solver_IsDifferentCstCt(self, var, value, boolvar)

    def IsDifferentCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var != value)"""
        return _pywrapcp.Solver_IsDifferentCstVar(self, var, value)

    def IsDifferentVar(self, v1: "IntExpr", v2: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (v1 != v2)"""
        return _pywrapcp.Solver_IsDifferentVar(self, v1, v2)

    def IsDifferentCt(self, v1: "IntExpr", v2: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (v1 != v2)"""
        return _pywrapcp.Solver_IsDifferentCt(self, v1, v2, b)

    def IsLessOrEqualCstCt(self, var: "IntExpr", value: "int64", boolvar: "IntVar") -> "operations_research::Constraint *":
        r""" boolvar == (var <= value)"""
        return _pywrapcp.Solver_IsLessOrEqualCstCt(self, var, value, boolvar)

    def IsLessOrEqualCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var <= value)"""
        return _pywrapcp.Solver_IsLessOrEqualCstVar(self, var, value)

    def IsLessOrEqualVar(self, left: "IntExpr", right: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (left <= right)"""
        return _pywrapcp.Solver_IsLessOrEqualVar(self, left, right)

    def IsLessOrEqualCt(self, left: "IntExpr", right: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (left <= right)"""
        return _pywrapcp.Solver_IsLessOrEqualCt(self, left, right, b)

    def IsGreaterOrEqualCstCt(self, var: "IntExpr", value: "int64", boolvar: "IntVar") -> "operations_research::Constraint *":
        r""" boolvar == (var >= value)"""
        return _pywrapcp.Solver_IsGreaterOrEqualCstCt(self, var, value, boolvar)

    def IsGreaterOrEqualCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var >= value)"""
        return _pywrapcp.Solver_IsGreaterOrEqualCstVar(self, var, value)

    def IsGreaterOrEqualVar(self, left: "IntExpr", right: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (left >= right)"""
        return _pywrapcp.Solver_IsGreaterOrEqualVar(self, left, right)

    def IsGreaterOrEqualCt(self, left: "IntExpr", right: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (left >= right)"""
        return _pywrapcp.Solver_IsGreaterOrEqualCt(self, left, right, b)

    def IsGreaterCstCt(self, v: "IntExpr", c: "int64", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (v > c)"""
        return _pywrapcp.Solver_IsGreaterCstCt(self, v, c, b)

    def IsGreaterCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var > value)"""
        return _pywrapcp.Solver_IsGreaterCstVar(self, var, value)

    def IsGreaterVar(self, left: "IntExpr", right: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (left > right)"""
        return _pywrapcp.Solver_IsGreaterVar(self, left, right)

    def IsGreaterCt(self, left: "IntExpr", right: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (left > right)"""
        return _pywrapcp.Solver_IsGreaterCt(self, left, right, b)

    def IsLessCstCt(self, v: "IntExpr", c: "int64", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (v < c)"""
        return _pywrapcp.Solver_IsLessCstCt(self, v, c, b)

    def IsLessCstVar(self, var: "IntExpr", value: "int64") -> "operations_research::IntVar *":
        r""" status var of (var < value)"""
        return _pywrapcp.Solver_IsLessCstVar(self, var, value)

    def IsLessVar(self, left: "IntExpr", right: "IntExpr") -> "operations_research::IntVar *":
        r""" status var of (left < right)"""
        return _pywrapcp.Solver_IsLessVar(self, left, right)

    def IsLessCt(self, left: "IntExpr", right: "IntExpr", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (left < right)"""
        return _pywrapcp.Solver_IsLessCt(self, left, right, b)

    def SumLessOrEqual(self, vars: "std::vector< operations_research::IntVar * > const &", cst: "int64") -> "operations_research::Constraint *":
        r""" Variation on arrays."""
        return _pywrapcp.Solver_SumLessOrEqual(self, vars, cst)

    def SumGreaterOrEqual(self, vars: "std::vector< operations_research::IntVar * > const &", cst: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.Solver_SumGreaterOrEqual(self, vars, cst)

    def SumEquality(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_SumEquality(self, *args)

    def ScalProdEquality(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_ScalProdEquality(self, *args)

    def ScalProdGreaterOrEqual(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_ScalProdGreaterOrEqual(self, *args)

    def ScalProdLessOrEqual(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_ScalProdLessOrEqual(self, *args)

    def MinEquality(self, vars: "std::vector< operations_research::IntVar * > const &", min_var: "IntVar") -> "operations_research::Constraint *":
        return _pywrapcp.Solver_MinEquality(self, vars, min_var)

    def MaxEquality(self, vars: "std::vector< operations_research::IntVar * > const &", max_var: "IntVar") -> "operations_research::Constraint *":
        return _pywrapcp.Solver_MaxEquality(self, vars, max_var)

    def ElementEquality(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_ElementEquality(self, *args)

    def AbsEquality(self, var: "IntVar", abs_var: "IntVar") -> "operations_research::Constraint *":
        r""" Creates the constraint abs(var) == abs_var."""
        return _pywrapcp.Solver_AbsEquality(self, var, abs_var)

    def IndexOfConstraint(self, vars: "std::vector< operations_research::IntVar * > const &", index: "IntVar", target: "int64") -> "operations_research::Constraint *":
        r""" 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."""
        return _pywrapcp.Solver_IndexOfConstraint(self, vars, index, target)

    def ConstraintInitialPropagateCallback(self, ct: "Constraint") -> "operations_research::Demon *":
        r""" This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'."""
        return _pywrapcp.Solver_ConstraintInitialPropagateCallback(self, ct)

    def DelayedConstraintInitialPropagateCallback(self, ct: "Constraint") -> "operations_research::Demon *":
        r""" This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority."""
        return _pywrapcp.Solver_DelayedConstraintInitialPropagateCallback(self, ct)

    def ClosureDemon(self, closure: "operations_research::Solver::Closure") -> "operations_research::Demon *":
        r""" Creates a demon from a closure."""
        return _pywrapcp.Solver_ClosureDemon(self, closure)

    def BetweenCt(self, expr: "IntExpr", l: "int64", u: "int64") -> "operations_research::Constraint *":
        r""" (l <= expr <= u)"""
        return _pywrapcp.Solver_BetweenCt(self, expr, l, u)

    def IsBetweenCt(self, expr: "IntExpr", l: "int64", u: "int64", b: "IntVar") -> "operations_research::Constraint *":
        r""" b == (l <= expr <= u)"""
        return _pywrapcp.Solver_IsBetweenCt(self, expr, l, u, b)

    def IsBetweenVar(self, v: "IntExpr", l: "int64", u: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.Solver_IsBetweenVar(self, v, l, u)

    def MemberCt(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_MemberCt(self, *args)

    def NotMemberCt(self, *args) -> "operations_research::Constraint *":
        r"""
        *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]].
        """
        return _pywrapcp.Solver_NotMemberCt(self, *args)

    def IsMemberCt(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_IsMemberCt(self, *args)

    def IsMemberVar(self, *args) -> "operations_research::IntVar *":
        return _pywrapcp.Solver_IsMemberVar(self, *args)

    def Count(self, *args) -> "operations_research::Constraint *":
        r"""
        *Overload 1:*
        |{i | vars[i] == value}| == max_count

        |

        *Overload 2:*
        |{i | vars[i] == value}| == max_count
        """
        return _pywrapcp.Solver_Count(self, *args)

    def Distribute(self, *args) -> "operations_research::Constraint *":
        r"""
        *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]
        """
        return _pywrapcp.Solver_Distribute(self, *args)

    def Deviation(self, vars: "std::vector< operations_research::IntVar * > const &", deviation_var: "IntVar", total_sum: "int64") -> "operations_research::Constraint *":
        r""" Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = #vars"""
        return _pywrapcp.Solver_Deviation(self, vars, deviation_var, total_sum)

    def AllDifferent(self, *args) -> "operations_research::Constraint *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_AllDifferent(self, *args)

    def AllDifferentExcept(self, vars: "std::vector< operations_research::IntVar * > const &", escape_value: "int64") -> "operations_research::Constraint *":
        r""" All variables are pairwise different, unless they are assigned to the escape value."""
        return _pywrapcp.Solver_AllDifferentExcept(self, vars, escape_value)

    def SortingConstraint(self, vars: "std::vector< operations_research::IntVar * > const &", sorted: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" 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"""
        return _pywrapcp.Solver_SortingConstraint(self, vars, sorted)

    def LexicalLess(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r"""                                         std::vector<IntVar*>* const                                         sorted); Creates a constraint that enforces that left is lexicographically less than right."""
        return _pywrapcp.Solver_LexicalLess(self, left, right)

    def LexicalLessOrEqual(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" Creates a constraint that enforces that left is lexicographically less than or equal to right."""
        return _pywrapcp.Solver_LexicalLessOrEqual(self, left, right)

    def InversePermutationConstraint(self, left: "std::vector< operations_research::IntVar * > const &", right: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" 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."""
        return _pywrapcp.Solver_InversePermutationConstraint(self, left, right)

    def NullIntersect(self, first_vars: "std::vector< operations_research::IntVar * > const &", second_vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" 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."""
        return _pywrapcp.Solver_NullIntersect(self, first_vars, second_vars)

    def NullIntersectExcept(self, first_vars: "std::vector< operations_research::IntVar * > const &", second_vars: "std::vector< operations_research::IntVar * > const &", escape_value: "int64") -> "operations_research::Constraint *":
        r""" 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."""
        return _pywrapcp.Solver_NullIntersectExcept(self, first_vars, second_vars, escape_value)

    def Circuit(self, nexts: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" Force the "nexts" variable to create a complete Hamiltonian path."""
        return _pywrapcp.Solver_Circuit(self, nexts)

    def SubCircuit(self, nexts: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" Force the "nexts" variable to create a complete Hamiltonian path for those that do not loop upon themselves."""
        return _pywrapcp.Solver_SubCircuit(self, nexts)

    def DelayedPathCumul(self, nexts: "std::vector< operations_research::IntVar * > const &", active: "std::vector< operations_research::IntVar * > const &", cumuls: "std::vector< operations_research::IntVar * > const &", transits: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        r""" Delayed version of the same constraint: propagation on the nexts variables is delayed until all constraints have propagated."""
        return _pywrapcp.Solver_DelayedPathCumul(self, nexts, active, cumuls, transits)

    def PathCumul(self, *args) -> "operations_research::Constraint *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_PathCumul(self, *args)

    def AllowedAssignments(self, *args) -> "operations_research::Constraint *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_AllowedAssignments(self, *args)

    def TransitionConstraint(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_TransitionConstraint(self, *args)

    def NonOverlappingBoxesConstraint(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_NonOverlappingBoxesConstraint(self, *args)

    def Pack(self, vars: "std::vector< operations_research::IntVar * > const &", number_of_bins: "int") -> "operations_research::Pack *":
        r""" 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."""
        return _pywrapcp.Solver_Pack(self, vars, number_of_bins)

    def FixedDurationIntervalVar(self, *args) -> "operations_research::IntervalVar *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_FixedDurationIntervalVar(self, *args)

    def FixedInterval(self, start: "int64", duration: "int64", name: "std::string const &") -> "operations_research::IntervalVar *":
        r""" Creates a fixed and performed interval."""
        return _pywrapcp.Solver_FixedInterval(self, start, duration, name)

    def IntervalVar(self, start_min: "int64", start_max: "int64", duration_min: "int64", duration_max: "int64", end_min: "int64", end_max: "int64", optional: "bool", name: "std::string const &") -> "operations_research::IntervalVar *":
        r""" Creates an interval var by specifying the bounds on start, duration, and end."""
        return _pywrapcp.Solver_IntervalVar(self, start_min, start_max, duration_min, duration_max, end_min, end_max, optional, name)

    def MirrorInterval(self, interval_var: "IntervalVar") -> "operations_research::IntervalVar *":
        r""" Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis."""
        return _pywrapcp.Solver_MirrorInterval(self, interval_var)

    def FixedDurationStartSyncedOnStartIntervalVar(self, interval_var: "IntervalVar", duration: "int64", offset: "int64") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_FixedDurationStartSyncedOnStartIntervalVar(self, interval_var, duration, offset)

    def FixedDurationStartSyncedOnEndIntervalVar(self, interval_var: "IntervalVar", duration: "int64", offset: "int64") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_FixedDurationStartSyncedOnEndIntervalVar(self, interval_var, duration, offset)

    def FixedDurationEndSyncedOnStartIntervalVar(self, interval_var: "IntervalVar", duration: "int64", offset: "int64") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_FixedDurationEndSyncedOnStartIntervalVar(self, interval_var, duration, offset)

    def FixedDurationEndSyncedOnEndIntervalVar(self, interval_var: "IntervalVar", duration: "int64", offset: "int64") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_FixedDurationEndSyncedOnEndIntervalVar(self, interval_var, duration, offset)

    def IntervalRelaxedMin(self, interval_var: "IntervalVar") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_IntervalRelaxedMin(self, interval_var)

    def IntervalRelaxedMax(self, interval_var: "IntervalVar") -> "operations_research::IntervalVar *":
        r""" 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."""
        return _pywrapcp.Solver_IntervalRelaxedMax(self, interval_var)

    def TemporalDisjunction(self, *args) -> "operations_research::Constraint *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_TemporalDisjunction(self, *args)

    def DisjunctiveConstraint(self, intervals: "std::vector< operations_research::IntervalVar * > const &", name: "std::string const &") -> "operations_research::DisjunctiveConstraint *":
        r""" This constraint forces all interval vars into an non-overlapping sequence. Intervals with zero duration can be scheduled anywhere."""
        return _pywrapcp.Solver_DisjunctiveConstraint(self, intervals, name)

    def Cumulative(self, *args) -> "operations_research::Constraint *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_Cumulative(self, *args)

    def Cover(self, vars: "std::vector< operations_research::IntervalVar * > const &", target_var: "IntervalVar") -> "operations_research::Constraint *":
        r""" 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."""
        return _pywrapcp.Solver_Cover(self, vars, target_var)

    def Assignment(self, *args) -> "operations_research::Assignment *":
        r"""
        *Overload 1:*
        This method creates an empty assignment.

        |

        *Overload 2:*
        This method creates an assignment which is a copy of 'a'.
        """
        return _pywrapcp.Solver_Assignment(self, *args)

    def FirstSolutionCollector(self, *args) -> "operations_research::SolutionCollector *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_FirstSolutionCollector(self, *args)

    def LastSolutionCollector(self, *args) -> "operations_research::SolutionCollector *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_LastSolutionCollector(self, *args)

    def BestValueSolutionCollector(self, *args) -> "operations_research::SolutionCollector *":
        r"""
        *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 '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.
        """
        return _pywrapcp.Solver_BestValueSolutionCollector(self, *args)

    def AllSolutionCollector(self, *args) -> "operations_research::SolutionCollector *":
        r"""
        *Overload 1:*
        Collect all solutions of the search.

        |

        *Overload 2:*
        Collect all solutions of the search. The variables will need to be added later.
        """
        return _pywrapcp.Solver_AllSolutionCollector(self, *args)

    def Minimize(self, v: "IntVar", step: "int64") -> "operations_research::OptimizeVar *":
        r""" Creates a minimization objective."""
        return _pywrapcp.Solver_Minimize(self, v, step)

    def Maximize(self, v: "IntVar", step: "int64") -> "operations_research::OptimizeVar *":
        r""" Creates a maximization objective."""
        return _pywrapcp.Solver_Maximize(self, v, step)

    def Optimize(self, maximize: "bool", v: "IntVar", step: "int64") -> "operations_research::OptimizeVar *":
        r""" Creates a objective with a given sense (true = maximization)."""
        return _pywrapcp.Solver_Optimize(self, maximize, v, step)

    def WeightedMinimize(self, *args) -> "operations_research::OptimizeVar *":
        r"""
        *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).
        """
        return _pywrapcp.Solver_WeightedMinimize(self, *args)

    def WeightedMaximize(self, *args) -> "operations_research::OptimizeVar *":
        r"""
        *Overload 1:*
        Creates a maximization weigthed objective.

        |

        *Overload 2:*
        Creates a maximization weigthed objective.
        """
        return _pywrapcp.Solver_WeightedMaximize(self, *args)

    def WeightedOptimize(self, *args) -> "operations_research::OptimizeVar *":
        r"""
        *Overload 1:*
        Creates a weighted objective with a given sense (true = maximization).

        |

        *Overload 2:*
        Creates a weighted objective with a given sense (true = maximization).
        """
        return _pywrapcp.Solver_WeightedOptimize(self, *args)

    def TabuSearch(self, maximize: "bool", v: "IntVar", step: "int64", vars: "std::vector< operations_research::IntVar * > const &", keep_tenure: "int64", forbid_tenure: "int64", tabu_factor: "double") -> "operations_research::SearchMonitor *":
        r""" 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."""
        return _pywrapcp.Solver_TabuSearch(self, maximize, v, step, vars, keep_tenure, forbid_tenure, tabu_factor)

    def SimulatedAnnealing(self, maximize: "bool", v: "IntVar", step: "int64", initial_temperature: "int64") -> "operations_research::SearchMonitor *":
        r""" Creates a Simulated Annealing monitor."""
        return _pywrapcp.Solver_SimulatedAnnealing(self, maximize, v, step, initial_temperature)

    def LubyRestart(self, scale_factor: "int") -> "operations_research::SearchMonitor *":
        r""" 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...)."""
        return _pywrapcp.Solver_LubyRestart(self, scale_factor)

    def ConstantRestart(self, frequency: "int") -> "operations_research::SearchMonitor *":
        r""" This search monitor will restart the search periodically after 'frequency' failures."""
        return _pywrapcp.Solver_ConstantRestart(self, frequency)

    def TimeLimit(self, time_in_ms: "int64") -> "operations_research::RegularLimit *":
        r""" Creates a search limit that constrains the running time given in milliseconds."""
        return _pywrapcp.Solver_TimeLimit(self, time_in_ms)

    def BranchesLimit(self, branches: "int64") -> "operations_research::RegularLimit *":
        r""" Creates a search limit that constrains the number of branches explored in the search tree."""
        return _pywrapcp.Solver_BranchesLimit(self, branches)

    def FailuresLimit(self, failures: "int64") -> "operations_research::RegularLimit *":
        r""" Creates a search limit that constrains the number of failures that can happen when exploring the search tree."""
        return _pywrapcp.Solver_FailuresLimit(self, failures)

    def SolutionsLimit(self, solutions: "int64") -> "operations_research::RegularLimit *":
        r""" Creates a search limit that constrains the number of solutions found during the search."""
        return _pywrapcp.Solver_SolutionsLimit(self, solutions)

    def Limit(self, *args) -> "operations_research::SearchLimit *":
        r"""
        *Overload 1:*
        Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits.

        |

        *Overload 2:*
        Version reducing calls to wall timer by estimating number of remaining calls.

        |

        *Overload 3:*
        Creates a search limit which can either apply cumulatively or search-by-search.

        |

        *Overload 4:*
        Creates a search limit from its protobuf description

        |

        *Overload 5:*
        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.
        """
        return _pywrapcp.Solver_Limit(self, *args)

    def CustomLimit(self, limiter: "std::function< bool () >") -> "operations_research::SearchLimit *":
        r""" Callback-based search limit. Search stops when limiter returns true; if this happens at a leaf the corresponding solution will be rejected."""
        return _pywrapcp.Solver_CustomLimit(self, limiter)

    def SearchLog(self, *args) -> "operations_research::SearchMonitor *":
        return _pywrapcp.Solver_SearchLog(self, *args)

    def SearchTrace(self, prefix: "std::string const &") -> "operations_research::SearchMonitor *":
        r""" Creates a search monitor that will trace precisely the behavior of the search. Use this only for low level debugging."""
        return _pywrapcp.Solver_SearchTrace(self, prefix)

    def PrintModelVisitor(self) -> "operations_research::ModelVisitor *":
        r""" Prints the model."""
        return _pywrapcp.Solver_PrintModelVisitor(self)

    def StatisticsModelVisitor(self) -> "operations_research::ModelVisitor *":
        r""" Displays some nice statistics on the model."""
        return _pywrapcp.Solver_StatisticsModelVisitor(self)

    def AssignVariableValue(self, var: "IntVar", val: "int64") -> "operations_research::Decision *":
        r""" Decisions."""
        return _pywrapcp.Solver_AssignVariableValue(self, var, val)

    def VariableLessOrEqualValue(self, var: "IntVar", value: "int64") -> "operations_research::Decision *":
        return _pywrapcp.Solver_VariableLessOrEqualValue(self, var, value)

    def VariableGreaterOrEqualValue(self, var: "IntVar", value: "int64") -> "operations_research::Decision *":
        return _pywrapcp.Solver_VariableGreaterOrEqualValue(self, var, value)

    def SplitVariableDomain(self, var: "IntVar", val: "int64", start_with_lower_half: "bool") -> "operations_research::Decision *":
        return _pywrapcp.Solver_SplitVariableDomain(self, var, val, start_with_lower_half)

    def AssignVariableValueOrFail(self, var: "IntVar", value: "int64") -> "operations_research::Decision *":
        return _pywrapcp.Solver_AssignVariableValueOrFail(self, var, value)

    def AssignVariablesValues(self, vars: "std::vector< operations_research::IntVar * > const &", values: "std::vector< int64 > const &") -> "operations_research::Decision *":
        return _pywrapcp.Solver_AssignVariablesValues(self, vars, values)

    def FailDecision(self) -> "operations_research::Decision *":
        return _pywrapcp.Solver_FailDecision(self)

    def Decision(self, apply: "operations_research::Solver::Action", refute: "operations_research::Solver::Action") -> "operations_research::Decision *":
        return _pywrapcp.Solver_Decision(self, apply, refute)

    def Compose(self, dbs: "std::vector< operations_research::DecisionBuilder * > const &") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_Compose(self, dbs)

    def Try(self, dbs: "std::vector< operations_research::DecisionBuilder * > const &") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_Try(self, dbs)

    def DefaultPhase(self, *args) -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_DefaultPhase(self, *args)

    def ScheduleOrPostpone(self, var: "IntervalVar", est: "int64", marker: "int64 *const") -> "operations_research::Decision *":
        r""" 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."""
        return _pywrapcp.Solver_ScheduleOrPostpone(self, var, est, marker)

    def ScheduleOrExpedite(self, var: "IntervalVar", est: "int64", marker: "int64 *const") -> "operations_research::Decision *":
        r""" 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."""
        return _pywrapcp.Solver_ScheduleOrExpedite(self, var, est, marker)

    def RankFirstInterval(self, sequence: "SequenceVar", index: "int") -> "operations_research::Decision *":
        r""" Returns a decision that tries to rank first the ith interval var in the sequence variable."""
        return _pywrapcp.Solver_RankFirstInterval(self, sequence, index)

    def RankLastInterval(self, sequence: "SequenceVar", index: "int") -> "operations_research::Decision *":
        r""" Returns a decision that tries to rank last the ith interval var in the sequence variable."""
        return _pywrapcp.Solver_RankLastInterval(self, sequence, index)

    def Phase(self, *args) -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_Phase(self, *args)

    def DecisionBuilderFromAssignment(self, assignment: "Assignment", db: "DecisionBuilder", vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::DecisionBuilder *":
        r""" Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'."""
        return _pywrapcp.Solver_DecisionBuilderFromAssignment(self, assignment, db, vars)

    def ConstraintAdder(self, ct: "Constraint") -> "operations_research::DecisionBuilder *":
        r""" Returns a decision builder that will add the given constraint to the model."""
        return _pywrapcp.Solver_ConstraintAdder(self, ct)

    def SolveOnce(self, db: "DecisionBuilder", monitors: "std::vector< operations_research::SearchMonitor * > const &") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_SolveOnce(self, db, monitors)

    def NestedOptimize(self, *args) -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_NestedOptimize(self, *args)

    def RestoreAssignment(self, assignment: "Assignment") -> "operations_research::DecisionBuilder *":
        r""" Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore())"""
        return _pywrapcp.Solver_RestoreAssignment(self, assignment)

    def StoreAssignment(self, assignment: "Assignment") -> "operations_research::DecisionBuilder *":
        r""" Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store())"""
        return _pywrapcp.Solver_StoreAssignment(self, assignment)

    def Operator(self, *args) -> "operations_research::LocalSearchOperator *":
        return _pywrapcp.Solver_Operator(self, *args)

    def RandomLnsOperator(self, *args) -> "operations_research::LocalSearchOperator *":
        return _pywrapcp.Solver_RandomLnsOperator(self, *args)

    def MoveTowardTargetOperator(self, *args) -> "operations_research::LocalSearchOperator *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_MoveTowardTargetOperator(self, *args)

    def ConcatenateOperators(self, *args) -> "operations_research::LocalSearchOperator *":
        return _pywrapcp.Solver_ConcatenateOperators(self, *args)

    def RandomConcatenateOperators(self, *args) -> "operations_research::LocalSearchOperator *":
        r"""
        *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.
        """
        return _pywrapcp.Solver_RandomConcatenateOperators(self, *args)

    def NeighborhoodLimit(self, op: "LocalSearchOperator", limit: "int64") -> "operations_research::LocalSearchOperator *":
        r""" 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."""
        return _pywrapcp.Solver_NeighborhoodLimit(self, op, limit)

    def LocalSearchPhase(self, *args) -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_LocalSearchPhase(self, *args)

    def LocalSearchPhaseParameters(self, *args) -> "operations_research::LocalSearchPhaseParameters *":
        return _pywrapcp.Solver_LocalSearchPhaseParameters(self, *args)

    def SearchDepth(self) -> "int":
        r""" Gets the search depth of the current active search. Returns -1 if there is no active search opened."""
        return _pywrapcp.Solver_SearchDepth(self)

    def SearchLeftDepth(self) -> "int":
        r""" Gets the search left depth of the current active search. Returns -1 if there is no active search opened."""
        return _pywrapcp.Solver_SearchLeftDepth(self)

    def SolveDepth(self) -> "int":
        r""" 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."""
        return _pywrapcp.Solver_SolveDepth(self)

    def Rand64(self, size: "int64") -> "int64":
        r""" Returns a random value between 0 and 'size' - 1;"""
        return _pywrapcp.Solver_Rand64(self, size)

    def Rand32(self, size: "int32") -> "int32":
        r""" Returns a random value between 0 and 'size' - 1;"""
        return _pywrapcp.Solver_Rand32(self, size)

    def ReSeed(self, seed: "int32") -> "void":
        r""" Reseed the solver random generator."""
        return _pywrapcp.Solver_ReSeed(self, seed)

    def LocalSearchProfile(self) -> "std::string":
        r""" Returns local search profiling information in a human readable format. search profiles."""
        return _pywrapcp.Solver_LocalSearchProfile(self)

    def Constraints(self) -> "int":
        r""" Counts the number of constraints that have been added to the solver before the search."""
        return _pywrapcp.Solver_Constraints(self)

    def Accept(self, visitor: "operations_research::ModelVisitor *const") -> "void":
        r""" Accepts the given model visitor."""
        return _pywrapcp.Solver_Accept(self, visitor)

    def FinishCurrentSearch(self) -> "void":
        r""" Tells the solver to kill or restart the current search."""
        return _pywrapcp.Solver_FinishCurrentSearch(self)

    def RestartCurrentSearch(self) -> "void":
        return _pywrapcp.Solver_RestartCurrentSearch(self)

    def ShouldFail(self) -> "void":
        r""" These methods are only useful for the SWIG wrappers, which need a way to externally cause the Solver to fail."""
        return _pywrapcp.Solver_ShouldFail(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.Solver___str__(self)

    def Add(self, ct):
      if isinstance(ct, PyConstraint):
        self.__python_constraints.append(ct)
      self.AddConstraint(ct)


    def TreeNoCycle(self, nexts: "std::vector< operations_research::IntVar * > const &", active: "std::vector< operations_research::IntVar * > const &", callback: "operations_research::Solver::IndexFilter1"=0) -> "operations_research::Constraint *":
        return _pywrapcp.Solver_TreeNoCycle(self, nexts, active, callback)

    def SearchLogWithCallback(self, period: "int", callback: "std::function< std::string () >") -> "operations_research::SearchMonitor *":
        return _pywrapcp.Solver_SearchLogWithCallback(self, period, callback)

    def ElementFunction(self, values: "std::function< int64 (int64) >", index: "IntVar") -> "operations_research::IntExpr *":
        return _pywrapcp.Solver_ElementFunction(self, values, index)

    def VarEvalValStrPhase(self, vars: "std::vector< operations_research::IntVar * > const &", var_evaluator: "std::function< int64 (int64) >", val_str: "operations_research::Solver::IntValueStrategy") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_VarEvalValStrPhase(self, vars, var_evaluator, val_str)

    def VarStrValEvalPhase(self, vars: "std::vector< operations_research::IntVar * > const &", var_str: "operations_research::Solver::IntVarStrategy", val_eval: "operations_research::Solver::IndexEvaluator2") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_VarStrValEvalPhase(self, vars, var_str, val_eval)

    def VarEvalValEvalPhase(self, vars: "std::vector< operations_research::IntVar * > const &", var_eval: "std::function< int64 (int64) >", val_eval: "operations_research::Solver::IndexEvaluator2") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_VarEvalValEvalPhase(self, vars, var_eval, val_eval)

    def VarStrValEvalTieBreakPhase(self, vars: "std::vector< operations_research::IntVar * > const &", var_str: "operations_research::Solver::IntVarStrategy", val_eval: "operations_research::Solver::IndexEvaluator2", tie_breaker: "std::function< int64 (int64) >") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_VarStrValEvalTieBreakPhase(self, vars, var_str, val_eval, tie_breaker)

    def VarEvalValEvalTieBreakPhase(self, vars: "std::vector< operations_research::IntVar * > const &", var_eval: "std::function< int64 (int64) >", val_eval: "operations_research::Solver::IndexEvaluator2", tie_breaker: "std::function< int64 (int64) >") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_VarEvalValEvalTieBreakPhase(self, vars, var_eval, val_eval, tie_breaker)

    def EvalEvalStrPhase(self, vars: "std::vector< operations_research::IntVar * > const &", evaluator: "operations_research::Solver::IndexEvaluator2", str: "operations_research::Solver::EvaluatorStrategy") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_EvalEvalStrPhase(self, vars, evaluator, str)

    def EvalEvalStrTieBreakPhase(self, vars: "std::vector< operations_research::IntVar * > const &", evaluator: "operations_research::Solver::IndexEvaluator2", tie_breaker: "operations_research::Solver::IndexEvaluator1", str: "operations_research::Solver::EvaluatorStrategy") -> "operations_research::DecisionBuilder *":
        return _pywrapcp.Solver_EvalEvalStrTieBreakPhase(self, vars, evaluator, tie_breaker, str)

    def GuidedLocalSearch(self, *args) -> "operations_research::SearchMonitor *":
        return _pywrapcp.Solver_GuidedLocalSearch(self, *args)

    def SumObjectiveFilter(self, vars: "std::vector< operations_research::IntVar * > const &", values: "operations_research::Solver::IndexEvaluator2", filter_enum: "operations_research::Solver::LocalSearchFilterBound") -> "operations_research::LocalSearchFilter *":
        return _pywrapcp.Solver_SumObjectiveFilter(self, vars, values, filter_enum)

# Register Solver in _pywrapcp:
_pywrapcp.Solver_swigregister(Solver)

def Solver_DefaultSolverParameters() -> "operations_research::ConstraintSolverParameters":
    r""" Create a ConstraintSolverParameters proto with all the default values."""
    return _pywrapcp.Solver_DefaultSolverParameters()

def Solver_MemoryUsage() -> "int64":
    r""" Current memory usage in bytes"""
    return _pywrapcp.Solver_MemoryUsage()

class BaseObject(object):
    r""" A BaseObject is the root of all reversibly allocated objects. A DebugString method and the associated << operator are implemented as a convenience."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == BaseObject:
            _self = None
        else:
            _self = self
        _pywrapcp.BaseObject_swiginit(self, _pywrapcp.new_BaseObject(_self, ))
    __swig_destroy__ = _pywrapcp.delete_BaseObject

    def DebugString(self) -> "std::string":
        return _pywrapcp.BaseObject_DebugString(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.BaseObject___str__(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.BaseObject___repr__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_BaseObject(self)
        return weakref.proxy(self)

# Register BaseObject in _pywrapcp:
_pywrapcp.BaseObject_swigregister(BaseObject)

class PropagationBaseObject(BaseObject):
    r""" NOLINT The PropagationBaseObject is a subclass of BaseObject that is also friend to the Solver class. It allows accessing methods useful when writing new constraints or new expressions."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, s: "Solver"):
        if self.__class__ == PropagationBaseObject:
            _self = None
        else:
            _self = self
        _pywrapcp.PropagationBaseObject_swiginit(self, _pywrapcp.new_PropagationBaseObject(_self, s))
    __swig_destroy__ = _pywrapcp.delete_PropagationBaseObject

    def DebugString(self) -> "std::string":
        return _pywrapcp.PropagationBaseObject_DebugString(self)

    def solver(self) -> "operations_research::Solver *":
        return _pywrapcp.PropagationBaseObject_solver(self)

    def Name(self) -> "std::string":
        r""" Object naming."""
        return _pywrapcp.PropagationBaseObject_Name(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_PropagationBaseObject(self)
        return weakref.proxy(self)

# Register PropagationBaseObject in _pywrapcp:
_pywrapcp.PropagationBaseObject_swigregister(PropagationBaseObject)

class Decision(BaseObject):
    r""" A Decision represents a choice point in the search tree. The two main methods are Apply() to go left, or Refute() to go right."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == Decision:
            _self = None
        else:
            _self = self
        _pywrapcp.Decision_swiginit(self, _pywrapcp.new_Decision(_self, ))
    __swig_destroy__ = _pywrapcp.delete_Decision

    def ApplyWrapper(self, s: "Solver") -> "void":
        r""" Apply will be called first when the decision is executed."""
        return _pywrapcp.Decision_ApplyWrapper(self, s)

    def RefuteWrapper(self, s: "Solver") -> "void":
        r""" Refute will be called after a backtrack."""
        return _pywrapcp.Decision_RefuteWrapper(self, s)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Decision_DebugString(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.Decision___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.Decision___str__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Decision(self)
        return weakref.proxy(self)

# Register Decision in _pywrapcp:
_pywrapcp.Decision_swigregister(Decision)

class DecisionBuilder(BaseObject):
    r""" A DecisionBuilder is responsible for creating the search tree. The important method is Next(), which returns the next decision to execute."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == DecisionBuilder:
            _self = None
        else:
            _self = self
        _pywrapcp.DecisionBuilder_swiginit(self, _pywrapcp.new_DecisionBuilder(_self, ))
    __swig_destroy__ = _pywrapcp.delete_DecisionBuilder

    def NextWrapper(self, s: "Solver") -> "operations_research::Decision *":
        r""" This is the main method of the decision builder class. It must return a decision (an instance of the class Decision). If it returns nullptr, this means that the decision builder has finished its work."""
        return _pywrapcp.DecisionBuilder_NextWrapper(self, s)

    def DebugString(self) -> "std::string":
        return _pywrapcp.DecisionBuilder_DebugString(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.DecisionBuilder___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.DecisionBuilder___str__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_DecisionBuilder(self)
        return weakref.proxy(self)

# Register DecisionBuilder in _pywrapcp:
_pywrapcp.DecisionBuilder_swigregister(DecisionBuilder)

class Demon(BaseObject):
    r""" A Demon is the base element of a propagation queue. It is the main   object responsible for implementing the actual propagation   of the constraint and pruning the inconsistent values in the domains   of the variables. The main concept is that demons are listeners that are   attached to the variables and listen to their modifications. There are two methods:  - Run() is the actual method called when the demon is processed.  - priority() returns its priority. Standard priorities are slow, normal    or fast. "immediate" is reserved for variables and is treated separately."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r""" This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables."""
        if self.__class__ == Demon:
            _self = None
        else:
            _self = self
        _pywrapcp.Demon_swiginit(self, _pywrapcp.new_Demon(_self, ))
    __swig_destroy__ = _pywrapcp.delete_Demon

    def RunWrapper(self, s: "Solver") -> "void":
        r""" This is the main callback of the demon."""
        return _pywrapcp.Demon_RunWrapper(self, s)

    def Priority(self) -> "operations_research::Solver::DemonPriority":
        r""" This method returns the priority of the demon. Usually a demon is fast, slow or normal. Immediate demons are reserved for internal use to maintain variables."""
        return _pywrapcp.Demon_Priority(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Demon_DebugString(self)

    def Inhibit(self, s: "Solver") -> "void":
        r""" This method inhibits the demon in the search tree below the current position."""
        return _pywrapcp.Demon_Inhibit(self, s)

    def Desinhibit(self, s: "Solver") -> "void":
        r""" This method un-inhibits the demon that was previously inhibited."""
        return _pywrapcp.Demon_Desinhibit(self, s)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Demon(self)
        return weakref.proxy(self)

# Register Demon in _pywrapcp:
_pywrapcp.Demon_swigregister(Demon)

class Constraint(PropagationBaseObject):
    r""" A constraint is the main modeling object. It provides two methods:   - Post() is responsible for creating the demons and attaching them to     immediate demons().   - InitialPropagate() is called once just after Post and performs     the initial propagation. The subsequent propagations will be performed     by the demons Posted during the post() method."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, solver: "Solver"):
        if self.__class__ == Constraint:
            _self = None
        else:
            _self = self
        _pywrapcp.Constraint_swiginit(self, _pywrapcp.new_Constraint(_self, solver))
    __swig_destroy__ = _pywrapcp.delete_Constraint

    def Post(self) -> "void":
        r""" This method is called when the constraint is processed by the solver. Its main usage is to attach demons to variables."""
        return _pywrapcp.Constraint_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        r""" This method performs the initial propagation of the constraint. It is called just after the post."""
        return _pywrapcp.Constraint_InitialPropagateWrapper(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Constraint_DebugString(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied). It returns nullptr if the constraint does not support this API."""
        return _pywrapcp.Constraint_Var(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.Constraint___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.Constraint___str__(self)

    def __add__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___add__(self, *args)

    def __radd__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___radd__(self, v)

    def __sub__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___sub__(self, *args)

    def __rsub__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___rsub__(self, v)

    def __mul__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___mul__(self, *args)

    def __rmul__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___rmul__(self, v)

    def __floordiv__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___floordiv__(self, v)

    def __neg__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___neg__(self)

    def __abs__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___abs__(self)

    def Square(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint_Square(self)

    def __eq__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___eq__(self, *args)

    def __ne__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___ne__(self, *args)

    def __ge__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___ge__(self, *args)

    def __gt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___gt__(self, *args)

    def __le__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___le__(self, *args)

    def __lt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___lt__(self, *args)

    def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        return _pywrapcp.Constraint_MapTo(self, vars)

    def IndexOf(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint_IndexOf(self, *args)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Constraint(self)
        return weakref.proxy(self)

# Register Constraint in _pywrapcp:
_pywrapcp.Constraint_swigregister(Constraint)

class SearchMonitor(BaseObject):
    r""" A search monitor is a simple set of callbacks to monitor all search events"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, s: "Solver"):
        if self.__class__ == SearchMonitor:
            _self = None
        else:
            _self = self
        _pywrapcp.SearchMonitor_swiginit(self, _pywrapcp.new_SearchMonitor(_self, s))
    __swig_destroy__ = _pywrapcp.delete_SearchMonitor

    def EnterSearch(self) -> "void":
        r""" Beginning of the search."""
        return _pywrapcp.SearchMonitor_EnterSearch(self)

    def RestartSearch(self) -> "void":
        r""" Restart the search."""
        return _pywrapcp.SearchMonitor_RestartSearch(self)

    def ExitSearch(self) -> "void":
        r""" End of the search."""
        return _pywrapcp.SearchMonitor_ExitSearch(self)

    def BeginNextDecision(self, b: "DecisionBuilder") -> "void":
        r""" Before calling DecisionBuilder::Next."""
        return _pywrapcp.SearchMonitor_BeginNextDecision(self, b)

    def EndNextDecision(self, b: "DecisionBuilder", d: "Decision") -> "void":
        r""" After calling DecisionBuilder::Next, along with the returned decision."""
        return _pywrapcp.SearchMonitor_EndNextDecision(self, b, d)

    def ApplyDecision(self, d: "Decision") -> "void":
        r""" Before applying the decision."""
        return _pywrapcp.SearchMonitor_ApplyDecision(self, d)

    def RefuteDecision(self, d: "Decision") -> "void":
        r""" Before refuting the decision."""
        return _pywrapcp.SearchMonitor_RefuteDecision(self, d)

    def AfterDecision(self, d: "Decision", apply: "bool") -> "void":
        r""" Just after refuting or applying the decision, apply is true after Apply. This is called only if the Apply() or Refute() methods have not failed."""
        return _pywrapcp.SearchMonitor_AfterDecision(self, d, apply)

    def BeginFail(self) -> "void":
        r""" Just when the failure occurs."""
        return _pywrapcp.SearchMonitor_BeginFail(self)

    def EndFail(self) -> "void":
        r""" After completing the backtrack."""
        return _pywrapcp.SearchMonitor_EndFail(self)

    def BeginInitialPropagation(self) -> "void":
        r""" Before the initial propagation."""
        return _pywrapcp.SearchMonitor_BeginInitialPropagation(self)

    def EndInitialPropagation(self) -> "void":
        r""" After the initial propagation."""
        return _pywrapcp.SearchMonitor_EndInitialPropagation(self)

    def AcceptSolution(self) -> "bool":
        r""" This method is called when a solution is found. It asserts whether the solution is valid. A value of false indicates that the solution should be discarded."""
        return _pywrapcp.SearchMonitor_AcceptSolution(self)

    def AtSolution(self) -> "bool":
        r""" This method is called when a valid solution is found. If the return value is true, then search will resume after. If the result is false, then search will stop there."""
        return _pywrapcp.SearchMonitor_AtSolution(self)

    def NoMoreSolutions(self) -> "void":
        r""" When the search tree is finished."""
        return _pywrapcp.SearchMonitor_NoMoreSolutions(self)

    def LocalOptimum(self) -> "bool":
        r""" When a local optimum is reached. If 'true' is returned, the last solution is discarded and the search proceeds with the next one."""
        return _pywrapcp.SearchMonitor_LocalOptimum(self)

    def AcceptDelta(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        return _pywrapcp.SearchMonitor_AcceptDelta(self, delta, deltadelta)

    def AcceptNeighbor(self) -> "void":
        r""" After accepting a neighbor during local search."""
        return _pywrapcp.SearchMonitor_AcceptNeighbor(self)

    def solver(self) -> "operations_research::Solver *":
        return _pywrapcp.SearchMonitor_solver(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.SearchMonitor___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.SearchMonitor___str__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_SearchMonitor(self)
        return weakref.proxy(self)

# Register SearchMonitor in _pywrapcp:
_pywrapcp.SearchMonitor_swigregister(SearchMonitor)

class IntExpr(PropagationBaseObject):
    r""" The class IntExpr is the base of all integer expressions in constraint programming. It contains the basic protocol for an expression:   - setting and modifying its bound   - querying if it is bound   - listening to events modifying its bounds   - casting it into a variable (instance of IntVar)"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def Min(self) -> "int64":
        return _pywrapcp.IntExpr_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.IntExpr_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.IntExpr_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.IntExpr_SetMax(self, m)

    def SetRange(self, l: "int64", u: "int64") -> "void":
        r""" This method sets both the min and the max of the expression."""
        return _pywrapcp.IntExpr_SetRange(self, l, u)

    def SetValue(self, v: "int64") -> "void":
        r""" This method sets the value of the expression."""
        return _pywrapcp.IntExpr_SetValue(self, v)

    def Bound(self) -> "bool":
        r""" Returns true if the min and the max of the expression are equal."""
        return _pywrapcp.IntExpr_Bound(self)

    def IsVar(self) -> "bool":
        r""" Returns true if the expression is indeed a variable."""
        return _pywrapcp.IntExpr_IsVar(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Creates a variable from the expression."""
        return _pywrapcp.IntExpr_Var(self)

    def VarWithName(self, name: "std::string const &") -> "operations_research::IntVar *":
        r""" Creates a variable from the expression and set the name of the resulting var. If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name()."""
        return _pywrapcp.IntExpr_VarWithName(self, name)

    def WhenRange(self, *args) -> "void":
        r"""
        *Overload 1:*
        Attach a demon that will watch the min or the max of the expression.

        |

        *Overload 2:*
        Attach a demon that will watch the min or the max of the expression.
        """
        return _pywrapcp.IntExpr_WhenRange(self, *args)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntExpr___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntExpr___str__(self)

    def __add__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___add__(self, *args)

    def __radd__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___radd__(self, v)

    def __sub__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___sub__(self, *args)

    def __rsub__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___rsub__(self, v)

    def __mul__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___mul__(self, *args)

    def __rmul__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___rmul__(self, v)

    def __floordiv__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___floordiv__(self, *args)

    def __mod__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___mod__(self, *args)

    def __neg__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___neg__(self)

    def __abs__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___abs__(self)

    def Square(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr_Square(self)

    def __eq__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___eq__(self, *args)

    def __ne__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___ne__(self, *args)

    def __ge__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___ge__(self, *args)

    def __gt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___gt__(self, *args)

    def __le__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___le__(self, *args)

    def __lt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___lt__(self, *args)

    def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_MapTo(self, vars)

    def IndexOf(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr_IndexOf(self, *args)

    def IsMember(self, values: "std::vector< int64 > const &") -> "operations_research::IntVar *":
        return _pywrapcp.IntExpr_IsMember(self, values)

    def Member(self, values: "std::vector< int64 > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_Member(self, values)

    def NotMember(self, starts: "std::vector< int64 > const &", ends: "std::vector< int64 > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_NotMember(self, starts, ends)

# Register IntExpr in _pywrapcp:
_pywrapcp.IntExpr_swigregister(IntExpr)

class IntVarIterator(BaseObject):
    r""" The class Iterator has two direct subclasses. HoleIterators iterates over all holes, that is value removed between the current min and max of the variable since the last time the variable was processed in the queue. DomainIterators iterates over all elements of the variable domain. Both iterators are not robust to domain changes. Hole iterators can also report values outside the current min and max of the variable. HoleIterators should only be called from a demon attached to the variable that has created this iterator. IntVar* current_var; std::unique_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false)); for (const int64 hole : InitAndGetValues(it)) {   /// use the hole }"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Init(self) -> "void":
        r""" This method must be called before each loop."""
        return _pywrapcp.IntVarIterator_Init(self)

    def Ok(self) -> "bool":
        r""" This method indicates if we can call Value() or not."""
        return _pywrapcp.IntVarIterator_Ok(self)

    def Value(self) -> "int64":
        r""" This method returns the current value of the iterator."""
        return _pywrapcp.IntVarIterator_Value(self)

    def Next(self) -> "void":
        r""" This method moves the iterator to the next value."""
        return _pywrapcp.IntVarIterator_Next(self)

    def DebugString(self) -> "std::string":
        r""" Pretty Print."""
        return _pywrapcp.IntVarIterator_DebugString(self)

    def __iter__(self):
      self.Init()
      return self

    def next(self):
      if self.Ok():
        result = self.Value()
        self.Next()
        return result
      else:
        raise StopIteration()

    def __next__(self):
      return self.next()


# Register IntVarIterator in _pywrapcp:
_pywrapcp.IntVarIterator_swigregister(IntVarIterator)

class IntVar(IntExpr):
    r""" The class IntVar is a subset of IntExpr. In addition to the IntExpr protocol, it offers persistence, removing values from the domains, and a finer model for events."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def IsVar(self) -> "bool":
        return _pywrapcp.IntVar_IsVar(self)

    def Var(self) -> "operations_research::IntVar *":
        return _pywrapcp.IntVar_Var(self)

    def Value(self) -> "int64":
        r""" This method returns the value of the variable. This method checks before that the variable is bound."""
        return _pywrapcp.IntVar_Value(self)

    def RemoveValue(self, v: "int64") -> "void":
        r""" This method removes the value 'v' from the domain of the variable."""
        return _pywrapcp.IntVar_RemoveValue(self, v)

    def RemoveInterval(self, l: "int64", u: "int64") -> "void":
        r""" This method removes the interval 'l' .. 'u' from the domain of the variable. It assumes that 'l' <= 'u'."""
        return _pywrapcp.IntVar_RemoveInterval(self, l, u)

    def RemoveValues(self, values: "std::vector< int64 > const &") -> "void":
        r""" This method remove the values from the domain of the variable."""
        return _pywrapcp.IntVar_RemoveValues(self, values)

    def SetValues(self, values: "std::vector< int64 > const &") -> "void":
        r""" This method intersects the current domain with the values in the array."""
        return _pywrapcp.IntVar_SetValues(self, values)

    def WhenBound(self, *args) -> "void":
        r"""
        *Overload 1:*
        This method attaches a demon that will be awakened when the variable is bound.

        |

        *Overload 2:*
        This method attaches a closure that will be awakened when the variable is bound.
        """
        return _pywrapcp.IntVar_WhenBound(self, *args)

    def WhenDomain(self, *args) -> "void":
        r"""
        *Overload 1:*
        This method attaches a demon that will watch any domain modification of the domain of the variable.

        |

        *Overload 2:*
        This method attaches a closure that will watch any domain modification of the domain of the variable.
        """
        return _pywrapcp.IntVar_WhenDomain(self, *args)

    def Size(self) -> "uint64":
        r""" This method returns the number of values in the domain of the variable."""
        return _pywrapcp.IntVar_Size(self)

    def Contains(self, v: "int64") -> "bool":
        r""" This method returns whether the value 'v' is in the domain of the variable."""
        return _pywrapcp.IntVar_Contains(self, v)

    def HoleIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        r""" Creates a hole iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
        return _pywrapcp.IntVar_HoleIteratorAux(self, reversible)

    def DomainIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        r""" Creates a domain iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
        return _pywrapcp.IntVar_DomainIteratorAux(self, reversible)

    def OldMin(self) -> "int64":
        r""" Returns the previous min."""
        return _pywrapcp.IntVar_OldMin(self)

    def OldMax(self) -> "int64":
        r""" Returns the previous max."""
        return _pywrapcp.IntVar_OldMax(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntVar___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntVar___str__(self)

    def DomainIterator(self):
      return iter(self.DomainIteratorAux(False))

    def HoleIterator(self):
      return iter(self.HoleIteratorAux(False))


# Register IntVar in _pywrapcp:
_pywrapcp.IntVar_swigregister(IntVar)

class SolutionCollector(SearchMonitor):
    r""" This class is the root class of all solution collectors. It implements a basic query API to be used independently of the collector used."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def DebugString(self) -> "std::string":
        return _pywrapcp.SolutionCollector_DebugString(self)

    def Add(self, *args) -> "void":
        return _pywrapcp.SolutionCollector_Add(self, *args)

    def AddObjective(self, objective: "IntVar") -> "void":
        return _pywrapcp.SolutionCollector_AddObjective(self, objective)

    def EnterSearch(self) -> "void":
        r""" Beginning of the search."""
        return _pywrapcp.SolutionCollector_EnterSearch(self)

    def SolutionCount(self) -> "int":
        r""" Returns how many solutions were stored during the search."""
        return _pywrapcp.SolutionCollector_SolutionCount(self)

    def Solution(self, n: "int") -> "operations_research::Assignment *":
        r""" Returns the nth solution."""
        return _pywrapcp.SolutionCollector_Solution(self, n)

    def WallTime(self, n: "int") -> "int64":
        r""" Returns the wall time in ms for the nth solution."""
        return _pywrapcp.SolutionCollector_WallTime(self, n)

    def Branches(self, n: "int") -> "int64":
        r""" Returns the number of branches when the nth solution was found."""
        return _pywrapcp.SolutionCollector_Branches(self, n)

    def Failures(self, n: "int") -> "int64":
        r""" Returns the number of failures encountered at the time of the nth solution."""
        return _pywrapcp.SolutionCollector_Failures(self, n)

    def ObjectiveValue(self, n: "int") -> "int64":
        r""" Returns the objective value of the nth solution."""
        return _pywrapcp.SolutionCollector_ObjectiveValue(self, n)

    def Value(self, n: "int", var: "IntVar") -> "int64":
        r""" This is a shortcut to get the Value of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_Value(self, n, var)

    def StartValue(self, n: "int", var: "IntervalVar") -> "int64":
        r""" This is a shortcut to get the StartValue of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_StartValue(self, n, var)

    def EndValue(self, n: "int", var: "IntervalVar") -> "int64":
        r""" This is a shortcut to get the EndValue of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_EndValue(self, n, var)

    def DurationValue(self, n: "int", var: "IntervalVar") -> "int64":
        r""" This is a shortcut to get the DurationValue of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_DurationValue(self, n, var)

    def PerformedValue(self, n: "int", var: "IntervalVar") -> "int64":
        r""" This is a shortcut to get the PerformedValue of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_PerformedValue(self, n, var)

    def ForwardSequence(self, n: "int", var: "SequenceVar") -> "std::vector< int > const &":
        r""" This is a shortcut to get the ForwardSequence of 'var' in the nth solution. The forward sequence is the list of ranked interval variables starting from the start of the sequence."""
        return _pywrapcp.SolutionCollector_ForwardSequence(self, n, var)

    def BackwardSequence(self, n: "int", var: "SequenceVar") -> "std::vector< int > const &":
        r""" This is a shortcut to get the BackwardSequence of 'var' in the nth solution. The backward sequence is the list of ranked interval variables starting from the end of the sequence."""
        return _pywrapcp.SolutionCollector_BackwardSequence(self, n, var)

    def Unperformed(self, n: "int", var: "SequenceVar") -> "std::vector< int > const &":
        r""" This is a shortcut to get the list of unperformed of 'var' in the nth solution."""
        return _pywrapcp.SolutionCollector_Unperformed(self, n, var)

# Register SolutionCollector in _pywrapcp:
_pywrapcp.SolutionCollector_swigregister(SolutionCollector)

class OptimizeVar(SearchMonitor):
    r""" This class encapsulates an objective. It requires the direction (minimize or maximize), the variable to optimize, and the improvement step."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Best(self) -> "int64":
        r""" Returns the best value found during search."""
        return _pywrapcp.OptimizeVar_Best(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Returns the variable that is optimized."""
        return _pywrapcp.OptimizeVar_Var(self)

    def AcceptDelta(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        r""" Internal methods."""
        return _pywrapcp.OptimizeVar_AcceptDelta(self, delta, deltadelta)

    def EnterSearch(self) -> "void":
        return _pywrapcp.OptimizeVar_EnterSearch(self)

    def BeginNextDecision(self, db: "DecisionBuilder") -> "void":
        return _pywrapcp.OptimizeVar_BeginNextDecision(self, db)

    def RefuteDecision(self, d: "Decision") -> "void":
        return _pywrapcp.OptimizeVar_RefuteDecision(self, d)

    def AtSolution(self) -> "bool":
        return _pywrapcp.OptimizeVar_AtSolution(self)

    def AcceptSolution(self) -> "bool":
        return _pywrapcp.OptimizeVar_AcceptSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.OptimizeVar_DebugString(self)

# Register OptimizeVar in _pywrapcp:
_pywrapcp.OptimizeVar_swigregister(OptimizeVar)

class SearchLimit(SearchMonitor):
    r""" Base class of all search limits."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_SearchLimit

    def Crossed(self) -> "bool":
        r""" Returns true if the limit has been crossed."""
        return _pywrapcp.SearchLimit_Crossed(self)

    def Check(self) -> "bool":
        r""" This method is called to check the status of the limit. A return value of true indicates that we have indeed crossed the limit. In that case, this method will not be called again and the remaining search will be discarded."""
        return _pywrapcp.SearchLimit_Check(self)

    def Init(self) -> "void":
        r""" This method is called when the search limit is initialized."""
        return _pywrapcp.SearchLimit_Init(self)

    def EnterSearch(self) -> "void":
        r""" Internal methods."""
        return _pywrapcp.SearchLimit_EnterSearch(self)

    def BeginNextDecision(self, b: "DecisionBuilder") -> "void":
        return _pywrapcp.SearchLimit_BeginNextDecision(self, b)

    def RefuteDecision(self, d: "Decision") -> "void":
        return _pywrapcp.SearchLimit_RefuteDecision(self, d)

    def DebugString(self) -> "std::string":
        return _pywrapcp.SearchLimit_DebugString(self)

# Register SearchLimit in _pywrapcp:
_pywrapcp.SearchLimit_swigregister(SearchLimit)

class IntervalVar(PropagationBaseObject):
    r""" Interval variables are often used in scheduling. The main characteristics of an IntervalVar are the start position, duration, and end date. All these characteristics can be queried and set, and demons can be posted on their modifications. An important aspect is optionality: an IntervalVar can be performed or not. If unperformed, then it simply does not exist, and its characteristics cannot be accessed any more. An interval var is automatically marked as unperformed when it is not consistent anymore (start greater than end, duration < 0...)"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def StartMin(self) -> "int64":
        r""" These methods query, set, and watch the start position of the interval var."""
        return _pywrapcp.IntervalVar_StartMin(self)

    def StartMax(self) -> "int64":
        return _pywrapcp.IntervalVar_StartMax(self)

    def SetStartMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartMin(self, m)

    def SetStartMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartMax(self, m)

    def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartRange(self, mi, ma)

    def OldStartMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldStartMin(self)

    def OldStartMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldStartMax(self)

    def WhenStartRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenStartRange(self, *args)

    def WhenStartBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenStartBound(self, *args)

    def DurationMin(self) -> "int64":
        r""" These methods query, set, and watch the duration of the interval var."""
        return _pywrapcp.IntervalVar_DurationMin(self)

    def DurationMax(self) -> "int64":
        return _pywrapcp.IntervalVar_DurationMax(self)

    def SetDurationMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationMin(self, m)

    def SetDurationMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationMax(self, m)

    def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationRange(self, mi, ma)

    def OldDurationMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldDurationMin(self)

    def OldDurationMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldDurationMax(self)

    def WhenDurationRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenDurationRange(self, *args)

    def WhenDurationBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenDurationBound(self, *args)

    def EndMin(self) -> "int64":
        r""" These methods query, set, and watch the end position of the interval var."""
        return _pywrapcp.IntervalVar_EndMin(self)

    def EndMax(self) -> "int64":
        return _pywrapcp.IntervalVar_EndMax(self)

    def SetEndMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndMin(self, m)

    def SetEndMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndMax(self, m)

    def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndRange(self, mi, ma)

    def OldEndMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldEndMin(self)

    def OldEndMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldEndMax(self)

    def WhenEndRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenEndRange(self, *args)

    def WhenEndBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenEndBound(self, *args)

    def MustBePerformed(self) -> "bool":
        r""" These methods query, set, and watch the performed status of the interval var."""
        return _pywrapcp.IntervalVar_MustBePerformed(self)

    def MayBePerformed(self) -> "bool":
        return _pywrapcp.IntervalVar_MayBePerformed(self)

    def CannotBePerformed(self) -> "bool":
        return _pywrapcp.IntervalVar_CannotBePerformed(self)

    def IsPerformedBound(self) -> "bool":
        return _pywrapcp.IntervalVar_IsPerformedBound(self)

    def SetPerformed(self, val: "bool") -> "void":
        return _pywrapcp.IntervalVar_SetPerformed(self, val)

    def WasPerformedBound(self) -> "bool":
        return _pywrapcp.IntervalVar_WasPerformedBound(self)

    def WhenPerformedBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenPerformedBound(self, *args)

    def WhenAnything(self, *args) -> "void":
        r"""
        *Overload 1:*
        Attaches a demon awakened when anything about this interval changes.

        |

        *Overload 2:*
        Attaches a closure awakened when anything about this interval changes.
        """
        return _pywrapcp.IntervalVar_WhenAnything(self, *args)

    def StartExpr(self) -> "operations_research::IntExpr *":
        r""" These methods create expressions encapsulating the start, end and duration of the interval var. Please note that these must not be used if the interval var is unperformed."""
        return _pywrapcp.IntervalVar_StartExpr(self)

    def DurationExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_DurationExpr(self)

    def EndExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_EndExpr(self)

    def PerformedExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_PerformedExpr(self)

    def SafeStartExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        r""" These methods create expressions encapsulating the start, end and duration of the interval var. If the interval var is unperformed, they will return the unperformed_value."""
        return _pywrapcp.IntervalVar_SafeStartExpr(self, unperformed_value)

    def SafeDurationExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_SafeDurationExpr(self, unperformed_value)

    def SafeEndExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_SafeEndExpr(self, unperformed_value)

    def EndsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterEnd(self, other)

    def EndsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterEndWithDelay(self, other, delay)

    def EndsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterStart(self, other)

    def EndsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterStartWithDelay(self, other, delay)

    def EndsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtEnd(self, other)

    def EndsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtEndWithDelay(self, other, delay)

    def EndsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtStart(self, other)

    def EndsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtStartWithDelay(self, other, delay)

    def StartsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterEnd(self, other)

    def StartsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterEndWithDelay(self, other, delay)

    def StartsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterStart(self, other)

    def StartsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterStartWithDelay(self, other, delay)

    def StartsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtEnd(self, other)

    def StartsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtEndWithDelay(self, other, delay)

    def StartsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtStart(self, other)

    def StartsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtStartWithDelay(self, other, delay)

    def StaysInSync(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StaysInSync(self, other)

    def StaysInSyncWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StaysInSyncWithDelay(self, other, delay)

    def EndsAfter(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfter(self, date)

    def EndsAt(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAt(self, date)

    def EndsBefore(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsBefore(self, date)

    def StartsAfter(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfter(self, date)

    def StartsAt(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAt(self, date)

    def StartsBefore(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsBefore(self, date)

    def CrossesDate(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_CrossesDate(self, date)

    def AvoidsDate(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_AvoidsDate(self, date)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntervalVar___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntervalVar___str__(self)

# Register IntervalVar in _pywrapcp:
_pywrapcp.IntervalVar_swigregister(IntervalVar)

class SequenceVar(PropagationBaseObject):
    r""" A sequence variable is a variable whose domain is a set of possible orderings of the interval variables. It allows ordering of tasks. It has two sets of methods: ComputePossibleFirstsAndLasts(), which returns the list of interval variables that can be ranked first or last; and RankFirst/RankNotFirst/RankLast/RankNotLast, which can be used to create the search decision."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")

    def DebugString(self) -> "std::string":
        return _pywrapcp.SequenceVar_DebugString(self)

    def RankFirst(self, index: "int") -> "void":
        r""" Ranks the index_th interval var first of all unranked interval vars. After that, it will no longer be considered ranked."""
        return _pywrapcp.SequenceVar_RankFirst(self, index)

    def RankNotFirst(self, index: "int") -> "void":
        r""" Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars."""
        return _pywrapcp.SequenceVar_RankNotFirst(self, index)

    def RankLast(self, index: "int") -> "void":
        r""" Ranks the index_th interval var first of all unranked interval vars. After that, it will no longer be considered ranked."""
        return _pywrapcp.SequenceVar_RankLast(self, index)

    def RankNotLast(self, index: "int") -> "void":
        r""" Indicates that the index_th interval var will not be ranked first of all currently unranked interval vars."""
        return _pywrapcp.SequenceVar_RankNotLast(self, index)

    def Interval(self, index: "int") -> "operations_research::IntervalVar *":
        r""" Returns the index_th interval of the sequence."""
        return _pywrapcp.SequenceVar_Interval(self, index)

    def Next(self, index: "int") -> "operations_research::IntVar *":
        r""" Returns the next of the index_th interval of the sequence."""
        return _pywrapcp.SequenceVar_Next(self, index)

    def Size(self) -> "int64":
        r""" Returns the number of interval vars in the sequence."""
        return _pywrapcp.SequenceVar_Size(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.SequenceVar___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.SequenceVar___str__(self)

# Register SequenceVar in _pywrapcp:
_pywrapcp.SequenceVar_swigregister(SequenceVar)

class AssignmentElement(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Activate(self) -> "void":
        return _pywrapcp.AssignmentElement_Activate(self)

    def Deactivate(self) -> "void":
        return _pywrapcp.AssignmentElement_Deactivate(self)

    def Activated(self) -> "bool":
        return _pywrapcp.AssignmentElement_Activated(self)
    __swig_destroy__ = _pywrapcp.delete_AssignmentElement

# Register AssignmentElement in _pywrapcp:
_pywrapcp.AssignmentElement_swigregister(AssignmentElement)

class IntVarElement(AssignmentElement):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Var(self) -> "operations_research::IntVar *":
        return _pywrapcp.IntVarElement_Var(self)

    def Min(self) -> "int64":
        return _pywrapcp.IntVarElement_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.IntVarElement_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetMax(self, m)

    def Value(self) -> "int64":
        return _pywrapcp.IntVarElement_Value(self)

    def Bound(self) -> "bool":
        return _pywrapcp.IntVarElement_Bound(self)

    def SetRange(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetRange(self, l, u)

    def SetValue(self, v: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetValue(self, v)

    def __eq__(self, element: "IntVarElement") -> "bool":
        return _pywrapcp.IntVarElement___eq__(self, element)

    def __ne__(self, element: "IntVarElement") -> "bool":
        return _pywrapcp.IntVarElement___ne__(self, element)
    __swig_destroy__ = _pywrapcp.delete_IntVarElement

# Register IntVarElement in _pywrapcp:
_pywrapcp.IntVarElement_swigregister(IntVarElement)

class IntervalVarElement(AssignmentElement):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Var(self) -> "operations_research::IntervalVar *":
        return _pywrapcp.IntervalVarElement_Var(self)

    def StartMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartMin(self)

    def StartMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartMax(self)

    def StartValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartValue(self)

    def DurationMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationMin(self)

    def DurationMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationMax(self)

    def DurationValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationValue(self)

    def EndMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndMin(self)

    def EndMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndMax(self)

    def EndValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndValue(self)

    def PerformedMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedMin(self)

    def PerformedMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedMax(self)

    def PerformedValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedValue(self)

    def SetStartMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartMin(self, m)

    def SetStartMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartMax(self, m)

    def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartRange(self, mi, ma)

    def SetStartValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartValue(self, v)

    def SetDurationMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationMin(self, m)

    def SetDurationMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationMax(self, m)

    def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationRange(self, mi, ma)

    def SetDurationValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationValue(self, v)

    def SetEndMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndMin(self, m)

    def SetEndMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndMax(self, m)

    def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndRange(self, mi, ma)

    def SetEndValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndValue(self, v)

    def SetPerformedMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedMin(self, m)

    def SetPerformedMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedMax(self, m)

    def SetPerformedRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedRange(self, mi, ma)

    def SetPerformedValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedValue(self, v)

    def __eq__(self, element: "IntervalVarElement") -> "bool":
        return _pywrapcp.IntervalVarElement___eq__(self, element)

    def __ne__(self, element: "IntervalVarElement") -> "bool":
        return _pywrapcp.IntervalVarElement___ne__(self, element)
    __swig_destroy__ = _pywrapcp.delete_IntervalVarElement

# Register IntervalVarElement in _pywrapcp:
_pywrapcp.IntervalVarElement_swigregister(IntervalVarElement)

class SequenceVarElement(AssignmentElement):
    r""" The SequenceVarElement stores a partial representation of ranked interval variables in the underlying sequence variable. This representation consists of three vectors:   - the forward sequence. That is the list of interval variables     ranked first in the sequence.  The first element of the backward     sequence is the first interval in the sequence variable.   - the backward sequence. That is the list of interval variables     ranked last in the sequence. The first element of the backward     sequence is the last interval in the sequence variable.   - The list of unperformed interval variables.  Furthermore, if all performed variables are ranked, then by  convention, the forward_sequence will contain all such variables  and the backward_sequence will be empty."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Var(self) -> "operations_research::SequenceVar *":
        return _pywrapcp.SequenceVarElement_Var(self)

    def ForwardSequence(self) -> "std::vector< int > const &":
        return _pywrapcp.SequenceVarElement_ForwardSequence(self)

    def BackwardSequence(self) -> "std::vector< int > const &":
        return _pywrapcp.SequenceVarElement_BackwardSequence(self)

    def Unperformed(self) -> "std::vector< int > const &":
        return _pywrapcp.SequenceVarElement_Unperformed(self)

    def SetSequence(self, forward_sequence: "std::vector< int > const &", backward_sequence: "std::vector< int > const &", unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.SequenceVarElement_SetSequence(self, forward_sequence, backward_sequence, unperformed)

    def SetForwardSequence(self, forward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.SequenceVarElement_SetForwardSequence(self, forward_sequence)

    def SetBackwardSequence(self, backward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.SequenceVarElement_SetBackwardSequence(self, backward_sequence)

    def SetUnperformed(self, unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.SequenceVarElement_SetUnperformed(self, unperformed)

    def __eq__(self, element: "SequenceVarElement") -> "bool":
        return _pywrapcp.SequenceVarElement___eq__(self, element)

    def __ne__(self, element: "SequenceVarElement") -> "bool":
        return _pywrapcp.SequenceVarElement___ne__(self, element)
    __swig_destroy__ = _pywrapcp.delete_SequenceVarElement

# Register SequenceVarElement in _pywrapcp:
_pywrapcp.SequenceVarElement_swigregister(SequenceVarElement)

class Assignment(PropagationBaseObject):
    r""" An Assignment is a variable -> domains mapping, used to report solutions to the user."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Clear(self) -> "void":
        return _pywrapcp.Assignment_Clear(self)

    def Empty(self) -> "bool":
        return _pywrapcp.Assignment_Empty(self)

    def Size(self) -> "int":
        return _pywrapcp.Assignment_Size(self)

    def NumIntVars(self) -> "int":
        return _pywrapcp.Assignment_NumIntVars(self)

    def NumIntervalVars(self) -> "int":
        return _pywrapcp.Assignment_NumIntervalVars(self)

    def NumSequenceVars(self) -> "int":
        return _pywrapcp.Assignment_NumSequenceVars(self)

    def Store(self) -> "void":
        return _pywrapcp.Assignment_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.Assignment_Restore(self)

    def Load(self, *args) -> "void":
        return _pywrapcp.Assignment_Load(self, *args)

    def Save(self, *args) -> "void":
        return _pywrapcp.Assignment_Save(self, *args)

    def AddObjective(self, v: "IntVar") -> "void":
        return _pywrapcp.Assignment_AddObjective(self, v)

    def Objective(self) -> "operations_research::IntVar *":
        return _pywrapcp.Assignment_Objective(self)

    def HasObjective(self) -> "bool":
        return _pywrapcp.Assignment_HasObjective(self)

    def ObjectiveMin(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveMin(self)

    def ObjectiveMax(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveMax(self)

    def ObjectiveValue(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveValue(self)

    def ObjectiveBound(self) -> "bool":
        return _pywrapcp.Assignment_ObjectiveBound(self)

    def SetObjectiveMin(self, m: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveMin(self, m)

    def SetObjectiveMax(self, m: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveMax(self, m)

    def SetObjectiveValue(self, value: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveValue(self, value)

    def SetObjectiveRange(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveRange(self, l, u)

    def Min(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Min(self, var)

    def Max(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Max(self, var)

    def Value(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Value(self, var)

    def Bound(self, var: "IntVar") -> "bool":
        return _pywrapcp.Assignment_Bound(self, var)

    def SetMin(self, var: "IntVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetMin(self, var, m)

    def SetMax(self, var: "IntVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetMax(self, var, m)

    def SetRange(self, var: "IntVar", l: "int64", u: "int64") -> "void":
        return _pywrapcp.Assignment_SetRange(self, var, l, u)

    def SetValue(self, var: "IntVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetValue(self, var, value)

    def StartMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartMin(self, var)

    def StartMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartMax(self, var)

    def StartValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartValue(self, var)

    def DurationMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationMin(self, var)

    def DurationMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationMax(self, var)

    def DurationValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationValue(self, var)

    def EndMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndMin(self, var)

    def EndMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndMax(self, var)

    def EndValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndValue(self, var)

    def PerformedMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedMin(self, var)

    def PerformedMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedMax(self, var)

    def PerformedValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedValue(self, var)

    def SetStartMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartMin(self, var, m)

    def SetStartMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartMax(self, var, m)

    def SetStartRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartRange(self, var, mi, ma)

    def SetStartValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartValue(self, var, value)

    def SetDurationMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationMin(self, var, m)

    def SetDurationMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationMax(self, var, m)

    def SetDurationRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationRange(self, var, mi, ma)

    def SetDurationValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationValue(self, var, value)

    def SetEndMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndMin(self, var, m)

    def SetEndMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndMax(self, var, m)

    def SetEndRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndRange(self, var, mi, ma)

    def SetEndValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndValue(self, var, value)

    def SetPerformedMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedMin(self, var, m)

    def SetPerformedMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedMax(self, var, m)

    def SetPerformedRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedRange(self, var, mi, ma)

    def SetPerformedValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedValue(self, var, value)

    def Add(self, *args) -> "void":
        return _pywrapcp.Assignment_Add(self, *args)

    def ForwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_ForwardSequence(self, var)

    def BackwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_BackwardSequence(self, var)

    def Unperformed(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_Unperformed(self, var)

    def SetSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &", backward_sequence: "std::vector< int > const &", unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetSequence(self, var, forward_sequence, backward_sequence, unperformed)

    def SetForwardSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetForwardSequence(self, var, forward_sequence)

    def SetBackwardSequence(self, var: "SequenceVar", backward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetBackwardSequence(self, var, backward_sequence)

    def SetUnperformed(self, var: "SequenceVar", unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetUnperformed(self, var, unperformed)

    def Activate(self, *args) -> "void":
        return _pywrapcp.Assignment_Activate(self, *args)

    def Deactivate(self, *args) -> "void":
        return _pywrapcp.Assignment_Deactivate(self, *args)

    def Activated(self, *args) -> "bool":
        return _pywrapcp.Assignment_Activated(self, *args)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Assignment_DebugString(self)

    def IntVarContainer(self) -> "operations_research::Assignment::IntContainer const &":
        return _pywrapcp.Assignment_IntVarContainer(self)

    def MutableIntVarContainer(self) -> "operations_research::Assignment::IntContainer *":
        return _pywrapcp.Assignment_MutableIntVarContainer(self)

    def IntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer const &":
        return _pywrapcp.Assignment_IntervalVarContainer(self)

    def MutableIntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer *":
        return _pywrapcp.Assignment_MutableIntervalVarContainer(self)

    def SequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer const &":
        return _pywrapcp.Assignment_SequenceVarContainer(self)

    def MutableSequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer *":
        return _pywrapcp.Assignment_MutableSequenceVarContainer(self)

    def __eq__(self, assignment: "Assignment") -> "bool":
        return _pywrapcp.Assignment___eq__(self, assignment)

    def __ne__(self, assignment: "Assignment") -> "bool":
        return _pywrapcp.Assignment___ne__(self, assignment)

# Register Assignment in _pywrapcp:
_pywrapcp.Assignment_swigregister(Assignment)


def __lshift__(*args) -> "std::ostream &":
    return _pywrapcp.__lshift__(*args)
class Pack(Constraint):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def AddWeightedSumLessOrEqualConstantDimension(self, *args) -> "void":
        r"""
        *Overload 1:*
        Dimensions are additional constraints than can restrict what is possible with the pack constraint. It can be used to set capacity limits, to count objects per bin, to compute unassigned penalties... This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is less or equal 'bounds[b]'.

        |

        *Overload 2:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i)) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.

        |

        *Overload 3:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.
        """
        return _pywrapcp.Pack_AddWeightedSumLessOrEqualConstantDimension(self, *args)

    def AddWeightedSumEqualVarDimension(self, *args) -> "void":
        r"""
        *Overload 1:*
        This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].

        |

        *Overload 2:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b)) of all objects i assigned to 'b' is equal to loads[b].
        """
        return _pywrapcp.Pack_AddWeightedSumEqualVarDimension(self, *args)

    def AddSumVariableWeightsLessOrEqualConstantDimension(self, usage: "std::vector< operations_research::IntVar * > const &", capacity: "std::vector< int64 > const &") -> "void":
        r""" This dimension imposes: forall b in bins,    sum (i in items: usage[i] * is_assigned(i, b)) <= capacity[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b. This can be used to model shapes of items by linking variables of the same item on parallel dimensions with an allowed assignment constraint."""
        return _pywrapcp.Pack_AddSumVariableWeightsLessOrEqualConstantDimension(self, usage, capacity)

    def AddWeightedSumOfAssignedDimension(self, weights: "std::vector< int64 > const &", cost_var: "IntVar") -> "void":
        r""" This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin."""
        return _pywrapcp.Pack_AddWeightedSumOfAssignedDimension(self, weights, cost_var)

    def AddCountUsedBinDimension(self, count_var: "IntVar") -> "void":
        r""" This dimension links 'count_var' to the actual number of bins used in the pack."""
        return _pywrapcp.Pack_AddCountUsedBinDimension(self, count_var)

    def AddCountAssignedItemsDimension(self, count_var: "IntVar") -> "void":
        r""" This dimension links 'count_var' to the actual number of items assigned to a bin in the pack."""
        return _pywrapcp.Pack_AddCountAssignedItemsDimension(self, count_var)

    def Post(self) -> "void":
        return _pywrapcp.Pack_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        return _pywrapcp.Pack_InitialPropagateWrapper(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Pack_DebugString(self)

# Register Pack in _pywrapcp:
_pywrapcp.Pack_swigregister(Pack)

class DisjunctiveConstraint(Constraint):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def SequenceVar(self) -> "operations_research::SequenceVar *":
        r""" Creates a sequence variable from the constraint."""
        return _pywrapcp.DisjunctiveConstraint_SequenceVar(self)

    def SetTransitionTime(self, transition_time: "operations_research::Solver::IndexEvaluator2") -> "void":
        r""" Add a transition time between intervals.  It forces the distance between the end of interval a and start of interval b that follows it to be at least transition_time(a, b). This function must always return a positive or null value."""
        return _pywrapcp.DisjunctiveConstraint_SetTransitionTime(self, transition_time)

    def TransitionTime(self, before_index: "int", after_index: "int") -> "int64":
        return _pywrapcp.DisjunctiveConstraint_TransitionTime(self, before_index, after_index)

# Register DisjunctiveConstraint in _pywrapcp:
_pywrapcp.DisjunctiveConstraint_swigregister(DisjunctiveConstraint)

class RevInteger(object):
    r""" This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree.  Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "long long const &"):
        _pywrapcp.RevInteger_swiginit(self, _pywrapcp.new_RevInteger(val))

    def Value(self) -> "long long const &":
        return _pywrapcp.RevInteger_Value(self)

    def SetValue(self, s: "Solver", val: "long long const &") -> "void":
        return _pywrapcp.RevInteger_SetValue(self, s, val)
    __swig_destroy__ = _pywrapcp.delete_RevInteger

# Register RevInteger in _pywrapcp:
_pywrapcp.RevInteger_swigregister(RevInteger)

class NumericalRevInteger(RevInteger):
    r""" Subclass of Rev<T> which adds numerical operations."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "long long const &"):
        _pywrapcp.NumericalRevInteger_swiginit(self, _pywrapcp.new_NumericalRevInteger(val))

    def Add(self, s: "Solver", to_add: "long long const &") -> "void":
        return _pywrapcp.NumericalRevInteger_Add(self, s, to_add)

    def Incr(self, s: "Solver") -> "void":
        return _pywrapcp.NumericalRevInteger_Incr(self, s)

    def Decr(self, s: "Solver") -> "void":
        return _pywrapcp.NumericalRevInteger_Decr(self, s)
    __swig_destroy__ = _pywrapcp.delete_NumericalRevInteger

# Register NumericalRevInteger in _pywrapcp:
_pywrapcp.NumericalRevInteger_swigregister(NumericalRevInteger)

class RevBool(object):
    r""" This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree.  Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "bool const &"):
        _pywrapcp.RevBool_swiginit(self, _pywrapcp.new_RevBool(val))

    def Value(self) -> "bool const &":
        return _pywrapcp.RevBool_Value(self)

    def SetValue(self, s: "Solver", val: "bool const &") -> "void":
        return _pywrapcp.RevBool_SetValue(self, s, val)
    __swig_destroy__ = _pywrapcp.delete_RevBool

# Register RevBool in _pywrapcp:
_pywrapcp.RevBool_swigregister(RevBool)

class IntVarContainer(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Contains(self, var: "IntVar") -> "bool":
        return _pywrapcp.IntVarContainer_Contains(self, var)

    def Element(self, index: "int") -> "operations_research::IntVarElement *":
        return _pywrapcp.IntVarContainer_Element(self, index)

    def Size(self) -> "int":
        return _pywrapcp.IntVarContainer_Size(self)

    def Store(self) -> "void":
        return _pywrapcp.IntVarContainer_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.IntVarContainer_Restore(self)

    def __eq__(self, container: "IntVarContainer") -> "bool":
        r""" Returns true if this and 'container' both represent the same V* -> E map. Runs in linear time; requires that the == operator on the type E is well defined."""
        return _pywrapcp.IntVarContainer___eq__(self, container)

    def __ne__(self, container: "IntVarContainer") -> "bool":
        return _pywrapcp.IntVarContainer___ne__(self, container)
    __swig_destroy__ = _pywrapcp.delete_IntVarContainer

# Register IntVarContainer in _pywrapcp:
_pywrapcp.IntVarContainer_swigregister(IntVarContainer)

class IntervalVarContainer(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Contains(self, var: "IntervalVar") -> "bool":
        return _pywrapcp.IntervalVarContainer_Contains(self, var)

    def Element(self, index: "int") -> "operations_research::IntervalVarElement *":
        return _pywrapcp.IntervalVarContainer_Element(self, index)

    def Size(self) -> "int":
        return _pywrapcp.IntervalVarContainer_Size(self)

    def Store(self) -> "void":
        return _pywrapcp.IntervalVarContainer_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.IntervalVarContainer_Restore(self)

    def __eq__(self, container: "IntervalVarContainer") -> "bool":
        r""" Returns true if this and 'container' both represent the same V* -> E map. Runs in linear time; requires that the == operator on the type E is well defined."""
        return _pywrapcp.IntervalVarContainer___eq__(self, container)

    def __ne__(self, container: "IntervalVarContainer") -> "bool":
        return _pywrapcp.IntervalVarContainer___ne__(self, container)
    __swig_destroy__ = _pywrapcp.delete_IntervalVarContainer

# Register IntervalVarContainer in _pywrapcp:
_pywrapcp.IntervalVarContainer_swigregister(IntervalVarContainer)

class SequenceVarContainer(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Contains(self, var: "SequenceVar") -> "bool":
        return _pywrapcp.SequenceVarContainer_Contains(self, var)

    def Element(self, index: "int") -> "operations_research::SequenceVarElement *":
        return _pywrapcp.SequenceVarContainer_Element(self, index)

    def Size(self) -> "int":
        return _pywrapcp.SequenceVarContainer_Size(self)

    def Store(self) -> "void":
        return _pywrapcp.SequenceVarContainer_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.SequenceVarContainer_Restore(self)

    def __eq__(self, container: "SequenceVarContainer") -> "bool":
        r""" Returns true if this and 'container' both represent the same V* -> E map. Runs in linear time; requires that the == operator on the type E is well defined."""
        return _pywrapcp.SequenceVarContainer___eq__(self, container)

    def __ne__(self, container: "SequenceVarContainer") -> "bool":
        return _pywrapcp.SequenceVarContainer___ne__(self, container)
    __swig_destroy__ = _pywrapcp.delete_SequenceVarContainer

# Register SequenceVarContainer in _pywrapcp:
_pywrapcp.SequenceVarContainer_swigregister(SequenceVarContainer)

class LocalSearchOperator(BaseObject):
    r""" This class represent a reversible FIFO structure. The main difference w.r.t a standard FIFO structure is that a Solver is given as parameter to the modifiers such that the solver can store the backtrack information Iterator's traversing order should not be changed, as some algorithm depend on it to be consistent. It's main use is to store a list of demons in the various classes of variables. The base class for all local search operators. A local search operator is an object that defines the neighborhood of a solution. In other words, a neighborhood is the set of solutions which can be reached from a given solution using an operator. The behavior of the LocalSearchOperator class is similar to iterators. The operator is synchronized with an assignment (gives the current values of the variables); this is done in the Start() method. Then one can iterate over the neighbors using the MakeNextNeighbor method. This method returns an assignment which represents the incremental changes to the current solution. It also returns a second assignment representing the changes to the last solution defined by the neighborhood operator; this assignment is empty if the neighborhood operator cannot track this information."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        return _pywrapcp.LocalSearchOperator_NextNeighbor(self, delta, deltadelta)

    def Start(self, assignment: "Assignment") -> "void":
        return _pywrapcp.LocalSearchOperator_Start(self, assignment)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_LocalSearchOperator(self)
        return weakref.proxy(self)

# Register LocalSearchOperator in _pywrapcp:
_pywrapcp.LocalSearchOperator_swigregister(LocalSearchOperator)

class IntVarLocalSearchOperatorTemplate(LocalSearchOperator):
    r""" Base operator class for operators manipulating variables."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Start(self, assignment: "Assignment") -> "void":
        r""" This method should not be overridden. Override OnStart() instead which is called before exiting this method."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Start(self, assignment)

    def IsIncremental(self) -> "bool":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_IsIncremental(self)

    def Size(self) -> "int":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Size(self)

    def Value(self, index: "int64") -> "long long const &":
        r""" Returns the value in the current assignment of the variable of given index."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Value(self, index)

    def OldValue(self, index: "int64") -> "long long const &":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_OldValue(self, index)

    def SetValue(self, index: "int64", value: "long long const &") -> "void":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_SetValue(self, index, value)

    def OnStart(self) -> "void":
        r""" Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_OnStart(self)

# Register IntVarLocalSearchOperatorTemplate in _pywrapcp:
_pywrapcp.IntVarLocalSearchOperatorTemplate_swigregister(IntVarLocalSearchOperatorTemplate)

class IntVarLocalSearchOperator(IntVarLocalSearchOperatorTemplate):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        if self.__class__ == IntVarLocalSearchOperator:
            _self = None
        else:
            _self = self
        _pywrapcp.IntVarLocalSearchOperator_swiginit(self, _pywrapcp.new_IntVarLocalSearchOperator(_self, *args))
    __swig_destroy__ = _pywrapcp.delete_IntVarLocalSearchOperator

    def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        r""" Redefines MakeNextNeighbor to export a simpler interface. The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead."""
        return _pywrapcp.IntVarLocalSearchOperator_NextNeighbor(self, delta, deltadelta)

    def OneNeighbor(self) -> "bool":
        r""" Creates a new neighbor. It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator."""
        return _pywrapcp.IntVarLocalSearchOperator_OneNeighbor(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_IntVarLocalSearchOperator(self)
        return weakref.proxy(self)

# Register IntVarLocalSearchOperator in _pywrapcp:
_pywrapcp.IntVarLocalSearchOperator_swigregister(IntVarLocalSearchOperator)

class SequenceVarLocalSearchOperatorTemplate(LocalSearchOperator):
    r""" Base operator class for operators manipulating variables."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Start(self, assignment: "Assignment") -> "void":
        r""" This method should not be overridden. Override OnStart() instead which is called before exiting this method."""
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_Start(self, assignment)

    def IsIncremental(self) -> "bool":
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_IsIncremental(self)

    def Size(self) -> "int":
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_Size(self)

    def Value(self, index: "int64") -> "std::vector< int > const &":
        r""" Returns the value in the current assignment of the variable of given index."""
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_Value(self, index)

    def OldValue(self, index: "int64") -> "std::vector< int > const &":
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_OldValue(self, index)

    def SetValue(self, index: "int64", value: "std::vector< int > const &") -> "void":
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_SetValue(self, index, value)

    def OnStart(self) -> "void":
        r""" Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly."""
        return _pywrapcp.SequenceVarLocalSearchOperatorTemplate_OnStart(self)

# Register SequenceVarLocalSearchOperatorTemplate in _pywrapcp:
_pywrapcp.SequenceVarLocalSearchOperatorTemplate_swigregister(SequenceVarLocalSearchOperatorTemplate)

class SequenceVarLocalSearchOperator(SequenceVarLocalSearchOperatorTemplate):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

# Register SequenceVarLocalSearchOperator in _pywrapcp:
_pywrapcp.SequenceVarLocalSearchOperator_swigregister(SequenceVarLocalSearchOperator)

class BaseLns(IntVarLocalSearchOperator):
    r""" This is the base class for building an Lns operator. An Lns fragment is a collection of variables which will be relaxed. Fragments are built with NextFragment(), which returns false if there are no more fragments to build. Optionally one can override InitFragments, which is called from LocalSearchOperator::Start to initialize fragment data. Here's a sample relaxing one variable at a time: class OneVarLns : public BaseLns {  public:   OneVarLns(const std::vector<IntVar*>& vars) : BaseLns(vars), index_(0) {}   virtual ~OneVarLns() {}   virtual void InitFragments() { index_ = 0; }   virtual bool NextFragment() {     const int size = Size();     if (index_ < size) {       AppendToFragment(index_);       ++index_;       return true;     } else {       return false;     }   }  private:   int index_; };"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == BaseLns:
            _self = None
        else:
            _self = self
        _pywrapcp.BaseLns_swiginit(self, _pywrapcp.new_BaseLns(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_BaseLns

    def InitFragments(self) -> "void":
        return _pywrapcp.BaseLns_InitFragments(self)

    def NextFragment(self) -> "bool":
        return _pywrapcp.BaseLns_NextFragment(self)

    def AppendToFragment(self, index: "int") -> "void":
        return _pywrapcp.BaseLns_AppendToFragment(self, index)

    def FragmentSize(self) -> "int":
        return _pywrapcp.BaseLns_FragmentSize(self)

    def __getitem__(self, index: "int") -> "int64":
        return _pywrapcp.BaseLns___getitem__(self, index)

    def __len__(self) -> "int":
        return _pywrapcp.BaseLns___len__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_BaseLns(self)
        return weakref.proxy(self)

# Register BaseLns in _pywrapcp:
_pywrapcp.BaseLns_swigregister(BaseLns)

class ChangeValue(IntVarLocalSearchOperator):
    r""" Defines operators which change the value of variables; each neighbor corresponds to *one* modified variable. Sub-classes have to define ModifyValue which determines what the new variable value is going to be (given the current value and the variable)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == ChangeValue:
            _self = None
        else:
            _self = self
        _pywrapcp.ChangeValue_swiginit(self, _pywrapcp.new_ChangeValue(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_ChangeValue

    def ModifyValue(self, index: "int64", value: "int64") -> "int64":
        return _pywrapcp.ChangeValue_ModifyValue(self, index, value)

    def OneNeighbor(self) -> "bool":
        r""" This method should not be overridden. Override ModifyValue() instead."""
        return _pywrapcp.ChangeValue_OneNeighbor(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_ChangeValue(self)
        return weakref.proxy(self)

# Register ChangeValue in _pywrapcp:
_pywrapcp.ChangeValue_swigregister(ChangeValue)

class PathOperator(IntVarLocalSearchOperator):
    r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a   neighbor; this class provides the iteration on a given number of (base)   nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Neighbor(self) -> "bool":
        return _pywrapcp.PathOperator_Neighbor(self)

# Register PathOperator in _pywrapcp:
_pywrapcp.PathOperator_swigregister(PathOperator)

class LocalSearchFilter(BaseObject):
    r""" Local Search Filters are used for fast neighbor pruning. Filtering a move is done in several phases: - in the Relax phase, filters determine which parts of their internals   will be changed by the candidate, and modify intermediary State - in the Accept phase, filters check that the candidate is feasible, - if the Accept phase succeeds, the solver may decide to trigger a   Synchronize phase that makes filters change their internal representation   to the last candidate, - otherwise (Accept fails or the solver does not want to synchronize),   a Revert phase makes filters erase any intermediary State generated by the   Relax and Accept phases. A given filter has phases called with the following pattern: (Relax.Accept.Synchronize | Relax.Accept.Revert | Relax.Revert)*. Filters's Revert() is always called in the reverse order their Accept() was called, to allow late filters to use state done/undone by early filters' Accept()/Revert()."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        r""" Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted. TODO(user): Remove arguments when there are no more need for those."""
        return _pywrapcp.LocalSearchFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def IsIncremental(self) -> "bool":
        return _pywrapcp.LocalSearchFilter_IsIncremental(self)

    def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
        r""" Synchronizes the filter with the current solution, delta being the difference with the solution passed to the previous call to Synchronize() or IncrementalSynchronize(). 'delta' can be used to incrementally synchronizing the filter with the new solution by only considering the changes in delta."""
        return _pywrapcp.LocalSearchFilter_Synchronize(self, assignment, delta)
    __swig_destroy__ = _pywrapcp.delete_LocalSearchFilter

# Register LocalSearchFilter in _pywrapcp:
_pywrapcp.LocalSearchFilter_swigregister(LocalSearchFilter)

class IntVarLocalSearchFilter(LocalSearchFilter):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == IntVarLocalSearchFilter:
            _self = None
        else:
            _self = self
        _pywrapcp.IntVarLocalSearchFilter_swiginit(self, _pywrapcp.new_IntVarLocalSearchFilter(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_IntVarLocalSearchFilter

    def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
        r""" This method should not be overridden. Override OnSynchronize() instead which is called before exiting this method."""
        return _pywrapcp.IntVarLocalSearchFilter_Synchronize(self, assignment, delta)

    def Size(self) -> "int":
        return _pywrapcp.IntVarLocalSearchFilter_Size(self)

    def Value(self, index: "int") -> "int64":
        return _pywrapcp.IntVarLocalSearchFilter_Value(self, index)

    def IndexFromVar(self, var: "IntVar") -> "int64":
        return _pywrapcp.IntVarLocalSearchFilter_IndexFromVar(self, var)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_IntVarLocalSearchFilter(self)
        return weakref.proxy(self)

# Register IntVarLocalSearchFilter in _pywrapcp:
_pywrapcp.IntVarLocalSearchFilter_swigregister(IntVarLocalSearchFilter)

class BooleanVar(IntVar):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Min(self) -> "int64":
        return _pywrapcp.BooleanVar_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.BooleanVar_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetMax(self, m)

    def SetRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetRange(self, mi, ma)

    def Bound(self) -> "bool":
        return _pywrapcp.BooleanVar_Bound(self)

    def Value(self) -> "int64":
        return _pywrapcp.BooleanVar_Value(self)

    def RemoveValue(self, v: "int64") -> "void":
        return _pywrapcp.BooleanVar_RemoveValue(self, v)

    def RemoveInterval(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.BooleanVar_RemoveInterval(self, l, u)

    def WhenBound(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenBound(self, d)

    def WhenRange(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenRange(self, d)

    def WhenDomain(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenDomain(self, d)

    def Size(self) -> "uint64":
        return _pywrapcp.BooleanVar_Size(self)

    def Contains(self, v: "int64") -> "bool":
        return _pywrapcp.BooleanVar_Contains(self, v)

    def HoleIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        return _pywrapcp.BooleanVar_HoleIteratorAux(self, reversible)

    def DomainIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        return _pywrapcp.BooleanVar_DomainIteratorAux(self, reversible)

    def DebugString(self) -> "std::string":
        return _pywrapcp.BooleanVar_DebugString(self)

# Register BooleanVar in _pywrapcp:
_pywrapcp.BooleanVar_swigregister(BooleanVar)


class PyDecision(Decision):

  def __init__(self):
    Decision.__init__(self)

  def ApplyWrapper(self, solver):
    try:
       self.Apply(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def RefuteWrapper(self, solver):
    try:
       self.Refute(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyDecision"


class PyDecisionBuilder(DecisionBuilder):

  def __init__(self):
    DecisionBuilder.__init__(self)

  def NextWrapper(self, solver):
    try:
      return self.Next(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        return solver.FailDecision()
      else:
        raise

  def DebugString(self):
    return "PyDecisionBuilder"


class PyDemon(Demon):

  def RunWrapper(self, solver):
    try:
      self.Run(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyDemon"


class PyConstraintDemon(PyDemon):

  def __init__(self, ct, method, delayed, *args):
    PyDemon.__init__(self)
    self.__constraint = ct
    self.__method = method
    self.__delayed = delayed
    self.__args = args

  def Run(self, solver):
    self.__method(self.__constraint, *self.__args)

  def Priority(self):
    return Solver.DELAYED_PRIORITY if self.__delayed else Solver.NORMAL_PRIORITY

  def DebugString(self):
    return 'PyConstraintDemon'


class PyConstraint(Constraint):

  def __init__(self, solver):
    Constraint.__init__(self, solver)
    self.__demons = []

  def Demon(self, method, *args):
    demon = PyConstraintDemon(self, method, False, *args)
    self.__demons.append(demon)
    return demon

  def DelayedDemon(self, method, *args):
    demon = PyConstraintDemon(self, method, True, *args)
    self.__demons.append(demon)
    return demon

  def InitialPropagateDemon(self):
    return self.solver().ConstraintInitialPropagateCallback(self)

  def DelayedInitialPropagateDemon(self):
    return self.solver().DelayedConstraintInitialPropagateCallback(self)

  def InitialPropagateWrapper(self):
    try:
      self.InitialPropagate()
    except Exception as e:
      if 'CP Solver fail' in str(e):
        self.solver().ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyConstraint"



class RoutingIndexManager(object):
    r""" Manager for any NodeIndex <-> variable index conversion. The routing solver uses variable indices internally and through its API. These variable indices are tricky to manage directly because one Node can correspond to a multitude of variables, depending on the number of times they appear in the model, and if they're used as start and/or end points. This class aims to simplify variable index usage, allowing users to use NodeIndex instead. Usage:   .cpp}   auto starts_ends = ...;  /// These are NodeIndex.   RoutingIndexManager manager(10, 4, starts_ends);  // 10 nodes, 4 vehicles.   RoutingModel model(manager);"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _pywrapcp.RoutingIndexManager_swiginit(self, _pywrapcp.new_RoutingIndexManager(*args))
    __swig_destroy__ = _pywrapcp.delete_RoutingIndexManager

    def GetNumberOfNodes(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfNodes(self)

    def GetNumberOfVehicles(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfVehicles(self)

    def GetNumberOfIndices(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfIndices(self)

    def NodeToIndex(self, node: "operations_research::RoutingIndexManager::NodeIndex") -> "int64":
        return _pywrapcp.RoutingIndexManager_NodeToIndex(self, node)

    def IndexToNode(self, index: "int64") -> "operations_research::RoutingIndexManager::NodeIndex":
        return _pywrapcp.RoutingIndexManager_IndexToNode(self, index)

# Register RoutingIndexManager in _pywrapcp:
_pywrapcp.RoutingIndexManager_swigregister(RoutingIndexManager)


def DefaultRoutingModelParameters() -> "operations_research::RoutingModelParameters":
    return _pywrapcp.DefaultRoutingModelParameters()

def DefaultRoutingSearchParameters() -> "operations_research::RoutingSearchParameters":
    return _pywrapcp.DefaultRoutingSearchParameters()

def FindErrorInRoutingSearchParameters(search_parameters: "operations_research::RoutingSearchParameters const &") -> "std::string":
    r""" Returns an empty std::string if the routing search parameters are valid, and a non-empty, human readable error description if they're not."""
    return _pywrapcp.FindErrorInRoutingSearchParameters(search_parameters)
BOOL_UNSPECIFIED = _pywrapcp.BOOL_UNSPECIFIED
BOOL_FALSE = _pywrapcp.BOOL_FALSE
BOOL_TRUE = _pywrapcp.BOOL_TRUE
class RoutingModel(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    ROUTING_NOT_SOLVED = _pywrapcp.RoutingModel_ROUTING_NOT_SOLVED
    r""" Problem not solved yet (before calling RoutingModel::Solve())."""
    ROUTING_SUCCESS = _pywrapcp.RoutingModel_ROUTING_SUCCESS
    r""" Problem solved successfully after calling RoutingModel::Solve()."""
    ROUTING_FAIL = _pywrapcp.RoutingModel_ROUTING_FAIL
    r""" No solution found to the problem after calling RoutingModel::Solve()."""
    ROUTING_FAIL_TIMEOUT = _pywrapcp.RoutingModel_ROUTING_FAIL_TIMEOUT
    r""" Time limit reached before finding a solution with RoutingModel::Solve()."""
    ROUTING_INVALID = _pywrapcp.RoutingModel_ROUTING_INVALID
    r""" Model, model parameters or flags are not valid."""
    PICKUP_AND_DELIVERY_NO_ORDER = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_NO_ORDER
    r""" Any precedence is accepted."""
    PICKUP_AND_DELIVERY_LIFO = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_LIFO
    r""" Deliveries must be performed in reverse order of pickups."""
    PICKUP_AND_DELIVERY_FIFO = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_FIFO
    r""" Deliveries must be performed in the same order as pickups."""

    def __init__(self, *args):
        _pywrapcp.RoutingModel_swiginit(self, _pywrapcp.new_RoutingModel(*args))
    __swig_destroy__ = _pywrapcp.delete_RoutingModel

    def RegisterUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
        r""" Registers 'callback' and returns its index."""
        return _pywrapcp.RoutingModel_RegisterUnaryTransitCallback(self, callback)

    def RegisterPositiveUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
        return _pywrapcp.RoutingModel_RegisterPositiveUnaryTransitCallback(self, callback)

    def RegisterTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
        return _pywrapcp.RoutingModel_RegisterTransitCallback(self, callback)

    def RegisterPositiveTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
        return _pywrapcp.RoutingModel_RegisterPositiveTransitCallback(self, callback)

    def TransitCallback(self, callback_index: "int") -> "operations_research::RoutingModel::TransitCallback2 const &":
        return _pywrapcp.RoutingModel_TransitCallback(self, callback_index)

    def UnaryTransitCallbackOrNull(self, callback_index: "int") -> "operations_research::RoutingModel::TransitCallback1 const &":
        return _pywrapcp.RoutingModel_UnaryTransitCallbackOrNull(self, callback_index)

    def AddDimension(self, evaluator_index: "int", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Model creation Methods to add dimensions to routes; dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumul(j) = cumul(i) + transit(i) + slack(i) where slack is a positive slack variable (can represent waiting times for a time dimension). Setting the value of fix_start_cumul_to_zero to true will force the "cumul" variable of the start node of all vehicles to be equal to 0. Creates a dimension where the transit variable is constrained to be equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the slack variable and 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension). Takes ownership of the callback 'evaluator'."""
        return _pywrapcp.RoutingModel_AddDimension(self, evaluator_index, slack_max, capacity, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleTransits(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransits(self, evaluator_indices, slack_max, capacity, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleCapacity(self, evaluator_index: "int", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleCapacity(self, evaluator_index, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

    def AddConstantDimensionWithSlack(self, value: "int64", capacity: "int64", slack_max: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Creates a dimension where the transit variable is constrained to be equal to 'value'; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
        return _pywrapcp.RoutingModel_AddConstantDimensionWithSlack(self, value, capacity, slack_max, fix_start_cumul_to_zero, name)

    def AddConstantDimension(self, value: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddConstantDimension(self, value, capacity, fix_start_cumul_to_zero, name)

    def AddVectorDimension(self, values: "std::vector< int64 >", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Creates a dimension where the transit variable is constrained to be equal to 'values[i]' for node i; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
        return _pywrapcp.RoutingModel_AddVectorDimension(self, values, capacity, fix_start_cumul_to_zero, name)

    def MakePathSpansAndTotalSlacks(self, dimension: "RoutingDimension", spans: "std::vector< operations_research::IntVar * >", total_slacks: "std::vector< operations_research::IntVar * >") -> "operations_research::Constraint *":
        r""" For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of   slacks on that vehicle, that is,   dimension->CumulVar(end) - dimension->CumulVar(start) -   sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be   dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account."""
        return _pywrapcp.RoutingModel_MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks)

    def GetAllDimensionNames(self) -> "std::vector< ::std::string >":
        r""" Outputs the names of all dimensions added to the routing engine."""
        return _pywrapcp.RoutingModel_GetAllDimensionNames(self)

    def GetDimensions(self) -> "std::vector< operations_research::RoutingDimension * > const &":
        r""" Returns all dimensions of the model."""
        return _pywrapcp.RoutingModel_GetDimensions(self)

    def GetDimensionsWithSoftOrSpanCosts(self) -> "std::vector< operations_research::RoutingDimension * >":
        r""" Returns dimensions with soft or vehicle span costs."""
        return _pywrapcp.RoutingModel_GetDimensionsWithSoftOrSpanCosts(self)

    def GetGlobalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::GlobalDimensionCumulOptimizer > > const &":
        r""" Returns [global|local]_dimension_optimizers_, which are empty if the model has not been closed."""
        return _pywrapcp.RoutingModel_GetGlobalDimensionCumulOptimizers(self)

    def GetLocalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &":
        return _pywrapcp.RoutingModel_GetLocalDimensionCumulOptimizers(self)

    def GetMutableGlobalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::GlobalDimensionCumulOptimizer *":
        r""" Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none."""
        return _pywrapcp.RoutingModel_GetMutableGlobalCumulOptimizer(self, dimension)

    def GetMutableLocalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *":
        return _pywrapcp.RoutingModel_GetMutableLocalCumulOptimizer(self, dimension)

    def HasDimension(self, dimension_name: "std::string const &") -> "bool":
        r""" Returns true if a dimension exists for a given dimension name."""
        return _pywrapcp.RoutingModel_HasDimension(self, dimension_name)

    def GetDimensionOrDie(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension const &":
        r""" Returns a dimension from its name. Dies if the dimension does not exist."""
        return _pywrapcp.RoutingModel_GetDimensionOrDie(self, dimension_name)

    def GetMutableDimension(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension *":
        r""" Returns a dimension from its name. Returns nullptr if the dimension does not exist."""
        return _pywrapcp.RoutingModel_GetMutableDimension(self, dimension_name)

    def SetPrimaryConstrainedDimension(self, dimension_name: "std::string const &") -> "void":
        r""" Set the given dimension as "primary constrained". As of August 2013, this is only used by ArcIsMoreConstrainedThanArc(). "dimension" must be the name of an existing dimension, or be empty, in which case there will not be a primary dimension after this call."""
        return _pywrapcp.RoutingModel_SetPrimaryConstrainedDimension(self, dimension_name)

    def GetPrimaryConstrainedDimension(self) -> "std::string const &":
        r""" Get the primary constrained dimension, or an empty std::string if it is unset."""
        return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self)

    def AddDisjunction(self, *args) -> "operations_research::RoutingModel::DisjunctionIndex":
        r""" Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active. Start and end indices of any vehicle cannot be part of a disjunction. If a penalty is given, at most 'max_cardinality' of the indices can be active, and if less are active, 'penalty' is payed per inactive index. This is equivalent to adding the constraint:     p + Sum(i)active[i] == max_cardinality where p is an integer variable, and the following cost to the cost function:     p * penalty. 'penalty' must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited."""
        return _pywrapcp.RoutingModel_AddDisjunction(self, *args)

    def GetDisjunctionIndices(self, index: "int64") -> "std::vector< operations_research::RoutingModel::DisjunctionIndex > const &":
        r""" Returns the indices of the disjunctions to which an index belongs."""
        return _pywrapcp.RoutingModel_GetDisjunctionIndices(self, index)

    def GetDisjunctionPenalty(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
        r""" Returns the penalty of the node disjunction of index 'index'."""
        return _pywrapcp.RoutingModel_GetDisjunctionPenalty(self, index)

    def GetDisjunctionMaxCardinality(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
        r""" Returns the maximum number of possible active nodes of the node disjunction of index 'index'."""
        return _pywrapcp.RoutingModel_GetDisjunctionMaxCardinality(self, index)

    def GetNumberOfDisjunctions(self) -> "int":
        r""" Returns the number of node disjunctions in the model."""
        return _pywrapcp.RoutingModel_GetNumberOfDisjunctions(self)

    def GetPerfectBinaryDisjunctions(self) -> "std::vector< std::pair< int64,int64 > >":
        r""" Returns the list of all perfect binary disjunctions, as pairs of variable indices: a disjunction is "perfect" when its variables do not appear in any other disjunction. Each pair is sorted (lowest variable index first), and the output vector is also sorted (lowest pairs first)."""
        return _pywrapcp.RoutingModel_GetPerfectBinaryDisjunctions(self)

    def IgnoreDisjunctionsAlreadyForcedToZero(self) -> "void":
        r""" SPECIAL: Makes the solver ignore all the disjunctions whose active variables are all trivially zero (i.e. Max() == 0), by setting their max_cardinality to 0. This can be useful when using the BaseBinaryDisjunctionNeighborhood operators, in the context of arc-based routing."""
        return _pywrapcp.RoutingModel_IgnoreDisjunctionsAlreadyForcedToZero(self)

    def AddSoftSameVehicleConstraint(self, indices: "std::vector< int64 > const &", cost: "int64") -> "void":
        r""" Adds a soft contraint to force a set of variable indices to be on the same vehicle. If all nodes are not on the same vehicle, each extra vehicle used adds 'cost' to the cost function."""
        return _pywrapcp.RoutingModel_AddSoftSameVehicleConstraint(self, indices, cost)

    def SetAllowedVehiclesForIndex(self, vehicles: "std::vector< int > const &", index: "int64") -> "void":
        r""" Sets the vehicles which can visit a given node. If the node is in a disjunction, this will not prevent it from being unperformed. Specifying an empty vector of vehicles has no effect (all vehicles will be allowed to visit the node)."""
        return _pywrapcp.RoutingModel_SetAllowedVehiclesForIndex(self, vehicles, index)

    def IsVehicleAllowedForIndex(self, vehicle: "int", index: "int64") -> "bool":
        r""" Returns true if a vehicle is allowed to visit a given node."""
        return _pywrapcp.RoutingModel_IsVehicleAllowedForIndex(self, vehicle, index)

    def AddPickupAndDelivery(self, pickup: "int64", delivery: "int64") -> "void":
        r""" Notifies that index1 and index2 form a pair of nodes which should belong to the same route. This methods helps the search find better solutions, especially in the local search phase. It should be called each time you have an equality constraint linking the vehicle variables of two node (including for instance pickup and delivery problems):     Solver* const solver = routing.solver();     int64 index1 = manager.NodeToIndex(node1);     int64 index2 = manager.NodeToIndex(node2);     solver->AddConstraint(solver->MakeEquality(         routing.VehicleVar(index1),         routing.VehicleVar(index2)));     routing.AddPickupAndDelivery(index1, index2);"""
        return _pywrapcp.RoutingModel_AddPickupAndDelivery(self, pickup, delivery)

    def AddPickupAndDeliverySets(self, pickup_disjunction: "operations_research::RoutingModel::DisjunctionIndex", delivery_disjunction: "operations_research::RoutingModel::DisjunctionIndex") -> "void":
        r""" Same as AddPickupAndDelivery but notifying that the performed node from the disjunction of index 'pickup_disjunction' is on the same route as the performed node from the disjunction of index 'delivery_disjunction'."""
        return _pywrapcp.RoutingModel_AddPickupAndDeliverySets(self, pickup_disjunction, delivery_disjunction)

    def GetPickupIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
        r""" Returns pairs for which the node is a pickup; the first element of each pair is the index in the pickup and delivery pairs list in which the pickup appears, the second element is its index in the pickups list."""
        return _pywrapcp.RoutingModel_GetPickupIndexPairs(self, node_index)

    def GetDeliveryIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
        r""" Same as above for deliveries."""
        return _pywrapcp.RoutingModel_GetDeliveryIndexPairs(self, node_index)

    def SetPickupAndDeliveryPolicyOfAllVehicles(self, policy: "operations_research::RoutingModel::PickupAndDeliveryPolicy") -> "void":
        r""" Sets the Pickup and delivery policy of all vehicles. It is equivalent to calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles."""
        return _pywrapcp.RoutingModel_SetPickupAndDeliveryPolicyOfAllVehicles(self, policy)

    def SetPickupAndDeliveryPolicyOfVehicle(self, policy: "operations_research::RoutingModel::PickupAndDeliveryPolicy", vehicle: "int") -> "void":
        return _pywrapcp.RoutingModel_SetPickupAndDeliveryPolicyOfVehicle(self, policy, vehicle)

    def GetPickupAndDeliveryPolicyOfVehicle(self, vehicle: "int") -> "operations_research::RoutingModel::PickupAndDeliveryPolicy":
        return _pywrapcp.RoutingModel_GetPickupAndDeliveryPolicyOfVehicle(self, vehicle)

    def GetNumOfSingletonNodes(self) -> "int":
        r""" Returns the number of non-start/end nodes which do not appear in a pickup/delivery pair."""
        return _pywrapcp.RoutingModel_GetNumOfSingletonNodes(self)

    def SetVisitType(self, index: "int64", type: "int") -> "void":
        r""" Set the node visit types and incompatibilities/requirements between the types (see below). NOTE: The visit type of a node must be positive, and all nodes belonging to the same pickup/delivery pair must have the same type (or no type at all). NOTE: Before adding any incompatibilities and/or requirements on types:       1) All corresponding node types must have been set.       2) CloseVisitTypes() must be called so all containers are resized          accordingly. NOTE: These incompatibilities and requirements are only handled when each node index appears in at most one pickup/delivery pair, i.e. when the same node isn't a pickup and/or delivery in multiple pickup/delivery pairs."""
        return _pywrapcp.RoutingModel_SetVisitType(self, index, type)

    def GetVisitType(self, index: "int64") -> "int":
        return _pywrapcp.RoutingModel_GetVisitType(self, index)

    def CloseVisitTypes(self) -> "void":
        r""" This function should be called once all node visit types have been set and prior to adding any incompatibilities/requirements. "close" types."""
        return _pywrapcp.RoutingModel_CloseVisitTypes(self)

    def GetNumberOfVisitTypes(self) -> "int":
        return _pywrapcp.RoutingModel_GetNumberOfVisitTypes(self)

    def AddHardTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
        r""" Incompatibilities: Two nodes with "hard" incompatible types cannot share the same route at all, while with a "temporal" incompatibility they can't be on the same route at the same time."""
        return _pywrapcp.RoutingModel_AddHardTypeIncompatibility(self, type1, type2)

    def AddTemporalTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
        return _pywrapcp.RoutingModel_AddTemporalTypeIncompatibility(self, type1, type2)

    def GetHardTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
        r""" Returns visit types incompatible with a given type."""
        return _pywrapcp.RoutingModel_GetHardTypeIncompatibilitiesOfType(self, type)

    def GetTemporalTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
        return _pywrapcp.RoutingModel_GetTemporalTypeIncompatibilitiesOfType(self, type)

    def HasHardTypeIncompatibilities(self) -> "bool":
        r""" Returns true iff any hard (resp. temporal) type incompatibilities have been added to the model."""
        return _pywrapcp.RoutingModel_HasHardTypeIncompatibilities(self)

    def HasTemporalTypeIncompatibilities(self) -> "bool":
        return _pywrapcp.RoutingModel_HasTemporalTypeIncompatibilities(self)

    def AddSameVehicleRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
        r""" Requirements: NOTE: As of 2019-04, cycles in the requirement graph are not supported, and lead to the dependent nodes being skipped if possible (otherwise the model is considered infeasible). The following functions specify that "dependent_type" requires at least one of the types in "required_type_alternatives". For same-vehicle requirements, a node of dependent type type_D requires at least one node of type type_R among the required alternatives on the same route."""
        return _pywrapcp.RoutingModel_AddSameVehicleRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

    def AddTemporalRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
        r""" If type_D temporally depends on type_R, any non-delivery node_D of type_D requires at least one non-delivered node of type_R on its vehicle at the time node_D is visited."""
        return _pywrapcp.RoutingModel_AddTemporalRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

    def GetSameVehicleRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
        r""" Returns the sets of same-vehicle/temporal requirement alternatives for the given type."""
        return _pywrapcp.RoutingModel_GetSameVehicleRequiredTypeAlternativesOfType(self, type)

    def GetTemporalRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
        return _pywrapcp.RoutingModel_GetTemporalRequiredTypeAlternativesOfType(self, type)

    def HasSameVehicleTypeRequirements(self) -> "bool":
        r""" Returns true iff any same-route (resp. temporal) type requirements have been added to the model."""
        return _pywrapcp.RoutingModel_HasSameVehicleTypeRequirements(self)

    def HasTemporalTypeRequirements(self) -> "bool":
        return _pywrapcp.RoutingModel_HasTemporalTypeRequirements(self)

    def HasTypeRegulations(self) -> "bool":
        r""" Returns true iff the model has any incompatibilities or requirements set on node types."""
        return _pywrapcp.RoutingModel_HasTypeRegulations(self)

    def UnperformedPenalty(self, var_index: "int64") -> "int64":
        r""" Get the "unperformed" penalty of a node. This is only well defined if the node is only part of a single Disjunction involving only itself, and that disjunction has a penalty. In all other cases, including forced active nodes, this returns 0."""
        return _pywrapcp.RoutingModel_UnperformedPenalty(self, var_index)

    def UnperformedPenaltyOrValue(self, default_value: "int64", var_index: "int64") -> "int64":
        r""" Same as above except that it returns default_value instead of 0 when penalty is not well defined (default value is passed as first argument to simplify the usage of the method in a callback)."""
        return _pywrapcp.RoutingModel_UnperformedPenaltyOrValue(self, default_value, var_index)

    def GetDepot(self) -> "int64":
        r""" Returns the variable index of the first starting or ending node of all routes. If all routes start  and end at the same node (single depot), this is the node returned."""
        return _pywrapcp.RoutingModel_GetDepot(self)

    def SetArcCostEvaluatorOfAllVehicles(self, evaluator_index: "int") -> "void":
        r""" Sets the cost function of the model such that the cost of a segment of a route between node 'from' and 'to' is evaluator(from, to), whatever the route or vehicle performing the route."""
        return _pywrapcp.RoutingModel_SetArcCostEvaluatorOfAllVehicles(self, evaluator_index)

    def SetArcCostEvaluatorOfVehicle(self, evaluator_index: "int", vehicle: "int") -> "void":
        r""" Sets the cost function for a given vehicle route."""
        return _pywrapcp.RoutingModel_SetArcCostEvaluatorOfVehicle(self, evaluator_index, vehicle)

    def SetFixedCostOfAllVehicles(self, cost: "int64") -> "void":
        r""" Sets the fixed cost of all vehicle routes. It is equivalent to calling SetFixedCostOfVehicle on all vehicle routes."""
        return _pywrapcp.RoutingModel_SetFixedCostOfAllVehicles(self, cost)

    def SetFixedCostOfVehicle(self, cost: "int64", vehicle: "int") -> "void":
        r""" Sets the fixed cost of one vehicle route."""
        return _pywrapcp.RoutingModel_SetFixedCostOfVehicle(self, cost, vehicle)

    def GetFixedCostOfVehicle(self, vehicle: "int") -> "int64":
        r""" Returns the route fixed cost taken into account if the route of the vehicle is not empty, aka there's at least one node on the route other than the first and last nodes."""
        return _pywrapcp.RoutingModel_GetFixedCostOfVehicle(self, vehicle)

    def SetAmortizedCostFactorsOfAllVehicles(self, linear_cost_factor: "int64", quadratic_cost_factor: "int64") -> "void":
        r""" The following methods set the linear and quadratic cost factors of vehicles (must be positive values). The default value of these parameters is zero for all vehicles. When set, the cost_ of the model will contain terms aiming at reducing the number of vehicles used in the model, by adding the following to the objective for every vehicle v: INDICATOR(v used in the model) *   [linear_cost_factor_of_vehicle_[v]    - quadratic_cost_factor_of_vehicle_[v]*(square of length of route v)] i.e. for every used vehicle, we add the linear factor as fixed cost, and subtract the square of the route length multiplied by the quadratic factor. This second term aims at making the routes as dense as possible. Sets the linear and quadratic cost factor of all vehicles."""
        return _pywrapcp.RoutingModel_SetAmortizedCostFactorsOfAllVehicles(self, linear_cost_factor, quadratic_cost_factor)

    def SetAmortizedCostFactorsOfVehicle(self, linear_cost_factor: "int64", quadratic_cost_factor: "int64", vehicle: "int") -> "void":
        r""" Sets the linear and quadratic cost factor of the given vehicle."""
        return _pywrapcp.RoutingModel_SetAmortizedCostFactorsOfVehicle(self, linear_cost_factor, quadratic_cost_factor, vehicle)

    def GetAmortizedLinearCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
        return _pywrapcp.RoutingModel_GetAmortizedLinearCostFactorOfVehicles(self)

    def GetAmortizedQuadraticCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
        return _pywrapcp.RoutingModel_GetAmortizedQuadraticCostFactorOfVehicles(self)

    def ConsiderEmptyRouteCostsForVehicle(self, consider_costs: "bool", vehicle: "int") -> "void":
        return _pywrapcp.RoutingModel_ConsiderEmptyRouteCostsForVehicle(self, consider_costs, vehicle)

    def AreEmptyRouteCostsConsideredForVehicle(self, vehicle: "int") -> "bool":
        return _pywrapcp.RoutingModel_AreEmptyRouteCostsConsideredForVehicle(self, vehicle)

    def SetFirstSolutionEvaluator(self, evaluator: "operations_research::Solver::IndexEvaluator2") -> "void":
        r""" Gets/sets the evaluator used during the search. Only relevant when RoutingSearchParameters.first_solution_strategy = EVALUATOR_STRATEGY. Takes ownership of evaluator."""
        return _pywrapcp.RoutingModel_SetFirstSolutionEvaluator(self, evaluator)

    def AddLocalSearchOperator(self, ls_operator: "LocalSearchOperator") -> "void":
        r""" Adds a local search operator to the set of operators used to solve the vehicle routing problem."""
        return _pywrapcp.RoutingModel_AddLocalSearchOperator(self, ls_operator)

    def AddSearchMonitor(self, monitor: "SearchMonitor") -> "void":
        r""" Adds a search monitor to the search used to solve the routing model."""
        return _pywrapcp.RoutingModel_AddSearchMonitor(self, monitor)

    def AddAtSolutionCallback(self, callback: "std::function< void () >") -> "void":
        r""" Adds a callback called each time a solution is found during the search. This is a shortcut to creating a monitor to call the callback on AtSolution() and adding it with AddSearchMonitor."""
        return _pywrapcp.RoutingModel_AddAtSolutionCallback(self, callback)

    def AddVariableMinimizedByFinalizer(self, var: "IntVar") -> "void":
        r""" Adds a variable to minimize in the solution finalizer. The solution finalizer is called each time a solution is found during the search and allows to instantiate secondary variables (such as dimension cumul variables)."""
        return _pywrapcp.RoutingModel_AddVariableMinimizedByFinalizer(self, var)

    def AddVariableMaximizedByFinalizer(self, var: "IntVar") -> "void":
        r""" Adds a variable to maximize in the solution finalizer (see above for information on the solution finalizer)."""
        return _pywrapcp.RoutingModel_AddVariableMaximizedByFinalizer(self, var)

    def AddWeightedVariableMinimizedByFinalizer(self, var: "IntVar", cost: "int64") -> "void":
        r""" Adds a variable to minimize in the solution finalizer, with a weighted priority: the higher the more priority it has."""
        return _pywrapcp.RoutingModel_AddWeightedVariableMinimizedByFinalizer(self, var, cost)

    def AddVariableTargetToFinalizer(self, var: "IntVar", target: "int64") -> "void":
        r""" Add a variable to set the closest possible to the target value in the solution finalizer."""
        return _pywrapcp.RoutingModel_AddVariableTargetToFinalizer(self, var, target)

    def CloseModel(self) -> "void":
        r""" Closes the current routing model; after this method is called, no modification to the model can be done, but RoutesToAssignment becomes available. Note that CloseModel() is automatically called by Solve() and other methods that produce solution. This is equivalent to calling CloseModelWithParameters(DefaultRoutingSearchParameters())."""
        return _pywrapcp.RoutingModel_CloseModel(self)

    def CloseModelWithParameters(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "void":
        r""" Same as above taking search parameters (as of 10/2015 some the parameters have to be set when closing the model)."""
        return _pywrapcp.RoutingModel_CloseModelWithParameters(self, search_parameters)

    def Solve(self, assignment: "Assignment"=None) -> "operations_research::Assignment const *":
        r""" Solves the current routing model; closes the current model. This is equivalent to calling SolveWithParameters(DefaultRoutingSearchParameters()) or SolveFromAssignmentWithParameters(assignment,                                   DefaultRoutingSearchParameters())."""
        return _pywrapcp.RoutingModel_Solve(self, assignment)

    def SolveWithParameters(self, search_parameters: "operations_research::RoutingSearchParameters const &", solutions: "std::vector< operations_research::Assignment const * > *"=None) -> "operations_research::Assignment const *":
        r""" Solves the current routing model with the given parameters. If 'solutions' is specified, it will contain the k best solutions found during the search (from worst to best, including the one returned by this method), where k corresponds to the 'number_of_solutions_to_collect' in 'search_parameters'. Note that the Assignment returned by the method and the ones in solutions are owned by the underlying solver and should not be deleted."""
        return _pywrapcp.RoutingModel_SolveWithParameters(self, search_parameters, solutions)

    def SolveFromAssignmentWithParameters(self, assignment: "Assignment", search_parameters: "operations_research::RoutingSearchParameters const &", solutions: "std::vector< operations_research::Assignment const * > *"=None) -> "operations_research::Assignment const *":
        return _pywrapcp.RoutingModel_SolveFromAssignmentWithParameters(self, assignment, search_parameters, solutions)

    def SetAssignmentFromOtherModelAssignment(self, target_assignment: "Assignment", source_model: "RoutingModel", source_assignment: "Assignment") -> "void":
        r""" Given a "source_model" and its "source_assignment", resets "target_assignment" with the IntVar variables (nexts_, and vehicle_vars_ if costs aren't homogeneous across vehicles) of "this" model, with the values set according to those in "other_assignment". The objective_element of target_assignment is set to this->cost_."""
        return _pywrapcp.RoutingModel_SetAssignmentFromOtherModelAssignment(self, target_assignment, source_model, source_assignment)

    def ComputeLowerBound(self) -> "int64":
        r""" Computes a lower bound to the routing problem solving a linear assignment problem. The routing model must be closed before calling this method. Note that problems with node disjunction constraints (including optional nodes) and non-homogenous costs are not supported (the method returns 0 in these cases)."""
        return _pywrapcp.RoutingModel_ComputeLowerBound(self)

    def status(self) -> "operations_research::RoutingModel::Status":
        r""" Returns the current status of the routing model."""
        return _pywrapcp.RoutingModel_status(self)

    def ApplyLocks(self, locks: "std::vector< int64 > const &") -> "operations_research::IntVar *":
        r""" Applies a lock chain to the next search. 'locks' represents an ordered vector of nodes representing a partial route which will be fixed during the next search; it will constrain next variables such that: next[locks[i]] == locks[i+1]. Returns the next variable at the end of the locked chain; this variable is not locked. An assignment containing the locks can be obtained by calling PreAssignment()."""
        return _pywrapcp.RoutingModel_ApplyLocks(self, locks)

    def ApplyLocksToAllVehicles(self, locks: "std::vector< std::vector< int64 > > const &", close_routes: "bool") -> "bool":
        r""" Applies lock chains to all vehicles to the next search, such that locks[p] is the lock chain for route p. Returns false if the locks do not contain valid routes; expects that the routes do not contain the depots, i.e. there are empty vectors in place of empty routes. If close_routes is set to true, adds the end nodes to the route of each vehicle and deactivates other nodes. An assignment containing the locks can be obtained by calling PreAssignment()."""
        return _pywrapcp.RoutingModel_ApplyLocksToAllVehicles(self, locks, close_routes)

    def PreAssignment(self) -> "operations_research::Assignment const *const":
        r""" Returns an assignment used to fix some of the variables of the problem. In practice, this assignment locks partial routes of the problem. This can be used in the context of locking the parts of the routes which have already been driven in online routing problems."""
        return _pywrapcp.RoutingModel_PreAssignment(self)

    def MutablePreAssignment(self) -> "operations_research::Assignment *":
        return _pywrapcp.RoutingModel_MutablePreAssignment(self)

    def WriteAssignment(self, file_name: "std::string const &") -> "bool":
        r""" Writes the current solution to a file containing an AssignmentProto. Returns false if the file cannot be opened or if there is no current solution."""
        return _pywrapcp.RoutingModel_WriteAssignment(self, file_name)

    def ReadAssignment(self, file_name: "std::string const &") -> "operations_research::Assignment *":
        r""" Reads an assignment from a file and returns the current solution. Returns nullptr if the file cannot be opened or if the assignment is not valid."""
        return _pywrapcp.RoutingModel_ReadAssignment(self, file_name)

    def RestoreAssignment(self, solution: "Assignment") -> "operations_research::Assignment *":
        r""" Restores an assignment as a solution in the routing model and returns the new solution. Returns nullptr if the assignment is not valid."""
        return _pywrapcp.RoutingModel_RestoreAssignment(self, solution)

    def ReadAssignmentFromRoutes(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool") -> "operations_research::Assignment *":
        r""" Restores the routes as the current solution. Returns nullptr if the solution cannot be restored (routes do not contain a valid solution). Note that calling this method will run the solver to assign values to the dimension variables; this may take considerable amount of time, especially when using dimensions with slack."""
        return _pywrapcp.RoutingModel_ReadAssignmentFromRoutes(self, routes, ignore_inactive_indices)

    def RoutesToAssignment(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool", close_routes: "bool", assignment: "Assignment") -> "bool":
        r""" Fills an assignment from a specification of the routes of the vehicles. The routes are specified as lists of variable indices that appear on the routes of the vehicles. The indices of the outer vector in 'routes' correspond to vehicles IDs, the inner vector contains the variable indices on the routes for the given vehicle. The inner vectors must not contain the start and end indices, as these are determined by the routing model.  Sets the value of NextVars in the assignment, adding the variables to the assignment if necessary. The method does not touch other variables in the assignment. The method can only be called after the model is closed.  With ignore_inactive_indices set to false, this method will fail (return nullptr) in case some of the route contain indices that are deactivated in the model; when set to true, these indices will be skipped.  Returns true if routes were successfully loaded. However, such assignment still might not be a valid solution to the routing problem due to more complex constraints; it is advisible to call solver()->CheckSolution() afterwards."""
        return _pywrapcp.RoutingModel_RoutesToAssignment(self, routes, ignore_inactive_indices, close_routes, assignment)

    def AssignmentToRoutes(self, assignment: "Assignment", routes: "std::vector< std::vector< int64 > > *const") -> "void":
        r""" Converts the solution in the given assignment to routes for all vehicles. Expects that assignment contains a valid solution (i.e. routes for all vehicles end with an end index for that vehicle)."""
        return _pywrapcp.RoutingModel_AssignmentToRoutes(self, assignment, routes)

    def CompactAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
        r""" Returns a compacted version of the given assignment, in which all vehicles with id lower or equal to some N have non-empty routes, and all vehicles with id greater than N have empty routes. Does not take ownership of the returned object. If found, the cost of the compact assignment is the same as in the original assignment and it preserves the values of 'active' variables. Returns nullptr if a compact assignment was not found. This method only works in homogenous mode, and it only swaps equivalent vehicles (vehicles with the same start and end nodes). When creating the compact assignment, the empty plan is replaced by the route assigned to the compatible vehicle with the highest id. Note that with more complex constraints on vehicle variables, this method might fail even if a compact solution exists. This method changes the vehicle and dimension variables as necessary. While compacting the solution, only basic checks on vehicle variables are performed; if one of these checks fails no attempts to repair it are made (instead, the method returns nullptr)."""
        return _pywrapcp.RoutingModel_CompactAssignment(self, assignment)

    def CompactAndCheckAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
        r""" Same as CompactAssignment() but also checks the validity of the final compact solution; if it is not valid, no attempts to repair it are made (instead, the method returns nullptr)."""
        return _pywrapcp.RoutingModel_CompactAndCheckAssignment(self, assignment)

    def AddToAssignment(self, var: "IntVar") -> "void":
        r""" Adds an extra variable to the vehicle routing assignment."""
        return _pywrapcp.RoutingModel_AddToAssignment(self, var)

    def AddIntervalToAssignment(self, interval: "IntervalVar") -> "void":
        return _pywrapcp.RoutingModel_AddIntervalToAssignment(self, interval)

    def PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment: "Assignment", duration_limit: "absl::Duration") -> "operations_research::Assignment const *":
        r""" For every dimension in the model with an optimizer in local/global_dimension_optimizers_, this method tries to pack the cumul values of the dimension, such that: - The cumul costs (span costs, soft lower and upper bound costs, etc) are   minimized. - The cumuls of the ends of the routes are minimized for this given   minimal cumul cost. - Given these minimal end cumuls, the route start cumuls are maximized. Returns the assignment resulting from allocating these packed cumuls with the solver, and nullptr if these cumuls could not be set by the solver."""
        return _pywrapcp.RoutingModel_PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment, duration_limit)

    def AddLocalSearchFilter(self, filter: "LocalSearchFilter") -> "void":
        r""" Adds a custom local search filter to the list of filters used to speed up local search by pruning unfeasible variable assignments. Calling this method after the routing model has been closed (CloseModel() or Solve() has been called) has no effect. The routing model does not take ownership of the filter."""
        return _pywrapcp.RoutingModel_AddLocalSearchFilter(self, filter)

    def Start(self, vehicle: "int") -> "int64":
        r""" Model inspection. Returns the variable index of the starting node of a vehicle route."""
        return _pywrapcp.RoutingModel_Start(self, vehicle)

    def End(self, vehicle: "int") -> "int64":
        r""" Returns the variable index of the ending node of a vehicle route."""
        return _pywrapcp.RoutingModel_End(self, vehicle)

    def IsStart(self, index: "int64") -> "bool":
        r""" Returns true if 'index' represents the first node of a route."""
        return _pywrapcp.RoutingModel_IsStart(self, index)

    def IsEnd(self, index: "int64") -> "bool":
        r""" Returns true if 'index' represents the last node of a route."""
        return _pywrapcp.RoutingModel_IsEnd(self, index)

    def VehicleIndex(self, index: "int") -> "int":
        r""" Returns the vehicle of the given start/end index, and -1 if the given index is not a vehicle start/end."""
        return _pywrapcp.RoutingModel_VehicleIndex(self, index)

    def Next(self, assignment: "Assignment", index: "int64") -> "int64":
        r""" Assignment inspection Returns the variable index of the node directly after the node corresponding to 'index' in 'assignment'."""
        return _pywrapcp.RoutingModel_Next(self, assignment, index)

    def IsVehicleUsed(self, assignment: "Assignment", vehicle: "int") -> "bool":
        r""" Returns true if the route of 'vehicle' is non empty in 'assignment'."""
        return _pywrapcp.RoutingModel_IsVehicleUsed(self, assignment, vehicle)

    def NextVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the next variable of the node corresponding to index. Note that NextVar(index) == index is equivalent to ActiveVar(index) == 0."""
        return _pywrapcp.RoutingModel_NextVar(self, index)

    def ActiveVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the active variable of the node corresponding to index."""
        return _pywrapcp.RoutingModel_ActiveVar(self, index)

    def VehicleCostsConsideredVar(self, vehicle: "int") -> "operations_research::IntVar *":
        r""" Returns the variable specifying whether or not costs are considered for vehicle."""
        return _pywrapcp.RoutingModel_VehicleCostsConsideredVar(self, vehicle)

    def VehicleVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the vehicle variable of the node corresponding to index. Note that VehicleVar(index) == -1 is equivalent to ActiveVar(index) == 0."""
        return _pywrapcp.RoutingModel_VehicleVar(self, index)

    def CostVar(self) -> "operations_research::IntVar *":
        r""" Returns the global cost variable which is being minimized."""
        return _pywrapcp.RoutingModel_CostVar(self)

    def GetArcCostForVehicle(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
        r""" Returns the cost of the transit arc between two nodes for a given vehicle. Input are variable indices of node. This returns 0 if vehicle < 0."""
        return _pywrapcp.RoutingModel_GetArcCostForVehicle(self, from_index, to_index, vehicle)

    def CostsAreHomogeneousAcrossVehicles(self) -> "bool":
        r""" Whether costs are homogeneous across all vehicles."""
        return _pywrapcp.RoutingModel_CostsAreHomogeneousAcrossVehicles(self)

    def GetHomogeneousCost(self, from_index: "int64", to_index: "int64") -> "int64":
        r""" Returns the cost of the segment between two nodes supposing all vehicle costs are the same (returns the cost for the first vehicle otherwise)."""
        return _pywrapcp.RoutingModel_GetHomogeneousCost(self, from_index, to_index)

    def GetArcCostForFirstSolution(self, from_index: "int64", to_index: "int64") -> "int64":
        r""" Returns the cost of the arc in the context of the first solution strategy. This is typically a simplification of the actual cost; see the .cc."""
        return _pywrapcp.RoutingModel_GetArcCostForFirstSolution(self, from_index, to_index)

    def GetArcCostForClass(self, from_index: "int64", to_index: "int64", cost_class_index: "int64") -> "int64":
        r""" Returns the cost of the segment between two nodes for a given cost class. Input are variable indices of nodes and the cost class. Unlike GetArcCostForVehicle(), if cost_class is kNoCost, then the returned cost won't necessarily be zero: only some of the components of the cost that depend on the cost class will be omited. See the code for details."""
        return _pywrapcp.RoutingModel_GetArcCostForClass(self, from_index, to_index, cost_class_index)

    def GetCostClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::CostClassIndex":
        r""" Get the cost class index of the given vehicle."""
        return _pywrapcp.RoutingModel_GetCostClassIndexOfVehicle(self, vehicle)

    def HasVehicleWithCostClassIndex(self, cost_class_index: "operations_research::RoutingModel::CostClassIndex") -> "bool":
        r""" Returns true iff the model contains a vehicle with the given cost_class_index."""
        return _pywrapcp.RoutingModel_HasVehicleWithCostClassIndex(self, cost_class_index)

    def GetCostClassesCount(self) -> "int":
        r""" Returns the number of different cost classes in the model."""
        return _pywrapcp.RoutingModel_GetCostClassesCount(self)

    def GetNonZeroCostClassesCount(self) -> "int":
        r""" Ditto, minus the 'always zero', built-in cost class."""
        return _pywrapcp.RoutingModel_GetNonZeroCostClassesCount(self)

    def GetVehicleClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::VehicleClassIndex":
        return _pywrapcp.RoutingModel_GetVehicleClassIndexOfVehicle(self, vehicle)

    def GetVehicleClassesCount(self) -> "int":
        r""" Returns the number of different vehicle classes in the model."""
        return _pywrapcp.RoutingModel_GetVehicleClassesCount(self)

    def GetSameVehicleIndicesOfIndex(self, node: "int") -> "std::vector< int > const &":
        r""" Returns variable indices of nodes constrained to be on the same route."""
        return _pywrapcp.RoutingModel_GetSameVehicleIndicesOfIndex(self, node)

    def ArcIsMoreConstrainedThanArc(self, _from: "int64", to1: "int64", to2: "int64") -> "bool":
        r""" Returns whether the arc from->to1 is more constrained than from->to2, taking into account, in order: - whether the destination node isn't an end node - whether the destination node is mandatory - whether the destination node is bound to the same vehicle as the source - the "primary constrained" dimension (see SetPrimaryConstrainedDimension) It then breaks ties using, in order: - the arc cost (taking unperformed penalties into account) - the size of the vehicle vars of "to1" and "to2" (lowest size wins) - the value: the lowest value of the indices to1 and to2 wins. See the .cc for details. The more constrained arc is typically preferable when building a first solution. This method is intended to be used as a callback for the BestValueByComparisonSelector value selector. Args:   from: the variable index of the source node   to1: the variable index of the first candidate destination node.   to2: the variable index of the second candidate destination node."""
        return _pywrapcp.RoutingModel_ArcIsMoreConstrainedThanArc(self, _from, to1, to2)

    def DebugOutputAssignment(self, solution_assignment: "Assignment", dimension_to_print: "std::string const &") -> "std::string":
        r""" Print some debugging information about an assignment, including the feasible intervals of the CumulVar for dimension "dimension_to_print" at each step of the routes. If "dimension_to_print" is omitted, all dimensions will be printed."""
        return _pywrapcp.RoutingModel_DebugOutputAssignment(self, solution_assignment, dimension_to_print)

    def solver(self) -> "operations_research::Solver *":
        r""" Returns the underlying constraint solver. Can be used to add extra constraints and/or modify search algoithms."""
        return _pywrapcp.RoutingModel_solver(self)

    def CheckLimit(self) -> "bool":
        r""" Returns true if the search limit has been crossed."""
        return _pywrapcp.RoutingModel_CheckLimit(self)

    def RemainingTime(self) -> "absl::Duration":
        r""" Returns the time left in the search limit."""
        return _pywrapcp.RoutingModel_RemainingTime(self)

    def nodes(self) -> "int":
        r""" Sizes and indices Returns the number of nodes in the model."""
        return _pywrapcp.RoutingModel_nodes(self)

    def vehicles(self) -> "int":
        r""" Returns the number of vehicle routes in the model."""
        return _pywrapcp.RoutingModel_vehicles(self)

    def Size(self) -> "int64":
        r""" Returns the number of next variables in the model."""
        return _pywrapcp.RoutingModel_Size(self)

    def GetNumberOfDecisionsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
        r""" Returns statistics on first solution search, number of decisions sent to filters, number of decisions rejected by filters."""
        return _pywrapcp.RoutingModel_GetNumberOfDecisionsInFirstSolution(self, search_parameters)

    def GetNumberOfRejectsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
        return _pywrapcp.RoutingModel_GetNumberOfRejectsInFirstSolution(self, search_parameters)

    def IsMatchingModel(self) -> "bool":
        r""" Returns true if a vehicle/node matching problem is detected."""
        return _pywrapcp.RoutingModel_IsMatchingModel(self)

    def MakeGuidedSlackFinalizer(self, dimension: "RoutingDimension", initializer: "std::function< int64 (int64) >") -> "operations_research::DecisionBuilder *":
        r""" The next few members are in the public section only for testing purposes. MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a dimension using a callback to choose which values to start with. The finalizer works only when all next variables in the model have been fixed. It has the following two characteristics: 1. It follows the routes defined by the nexts variables when choosing a    variable to make a decision on. 2. When it comes to choose a value for the slack of node i, the decision    builder first calls the callback with argument i, and supposingly the    returned value is x it creates decisions slack[i] = x, slack[i] = x +    1, slack[i] = x - 1, slack[i] = x + 2, etc."""
        return _pywrapcp.RoutingModel_MakeGuidedSlackFinalizer(self, dimension, initializer)

    def MakeSelfDependentDimensionFinalizer(self, dimension: "RoutingDimension") -> "operations_research::DecisionBuilder *":
        r""" MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a self-dependent dimension. It makes an extensive use of the caches of the state dependent transits. In detail, MakeSelfDependentDimensionFinalizer returns a composition of a local search decision builder with a greedy descent operator for the cumul of the start of each route and a guided slack finalizer. Provided there are no time windows and the maximum slacks are large enough, once the cumul of the start of route is fixed, the guided finalizer can find optimal values of the slacks for the rest of the route in time proportional to the length of the route. Therefore the composed finalizer generally works in time O(log(t)*n*m), where t is the latest possible departute time, n is the number of nodes in the network and m is the number of vehicles."""
        return _pywrapcp.RoutingModel_MakeSelfDependentDimensionFinalizer(self, dimension)

    def AddMatrixDimension(self, *args) -> "void":
        return _pywrapcp.RoutingModel_AddMatrixDimension(self, *args)

# Register RoutingModel in _pywrapcp:
_pywrapcp.RoutingModel_swigregister(RoutingModel)
cvar = _pywrapcp.cvar
RoutingModel.kNoPenalty = _pywrapcp.cvar.RoutingModel_kNoPenalty
RoutingModel.kNoDisjunction = _pywrapcp.cvar.RoutingModel_kNoDisjunction
RoutingModel.kNoDimension = _pywrapcp.cvar.RoutingModel_kNoDimension

class RoutingModelVisitor(BaseObject):
    r""" Routing model visitor."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        _pywrapcp.RoutingModelVisitor_swiginit(self, _pywrapcp.new_RoutingModelVisitor())
    __swig_destroy__ = _pywrapcp.delete_RoutingModelVisitor

# Register RoutingModelVisitor in _pywrapcp:
_pywrapcp.RoutingModelVisitor_swigregister(RoutingModelVisitor)
RoutingModelVisitor.kLightElement = _pywrapcp.cvar.RoutingModelVisitor_kLightElement
RoutingModelVisitor.kLightElement2 = _pywrapcp.cvar.RoutingModelVisitor_kLightElement2
RoutingModelVisitor.kRemoveValues = _pywrapcp.cvar.RoutingModelVisitor_kRemoveValues

class GlobalVehicleBreaksConstraint(Constraint):
    r""" GlobalVehicleBreaksConstraint ensures breaks constraints are enforced on all vehicles in the dimension passed to its constructor. It is intended to be used for dimensions representing time. A break constraint ensures break intervals fit on the route of a vehicle. For a given vehicle, it forces break intervals to be disjoint from visit intervals, where visit intervals start at CumulVar(node) and last for node_visit_transit[node]. Moreover, it ensures that there is enough time between two consecutive nodes of a route to do transit and vehicle breaks, i.e. if Next(nodeA) = nodeB, CumulVar(nodeA) = tA and CumulVar(nodeB) = tB, then SlackVar(nodeA) >= sum_{breaks [tA, tB)} duration(break)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, dimension: "RoutingDimension"):
        _pywrapcp.GlobalVehicleBreaksConstraint_swiginit(self, _pywrapcp.new_GlobalVehicleBreaksConstraint(dimension))

    def DebugString(self) -> "std::string":
        return _pywrapcp.GlobalVehicleBreaksConstraint_DebugString(self)

    def Post(self) -> "void":
        return _pywrapcp.GlobalVehicleBreaksConstraint_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        return _pywrapcp.GlobalVehicleBreaksConstraint_InitialPropagateWrapper(self)
    __swig_destroy__ = _pywrapcp.delete_GlobalVehicleBreaksConstraint

# Register GlobalVehicleBreaksConstraint in _pywrapcp:
_pywrapcp.GlobalVehicleBreaksConstraint_swigregister(GlobalVehicleBreaksConstraint)

class TypeRegulationsChecker(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_TypeRegulationsChecker

    def CheckVehicle(self, vehicle: "int", next_accessor: "std::function< int64 (int64) > const &") -> "bool":
        return _pywrapcp.TypeRegulationsChecker_CheckVehicle(self, vehicle, next_accessor)

# Register TypeRegulationsChecker in _pywrapcp:
_pywrapcp.TypeRegulationsChecker_swigregister(TypeRegulationsChecker)

class TypeIncompatibilityChecker(TypeRegulationsChecker):
    r""" Checker for type incompatibilities."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, model: "RoutingModel", check_hard_incompatibilities: "bool"):
        _pywrapcp.TypeIncompatibilityChecker_swiginit(self, _pywrapcp.new_TypeIncompatibilityChecker(model, check_hard_incompatibilities))
    __swig_destroy__ = _pywrapcp.delete_TypeIncompatibilityChecker

# Register TypeIncompatibilityChecker in _pywrapcp:
_pywrapcp.TypeIncompatibilityChecker_swigregister(TypeIncompatibilityChecker)

class TypeRequirementChecker(TypeRegulationsChecker):
    r""" Checker for type requirements."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, model: "RoutingModel"):
        _pywrapcp.TypeRequirementChecker_swiginit(self, _pywrapcp.new_TypeRequirementChecker(model))
    __swig_destroy__ = _pywrapcp.delete_TypeRequirementChecker

# Register TypeRequirementChecker in _pywrapcp:
_pywrapcp.TypeRequirementChecker_swigregister(TypeRequirementChecker)

class TypeRegulationsConstraint(Constraint):
    r""" The following constraint ensures that incompatibilities and requirements between types are respected. It verifies both "hard" and "temporal" incompatibilities. Two nodes with hard incompatible types cannot be served by the same vehicle at all, while with a temporal incompatibility they can't be on the same route at the same time. For example, for three temporally incompatible types T1 T2 and T3, two pickup/delivery pairs p1/d1 and p2/d2 of type T1 and T2 respectively, and a non-pickup/delivery node n of type T3, the configuration p1 --> d1 --> n --> p2 --> d2 is acceptable, whereas any configurations with p1 --> p2 --> d1 --> ..., or p1 --> n --> d1 --> ... is not feasible. It also verifies same-vehicle and temporal type requirements. In the above example, if T1 is a requirement for T2: - For a same-vehicle requirement, p1/d1 must be on the same vehicle as   p2/d2. - For a temporal requirement, p2 must be visited between p1 and d1."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, model: "RoutingModel"):
        _pywrapcp.TypeRegulationsConstraint_swiginit(self, _pywrapcp.new_TypeRegulationsConstraint(model))

    def Post(self) -> "void":
        return _pywrapcp.TypeRegulationsConstraint_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        return _pywrapcp.TypeRegulationsConstraint_InitialPropagateWrapper(self)
    __swig_destroy__ = _pywrapcp.delete_TypeRegulationsConstraint

# Register TypeRegulationsConstraint in _pywrapcp:
_pywrapcp.TypeRegulationsConstraint_swigregister(TypeRegulationsConstraint)

class RoutingDimension(object):
    r""" Dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumuls(j) = cumuls(i) + transits(i) + slacks(i) +             state_dependent_transits(i) where slack is a positive slack variable (can represent waiting times for a time dimension), and state_dependent_transits is a non-purely functional version of transits_. Favour transits over state_dependent_transits when possible, because purely functional callbacks allow more optimisations and make the model faster and easier to solve. for a given vehicle, it is passed as an external vector, it would be better to have this information here."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_RoutingDimension

    def model(self) -> "operations_research::RoutingModel *":
        r""" Returns the model on which the dimension was created."""
        return _pywrapcp.RoutingDimension_model(self)

    def GetTransitValue(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
        r""" Returns the transition value for a given pair of nodes (as var index); this value is the one taken by the corresponding transit variable when the 'next' variable for 'from_index' is bound to 'to_index'."""
        return _pywrapcp.RoutingDimension_GetTransitValue(self, from_index, to_index, vehicle)

    def GetTransitValueFromClass(self, from_index: "int64", to_index: "int64", vehicle_class: "int64") -> "int64":
        r""" Same as above but taking a vehicle class of the dimension instead of a vehicle (the class of a vehicle can be obtained with vehicle_to_class())."""
        return _pywrapcp.RoutingDimension_GetTransitValueFromClass(self, from_index, to_index, vehicle_class)

    def CumulVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Get the cumul, transit and slack variables for the given node (given as int64 var index)."""
        return _pywrapcp.RoutingDimension_CumulVar(self, index)

    def TransitVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_TransitVar(self, index)

    def FixedTransitVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_FixedTransitVar(self, index)

    def SlackVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_SlackVar(self, index)

    def SetSpanUpperBoundForVehicle(self, upper_bound: "int64", vehicle: "int") -> "void":
        r""" Sets an upper bound on the dimension span on a given vehicle. This is the preferred way to limit the "length" of the route of a vehicle according to a dimension."""
        return _pywrapcp.RoutingDimension_SetSpanUpperBoundForVehicle(self, upper_bound, vehicle)

    def SetSpanCostCoefficientForVehicle(self, coefficient: "int64", vehicle: "int") -> "void":
        r""" Sets a cost proportional to the dimension span on a given vehicle, or on all vehicles at once. "coefficient" must be nonnegative. This is handy to model costs proportional to idle time when the dimension represents time. The cost for a vehicle is   span_cost = coefficient * (dimension end value - dimension start value)."""
        return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForVehicle(self, coefficient, vehicle)

    def SetSpanCostCoefficientForAllVehicles(self, coefficient: "int64") -> "void":
        return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForAllVehicles(self, coefficient)

    def SetGlobalSpanCostCoefficient(self, coefficient: "int64") -> "void":
        r""" Sets a cost proportional to the *global* dimension span, that is the difference between the largest value of route end cumul variables and the smallest value of route start cumul variables. In other words: global_span_cost =   coefficient * (Max(dimension end value) - Min(dimension start value))."""
        return _pywrapcp.RoutingDimension_SetGlobalSpanCostCoefficient(self, coefficient)

    def SetCumulVarSoftUpperBound(self, index: "int64", upper_bound: "int64", coefficient: "int64") -> "void":
        r""" Sets a soft upper bound to the cumul variable of a given variable index. If the value of the cumul variable is greater than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar <= upper_bound -> cost = 0    cumulVar > upper_bound -> cost = coefficient * (cumulVar - upper_bound) This is also handy to model tardiness costs when the dimension represents time."""
        return _pywrapcp.RoutingDimension_SetCumulVarSoftUpperBound(self, index, upper_bound, coefficient)

    def HasCumulVarSoftUpperBound(self, index: "int64") -> "bool":
        r""" Returns true if a soft upper bound has been set for a given variable index."""
        return _pywrapcp.RoutingDimension_HasCumulVarSoftUpperBound(self, index)

    def GetCumulVarSoftUpperBound(self, index: "int64") -> "int64":
        r""" Returns the soft upper bound of a cumul variable for a given variable index. The "hard" upper bound of the variable is returned if no soft upper bound has been set."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBound(self, index)

    def GetCumulVarSoftUpperBoundCoefficient(self, index: "int64") -> "int64":
        r""" Returns the cost coefficient of the soft upper bound of a cumul variable for a given variable index. If no soft upper bound has been set, 0 is returned."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBoundCoefficient(self, index)

    def SetCumulVarSoftLowerBound(self, index: "int64", lower_bound: "int64", coefficient: "int64") -> "void":
        r""" Sets a soft lower bound to the cumul variable of a given variable index. If the value of the cumul variable is less than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar > lower_bound -> cost = 0   cumulVar <= lower_bound -> cost = coefficient * (lower_bound -               cumulVar). This is also handy to model earliness costs when the dimension represents time. Note: Using soft lower and upper bounds or span costs together is, as of 6/2014, not well supported in the sense that an optimal schedule is not guaranteed."""
        return _pywrapcp.RoutingDimension_SetCumulVarSoftLowerBound(self, index, lower_bound, coefficient)

    def HasCumulVarSoftLowerBound(self, index: "int64") -> "bool":
        r""" Returns true if a soft lower bound has been set for a given variable index."""
        return _pywrapcp.RoutingDimension_HasCumulVarSoftLowerBound(self, index)

    def GetCumulVarSoftLowerBound(self, index: "int64") -> "int64":
        r""" Returns the soft lower bound of a cumul variable for a given variable index. The "hard" lower bound of the variable is returned if no soft lower bound has been set."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBound(self, index)

    def GetCumulVarSoftLowerBoundCoefficient(self, index: "int64") -> "int64":
        r""" Returns the cost coefficient of the soft lower bound of a cumul variable for a given variable index. If no soft lower bound has been set, 0 is returned."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBoundCoefficient(self, index)

    def SetBreakIntervalsOfVehicle(self, breaks: "std::vector< operations_research::IntervalVar * >", vehicle: "int", node_visit_transits: "std::vector< int64 >") -> "void":
        r""" Sets the breaks for a given vehicle. Breaks are represented by IntervalVars. They may interrupt transits between nodes and increase the value of corresponding slack variables. A break may take place before the start of a vehicle, after the end of a vehicle, or during a travel i -> j. In that case, the interval [break.Start(), break.End()) must be a subset of [CumulVar(i) + pre_travel(i, j), CumulVar(j) - post_travel(i, j)). In other words, a break may not overlap any node n's visit, given by [CumulVar(n) - post_travel(_, n), CumulVar(n) + pre_travel(n, _)). This formula considers post_travel(_, start) and pre_travel(end, _) to be 0; pre_travel will never be called on any (_, start) and post_travel will never we called on any (end, _). If pre_travel_evaluator or post_travel_evaluator is -1, it will be taken as a function that always returns 0. Deprecated, sets pre_travel(i, j) = node_visit_transit[i]."""
        return _pywrapcp.RoutingDimension_SetBreakIntervalsOfVehicle(self, breaks, vehicle, node_visit_transits)

    def SetBreakDistanceDurationOfVehicle(self, distance: "int64", duration: "int64", vehicle: "int") -> "void":
        r""" With breaks supposed to be consecutive, this forces the distance between breaks of size at least minimum_break_duration to be at least distance. This supposes that the time until route start and after route end are infinite breaks."""
        return _pywrapcp.RoutingDimension_SetBreakDistanceDurationOfVehicle(self, distance, duration, vehicle)

    def InitializeBreaks(self) -> "void":
        r""" Sets up vehicle_break_intervals_, vehicle_break_distance_duration_, pre_travel_evaluators and post_travel_evaluators."""
        return _pywrapcp.RoutingDimension_InitializeBreaks(self)

    def HasBreakConstraints(self) -> "bool":
        r""" Returns true if any break interval or break distance was defined."""
        return _pywrapcp.RoutingDimension_HasBreakConstraints(self)

    def GetPreTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
        return _pywrapcp.RoutingDimension_GetPreTravelEvaluatorOfVehicle(self, vehicle)

    def GetPostTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
        return _pywrapcp.RoutingDimension_GetPostTravelEvaluatorOfVehicle(self, vehicle)

    def base_dimension(self) -> "operations_research::RoutingDimension const *":
        r""" Returns the parent in the dependency tree if any or nullptr otherwise."""
        return _pywrapcp.RoutingDimension_base_dimension(self)

    def ShortestTransitionSlack(self, node: "int64") -> "int64":
        r""" It makes sense to use the function only for self-dependent dimension. For such dimensions the value of the slack of a node determines the transition cost of the next transit. Provided that   1. cumul[node] is fixed,   2. next[node] and next[next[node]] (if exists) are fixed, the value of slack[node] for which cumul[next[node]] + transit[next[node]] is minimized can be found in O(1) using this function."""
        return _pywrapcp.RoutingDimension_ShortestTransitionSlack(self, node)

    def name(self) -> "std::string const &":
        r""" Returns the name of the dimension."""
        return _pywrapcp.RoutingDimension_name(self)

    def SetPickupToDeliveryLimitFunctionForPair(self, limit_function: "operations_research::RoutingDimension::PickupToDeliveryLimitFunction", pair_index: "int") -> "void":
        return _pywrapcp.RoutingDimension_SetPickupToDeliveryLimitFunctionForPair(self, limit_function, pair_index)

    def HasPickupToDeliveryLimits(self) -> "bool":
        return _pywrapcp.RoutingDimension_HasPickupToDeliveryLimits(self)

    def AddNodePrecedence(self, first_node: "int64", second_node: "int64", offset: "int64") -> "void":
        return _pywrapcp.RoutingDimension_AddNodePrecedence(self, first_node, second_node, offset)

    def GetSpanUpperBoundForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetSpanUpperBoundForVehicle(self, vehicle)

    def GetSpanCostCoefficientForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetSpanCostCoefficientForVehicle(self, vehicle)

    def global_span_cost_coefficient(self) -> "int64":
        return _pywrapcp.RoutingDimension_global_span_cost_coefficient(self)

    def GetGlobalOptimizerOffset(self) -> "int64":
        return _pywrapcp.RoutingDimension_GetGlobalOptimizerOffset(self)

    def GetLocalOptimizerOffsetForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetLocalOptimizerOffsetForVehicle(self, vehicle)

# Register RoutingDimension in _pywrapcp:
_pywrapcp.RoutingDimension_swigregister(RoutingDimension)


def MakeSetValuesFromTargets(solver: "Solver", variables: "std::vector< operations_research::IntVar * >", targets: "std::vector< int64 >") -> "operations_research::DecisionBuilder *":
    r""" A decision builder which tries to assign values to variables as close as possible to target values first."""
    return _pywrapcp.MakeSetValuesFromTargets(solver, variables, targets)
class IntVarFilteredDecisionBuilder(DecisionBuilder):
    r""" Decision builders building a solution using local search filters to evaluate its feasibility. This is very fast but can eventually fail when the solution is restored if filters did not detect all infeasiblities. More details: Using local search filters to build a solution. The approach is pretty straight-forward: have a general assignment storing the current solution, build delta assigment representing possible extensions to the current solution and validate them with filters. The tricky bit comes from using the assignment and filter APIs in a way which avoids the lazy creation of internal hash_maps between variables and indices. Generic filter-based decision builder applied to IntVars. when the code is mature enough."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_IntVarFilteredDecisionBuilder

    def NextWrapper(self, solver: "Solver") -> "operations_research::Decision *":
        return _pywrapcp.IntVarFilteredDecisionBuilder_NextWrapper(self, solver)

    def BuildSolution(self) -> "bool":
        r""" Virtual method to redefine to build a solution."""
        return _pywrapcp.IntVarFilteredDecisionBuilder_BuildSolution(self)

    def number_of_decisions(self) -> "int64":
        r""" Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters."""
        return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_decisions(self)

    def number_of_rejects(self) -> "int64":
        return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_rejects(self)

# Register IntVarFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.IntVarFilteredDecisionBuilder_swigregister(IntVarFilteredDecisionBuilder)

class RoutingFilteredDecisionBuilder(IntVarFilteredDecisionBuilder):
    r""" Filter-based decision builder dedicated to routing."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_RoutingFilteredDecisionBuilder

    def model(self) -> "operations_research::RoutingModel *":
        return _pywrapcp.RoutingFilteredDecisionBuilder_model(self)

    def GetStartChainEnd(self, vehicle: "int") -> "int":
        r""" Returns the end of the start chain of vehicle,"""
        return _pywrapcp.RoutingFilteredDecisionBuilder_GetStartChainEnd(self, vehicle)

    def GetEndChainStart(self, vehicle: "int") -> "int":
        r""" Returns the start of the end chain of vehicle,"""
        return _pywrapcp.RoutingFilteredDecisionBuilder_GetEndChainStart(self, vehicle)

    def MakeDisjunctionNodesUnperformed(self, node: "int64") -> "void":
        r""" Make nodes in the same disjunction as 'node' unperformed. 'node' is a variable index corresponding to a node."""
        return _pywrapcp.RoutingFilteredDecisionBuilder_MakeDisjunctionNodesUnperformed(self, node)

    def MakeUnassignedNodesUnperformed(self) -> "void":
        r""" Make all unassigned nodes unperformed."""
        return _pywrapcp.RoutingFilteredDecisionBuilder_MakeUnassignedNodesUnperformed(self)

# Register RoutingFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.RoutingFilteredDecisionBuilder_swigregister(RoutingFilteredDecisionBuilder)

class CheapestInsertionFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_CheapestInsertionFilteredDecisionBuilder

# Register CheapestInsertionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.CheapestInsertionFilteredDecisionBuilder_swigregister(CheapestInsertionFilteredDecisionBuilder)

class GlobalCheapestInsertionFilteredDecisionBuilder(CheapestInsertionFilteredDecisionBuilder):
    r""" Filter-based decision builder which builds a solution by inserting nodes at their cheapest position on any route; potentially several routes can be built in parallel. The cost of a position is computed from an arc-based cost callback. The node selected for insertion is the one which minimizes insertion cost. If a non null penalty evaluator is passed, making nodes unperformed is also taken into account with the corresponding penalty cost."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_GlobalCheapestInsertionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_DebugString(self)

# Register GlobalCheapestInsertionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_swigregister(GlobalCheapestInsertionFilteredDecisionBuilder)

class LocalCheapestInsertionFilteredDecisionBuilder(CheapestInsertionFilteredDecisionBuilder):
    r""" Filter-base decision builder which builds a solution by inserting nodes at their cheapest position. The cost of a position is computed an arc-based cost callback. Node selected for insertion are considered in decreasing order of distance to the start/ends of the routes, i.e. farthest nodes are inserted first."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_LocalCheapestInsertionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_DebugString(self)

# Register LocalCheapestInsertionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_swigregister(LocalCheapestInsertionFilteredDecisionBuilder)

class CheapestAdditionFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    r""" Filtered-base decision builder based on the addition heuristic, extending a path from its start node with the cheapest arc."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_CheapestAdditionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.CheapestAdditionFilteredDecisionBuilder_BuildSolution(self)

# Register CheapestAdditionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.CheapestAdditionFilteredDecisionBuilder_swigregister(CheapestAdditionFilteredDecisionBuilder)

class EvaluatorCheapestAdditionFilteredDecisionBuilder(CheapestAdditionFilteredDecisionBuilder):
    r""" A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc evaluator."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_EvaluatorCheapestAdditionFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.EvaluatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)

# Register EvaluatorCheapestAdditionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.EvaluatorCheapestAdditionFilteredDecisionBuilder_swigregister(EvaluatorCheapestAdditionFilteredDecisionBuilder)

class ComparatorCheapestAdditionFilteredDecisionBuilder(CheapestAdditionFilteredDecisionBuilder):
    r""" A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc comparator."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ComparatorCheapestAdditionFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.ComparatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)

# Register ComparatorCheapestAdditionFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.ComparatorCheapestAdditionFilteredDecisionBuilder_swigregister(ComparatorCheapestAdditionFilteredDecisionBuilder)

class SavingsFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    r""" Filter-based decision builder which builds a solution by using Clarke & Wright's Savings heuristic. For each pair of nodes, the savings value is the difference between the cost of two routes visiting one node each and one route visiting both nodes. Routes are built sequentially, each route being initialized from the pair with the best avalaible savings value then extended by selecting the nodes with best savings on both ends of the partial route. Cost is based on the arc cost function of the routing model and cost classes are taken into account."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_SavingsFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.SavingsFilteredDecisionBuilder_BuildSolution(self)

# Register SavingsFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.SavingsFilteredDecisionBuilder_swigregister(SavingsFilteredDecisionBuilder)

class SequentialSavingsFilteredDecisionBuilder(SavingsFilteredDecisionBuilder):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_SequentialSavingsFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.SequentialSavingsFilteredDecisionBuilder_DebugString(self)

# Register SequentialSavingsFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.SequentialSavingsFilteredDecisionBuilder_swigregister(SequentialSavingsFilteredDecisionBuilder)

class ParallelSavingsFilteredDecisionBuilder(SavingsFilteredDecisionBuilder):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ParallelSavingsFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.ParallelSavingsFilteredDecisionBuilder_DebugString(self)

# Register ParallelSavingsFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.ParallelSavingsFilteredDecisionBuilder_swigregister(ParallelSavingsFilteredDecisionBuilder)

class ChristofidesFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    r""" Christofides addition heuristic. Initially created to solve TSPs, extended to support any model by extending routes as much as possible following the path found by the heuristic, before starting a new route."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ChristofidesFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.ChristofidesFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.ChristofidesFilteredDecisionBuilder_DebugString(self)

# Register ChristofidesFilteredDecisionBuilder in _pywrapcp:
_pywrapcp.ChristofidesFilteredDecisionBuilder_swigregister(ChristofidesFilteredDecisionBuilder)


def SolveModelWithSat(model: "RoutingModel", search_parameters: "operations_research::RoutingSearchParameters const &", initial_solution: "Assignment", solution: "Assignment") -> "bool":
    r""" Attempts to solve the model using the cp-sat solver. As of 5/2019, will solve the TSP corresponding to the model if it has a single vehicle. Therefore the resulting solution might not actually be feasible. Will return false if a solution could not be found."""
    return _pywrapcp.SolveModelWithSat(model, search_parameters, initial_solution, solution)
class BasePathFilter(IntVarLocalSearchFilter):
    r""" Generic path-based filter class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_BasePathFilter

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        return _pywrapcp.BasePathFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def OnSynchronize(self, delta: "Assignment") -> "void":
        return _pywrapcp.BasePathFilter_OnSynchronize(self, delta)

# Register BasePathFilter in _pywrapcp:
_pywrapcp.BasePathFilter_swigregister(BasePathFilter)

class CPFeasibilityFilter(IntVarLocalSearchFilter):
    r""" This filter accepts deltas for which the assignment satisfies the constraints of the Solver. This is verified by keeping an internal copy of the assignment with all Next vars and their updated values, and calling RestoreAssignment() on the assignment+delta. exception of Next Vars (woud fail on large instances). WARNING: In the case of mandatory nodes, when all vehicles are currently being used in the solution but uninserted nodes still remain, this filter will reject the solution, even if the node could be inserted on one of these routes, because all Next vars of vehicle starts are already instantiated."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, routing_model: "RoutingModel"):
        _pywrapcp.CPFeasibilityFilter_swiginit(self, _pywrapcp.new_CPFeasibilityFilter(routing_model))
    __swig_destroy__ = _pywrapcp.delete_CPFeasibilityFilter

    def DebugString(self) -> "std::string":
        return _pywrapcp.CPFeasibilityFilter_DebugString(self)

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        return _pywrapcp.CPFeasibilityFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def OnSynchronize(self, delta: "Assignment") -> "void":
        return _pywrapcp.CPFeasibilityFilter_OnSynchronize(self, delta)

# Register CPFeasibilityFilter in _pywrapcp:
_pywrapcp.CPFeasibilityFilter_swigregister(CPFeasibilityFilter)
Functions

DefaultRoutingModelParameters

def DefaultRoutingModelParameters()
Expand source code
def DefaultRoutingModelParameters() -> "operations_research::RoutingModelParameters":
    return _pywrapcp.DefaultRoutingModelParameters()

DefaultRoutingSearchParameters

def DefaultRoutingSearchParameters()
Expand source code
def DefaultRoutingSearchParameters() -> "operations_research::RoutingSearchParameters":
    return _pywrapcp.DefaultRoutingSearchParameters()

FindErrorInRoutingSearchParameters

def FindErrorInRoutingSearchParameters(search_parameters)

Returns an empty std::string if the routing search parameters are valid, and a non-empty, human readable error description if they're not.

Expand source code
def FindErrorInRoutingSearchParameters(search_parameters: "operations_research::RoutingSearchParameters const &") -> "std::string":
    r""" Returns an empty std::string if the routing search parameters are valid, and a non-empty, human readable error description if they're not."""
    return _pywrapcp.FindErrorInRoutingSearchParameters(search_parameters)

MakeSetValuesFromTargets

def MakeSetValuesFromTargets(solver, variables, targets)

A decision builder which tries to assign values to variables as close as possible to target values first.

Expand source code
def MakeSetValuesFromTargets(solver: "Solver", variables: "std::vector< operations_research::IntVar * >", targets: "std::vector< int64 >") -> "operations_research::DecisionBuilder *":
    r""" A decision builder which tries to assign values to variables as close as possible to target values first."""
    return _pywrapcp.MakeSetValuesFromTargets(solver, variables, targets)

SolveModelWithSat

def SolveModelWithSat(model, search_parameters, initial_solution, solution)

Attempts to solve the model using the cp-sat solver. As of 5/2019, will solve the TSP corresponding to the model if it has a single vehicle. Therefore the resulting solution might not actually be feasible. Will return false if a solution could not be found.

Expand source code
def SolveModelWithSat(model: "RoutingModel", search_parameters: "operations_research::RoutingSearchParameters const &", initial_solution: "Assignment", solution: "Assignment") -> "bool":
    r""" Attempts to solve the model using the cp-sat solver. As of 5/2019, will solve the TSP corresponding to the model if it has a single vehicle. Therefore the resulting solution might not actually be feasible. Will return false if a solution could not be found."""
    return _pywrapcp.SolveModelWithSat(model, search_parameters, initial_solution, solution)

Solver_DefaultSolverParameters

def Solver_DefaultSolverParameters()

Create a ConstraintSolverParameters proto with all the default values.

Expand source code
def Solver_DefaultSolverParameters() -> "operations_research::ConstraintSolverParameters":
    r""" Create a ConstraintSolverParameters proto with all the default values."""
    return _pywrapcp.Solver_DefaultSolverParameters()

Solver_MemoryUsage

def Solver_MemoryUsage()

Current memory usage in bytes

Expand source code
def Solver_MemoryUsage() -> "int64":
    r""" Current memory usage in bytes"""
    return _pywrapcp.Solver_MemoryUsage()
Classes

Assignment

class Assignment (*args, **kwargs)

An Assignment is a variable -> domains mapping, used to report solutions to the user.

Expand source code
class Assignment(PropagationBaseObject):
    r""" An Assignment is a variable -> domains mapping, used to report solutions to the user."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Clear(self) -> "void":
        return _pywrapcp.Assignment_Clear(self)

    def Empty(self) -> "bool":
        return _pywrapcp.Assignment_Empty(self)

    def Size(self) -> "int":
        return _pywrapcp.Assignment_Size(self)

    def NumIntVars(self) -> "int":
        return _pywrapcp.Assignment_NumIntVars(self)

    def NumIntervalVars(self) -> "int":
        return _pywrapcp.Assignment_NumIntervalVars(self)

    def NumSequenceVars(self) -> "int":
        return _pywrapcp.Assignment_NumSequenceVars(self)

    def Store(self) -> "void":
        return _pywrapcp.Assignment_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.Assignment_Restore(self)

    def Load(self, *args) -> "void":
        return _pywrapcp.Assignment_Load(self, *args)

    def Save(self, *args) -> "void":
        return _pywrapcp.Assignment_Save(self, *args)

    def AddObjective(self, v: "IntVar") -> "void":
        return _pywrapcp.Assignment_AddObjective(self, v)

    def Objective(self) -> "operations_research::IntVar *":
        return _pywrapcp.Assignment_Objective(self)

    def HasObjective(self) -> "bool":
        return _pywrapcp.Assignment_HasObjective(self)

    def ObjectiveMin(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveMin(self)

    def ObjectiveMax(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveMax(self)

    def ObjectiveValue(self) -> "int64":
        return _pywrapcp.Assignment_ObjectiveValue(self)

    def ObjectiveBound(self) -> "bool":
        return _pywrapcp.Assignment_ObjectiveBound(self)

    def SetObjectiveMin(self, m: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveMin(self, m)

    def SetObjectiveMax(self, m: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveMax(self, m)

    def SetObjectiveValue(self, value: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveValue(self, value)

    def SetObjectiveRange(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.Assignment_SetObjectiveRange(self, l, u)

    def Min(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Min(self, var)

    def Max(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Max(self, var)

    def Value(self, var: "IntVar") -> "int64":
        return _pywrapcp.Assignment_Value(self, var)

    def Bound(self, var: "IntVar") -> "bool":
        return _pywrapcp.Assignment_Bound(self, var)

    def SetMin(self, var: "IntVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetMin(self, var, m)

    def SetMax(self, var: "IntVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetMax(self, var, m)

    def SetRange(self, var: "IntVar", l: "int64", u: "int64") -> "void":
        return _pywrapcp.Assignment_SetRange(self, var, l, u)

    def SetValue(self, var: "IntVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetValue(self, var, value)

    def StartMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartMin(self, var)

    def StartMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartMax(self, var)

    def StartValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_StartValue(self, var)

    def DurationMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationMin(self, var)

    def DurationMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationMax(self, var)

    def DurationValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_DurationValue(self, var)

    def EndMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndMin(self, var)

    def EndMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndMax(self, var)

    def EndValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_EndValue(self, var)

    def PerformedMin(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedMin(self, var)

    def PerformedMax(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedMax(self, var)

    def PerformedValue(self, var: "IntervalVar") -> "int64":
        return _pywrapcp.Assignment_PerformedValue(self, var)

    def SetStartMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartMin(self, var, m)

    def SetStartMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartMax(self, var, m)

    def SetStartRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartRange(self, var, mi, ma)

    def SetStartValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetStartValue(self, var, value)

    def SetDurationMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationMin(self, var, m)

    def SetDurationMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationMax(self, var, m)

    def SetDurationRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationRange(self, var, mi, ma)

    def SetDurationValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetDurationValue(self, var, value)

    def SetEndMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndMin(self, var, m)

    def SetEndMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndMax(self, var, m)

    def SetEndRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndRange(self, var, mi, ma)

    def SetEndValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetEndValue(self, var, value)

    def SetPerformedMin(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedMin(self, var, m)

    def SetPerformedMax(self, var: "IntervalVar", m: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedMax(self, var, m)

    def SetPerformedRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedRange(self, var, mi, ma)

    def SetPerformedValue(self, var: "IntervalVar", value: "int64") -> "void":
        return _pywrapcp.Assignment_SetPerformedValue(self, var, value)

    def Add(self, *args) -> "void":
        return _pywrapcp.Assignment_Add(self, *args)

    def ForwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_ForwardSequence(self, var)

    def BackwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_BackwardSequence(self, var)

    def Unperformed(self, var: "SequenceVar") -> "std::vector< int > const &":
        return _pywrapcp.Assignment_Unperformed(self, var)

    def SetSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &", backward_sequence: "std::vector< int > const &", unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetSequence(self, var, forward_sequence, backward_sequence, unperformed)

    def SetForwardSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetForwardSequence(self, var, forward_sequence)

    def SetBackwardSequence(self, var: "SequenceVar", backward_sequence: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetBackwardSequence(self, var, backward_sequence)

    def SetUnperformed(self, var: "SequenceVar", unperformed: "std::vector< int > const &") -> "void":
        return _pywrapcp.Assignment_SetUnperformed(self, var, unperformed)

    def Activate(self, *args) -> "void":
        return _pywrapcp.Assignment_Activate(self, *args)

    def Deactivate(self, *args) -> "void":
        return _pywrapcp.Assignment_Deactivate(self, *args)

    def Activated(self, *args) -> "bool":
        return _pywrapcp.Assignment_Activated(self, *args)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Assignment_DebugString(self)

    def IntVarContainer(self) -> "operations_research::Assignment::IntContainer const &":
        return _pywrapcp.Assignment_IntVarContainer(self)

    def MutableIntVarContainer(self) -> "operations_research::Assignment::IntContainer *":
        return _pywrapcp.Assignment_MutableIntVarContainer(self)

    def IntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer const &":
        return _pywrapcp.Assignment_IntervalVarContainer(self)

    def MutableIntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer *":
        return _pywrapcp.Assignment_MutableIntervalVarContainer(self)

    def SequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer const &":
        return _pywrapcp.Assignment_SequenceVarContainer(self)

    def MutableSequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer *":
        return _pywrapcp.Assignment_MutableSequenceVarContainer(self)

    def __eq__(self, assignment: "Assignment") -> "bool":
        return _pywrapcp.Assignment___eq__(self, assignment)

    def __ne__(self, assignment: "Assignment") -> "bool":
        return _pywrapcp.Assignment___ne__(self, assignment)
Ancestors
Methods

Activate

def Activate(self, *args)
Expand source code
def Activate(self, *args) -> "void":
    return _pywrapcp.Assignment_Activate(self, *args)

Activated

def Activated(self, *args)
Expand source code
def Activated(self, *args) -> "bool":
    return _pywrapcp.Assignment_Activated(self, *args)

Add

def Add(self, *args)
Expand source code
def Add(self, *args) -> "void":
    return _pywrapcp.Assignment_Add(self, *args)

AddObjective

def AddObjective(self, v)
Expand source code
def AddObjective(self, v: "IntVar") -> "void":
    return _pywrapcp.Assignment_AddObjective(self, v)

BackwardSequence

def BackwardSequence(self, var)
Expand source code
def BackwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
    return _pywrapcp.Assignment_BackwardSequence(self, var)

Bound

def Bound(self, var)
Expand source code
def Bound(self, var: "IntVar") -> "bool":
    return _pywrapcp.Assignment_Bound(self, var)

Clear

def Clear(self)
Expand source code
def Clear(self) -> "void":
    return _pywrapcp.Assignment_Clear(self)

Deactivate

def Deactivate(self, *args)
Expand source code
def Deactivate(self, *args) -> "void":
    return _pywrapcp.Assignment_Deactivate(self, *args)

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.Assignment_DebugString(self)

DurationMax

def DurationMax(self, var)
Expand source code
def DurationMax(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_DurationMax(self, var)

DurationMin

def DurationMin(self, var)
Expand source code
def DurationMin(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_DurationMin(self, var)

DurationValue

def DurationValue(self, var)
Expand source code
def DurationValue(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_DurationValue(self, var)

Empty

def Empty(self)
Expand source code
def Empty(self) -> "bool":
    return _pywrapcp.Assignment_Empty(self)

EndMax

def EndMax(self, var)
Expand source code
def EndMax(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_EndMax(self, var)

EndMin

def EndMin(self, var)
Expand source code
def EndMin(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_EndMin(self, var)

EndValue

def EndValue(self, var)
Expand source code
def EndValue(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_EndValue(self, var)

ForwardSequence

def ForwardSequence(self, var)
Expand source code
def ForwardSequence(self, var: "SequenceVar") -> "std::vector< int > const &":
    return _pywrapcp.Assignment_ForwardSequence(self, var)

HasObjective

def HasObjective(self)
Expand source code
def HasObjective(self) -> "bool":
    return _pywrapcp.Assignment_HasObjective(self)

IntVarContainer

def IntVarContainer(self)
Expand source code
def IntVarContainer(self) -> "operations_research::Assignment::IntContainer const &":
    return _pywrapcp.Assignment_IntVarContainer(self)

IntervalVarContainer

def IntervalVarContainer(self)
Expand source code
def IntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer const &":
    return _pywrapcp.Assignment_IntervalVarContainer(self)

Load

def Load(self, *args)
Expand source code
def Load(self, *args) -> "void":
    return _pywrapcp.Assignment_Load(self, *args)

Max

def Max(self, var)
Expand source code
def Max(self, var: "IntVar") -> "int64":
    return _pywrapcp.Assignment_Max(self, var)

Min

def Min(self, var)
Expand source code
def Min(self, var: "IntVar") -> "int64":
    return _pywrapcp.Assignment_Min(self, var)

MutableIntVarContainer

def MutableIntVarContainer(self)
Expand source code
def MutableIntVarContainer(self) -> "operations_research::Assignment::IntContainer *":
    return _pywrapcp.Assignment_MutableIntVarContainer(self)

MutableIntervalVarContainer

def MutableIntervalVarContainer(self)
Expand source code
def MutableIntervalVarContainer(self) -> "operations_research::Assignment::IntervalContainer *":
    return _pywrapcp.Assignment_MutableIntervalVarContainer(self)

MutableSequenceVarContainer

def MutableSequenceVarContainer(self)
Expand source code
def MutableSequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer *":
    return _pywrapcp.Assignment_MutableSequenceVarContainer(self)

NumIntVars

def NumIntVars(self)
Expand source code
def NumIntVars(self) -> "int":
    return _pywrapcp.Assignment_NumIntVars(self)

NumIntervalVars

def NumIntervalVars(self)
Expand source code
def NumIntervalVars(self) -> "int":
    return _pywrapcp.Assignment_NumIntervalVars(self)

NumSequenceVars

def NumSequenceVars(self)
Expand source code
def NumSequenceVars(self) -> "int":
    return _pywrapcp.Assignment_NumSequenceVars(self)

Objective

def Objective(self)
Expand source code
def Objective(self) -> "operations_research::IntVar *":
    return _pywrapcp.Assignment_Objective(self)

ObjectiveBound

def ObjectiveBound(self)
Expand source code
def ObjectiveBound(self) -> "bool":
    return _pywrapcp.Assignment_ObjectiveBound(self)

ObjectiveMax

def ObjectiveMax(self)
Expand source code
def ObjectiveMax(self) -> "int64":
    return _pywrapcp.Assignment_ObjectiveMax(self)

ObjectiveMin

def ObjectiveMin(self)
Expand source code
def ObjectiveMin(self) -> "int64":
    return _pywrapcp.Assignment_ObjectiveMin(self)

ObjectiveValue

def ObjectiveValue(self)
Expand source code
def ObjectiveValue(self) -> "int64":
    return _pywrapcp.Assignment_ObjectiveValue(self)

PerformedMax

def PerformedMax(self, var)
Expand source code
def PerformedMax(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_PerformedMax(self, var)

PerformedMin

def PerformedMin(self, var)
Expand source code
def PerformedMin(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_PerformedMin(self, var)

PerformedValue

def PerformedValue(self, var)
Expand source code
def PerformedValue(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_PerformedValue(self, var)

Restore

def Restore(self)
Expand source code
def Restore(self) -> "void":
    return _pywrapcp.Assignment_Restore(self)

Save

def Save(self, *args)
Expand source code
def Save(self, *args) -> "void":
    return _pywrapcp.Assignment_Save(self, *args)

SequenceVarContainer

def SequenceVarContainer(self)
Expand source code
def SequenceVarContainer(self) -> "operations_research::Assignment::SequenceContainer const &":
    return _pywrapcp.Assignment_SequenceVarContainer(self)

SetBackwardSequence

def SetBackwardSequence(self, var, backward_sequence)
Expand source code
def SetBackwardSequence(self, var: "SequenceVar", backward_sequence: "std::vector< int > const &") -> "void":
    return _pywrapcp.Assignment_SetBackwardSequence(self, var, backward_sequence)

SetDurationMax

def SetDurationMax(self, var, m)
Expand source code
def SetDurationMax(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetDurationMax(self, var, m)

SetDurationMin

def SetDurationMin(self, var, m)
Expand source code
def SetDurationMin(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetDurationMin(self, var, m)

SetDurationRange

def SetDurationRange(self, var, mi, ma)
Expand source code
def SetDurationRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.Assignment_SetDurationRange(self, var, mi, ma)

SetDurationValue

def SetDurationValue(self, var, value)
Expand source code
def SetDurationValue(self, var: "IntervalVar", value: "int64") -> "void":
    return _pywrapcp.Assignment_SetDurationValue(self, var, value)

SetEndMax

def SetEndMax(self, var, m)
Expand source code
def SetEndMax(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetEndMax(self, var, m)

SetEndMin

def SetEndMin(self, var, m)
Expand source code
def SetEndMin(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetEndMin(self, var, m)

SetEndRange

def SetEndRange(self, var, mi, ma)
Expand source code
def SetEndRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.Assignment_SetEndRange(self, var, mi, ma)

SetEndValue

def SetEndValue(self, var, value)
Expand source code
def SetEndValue(self, var: "IntervalVar", value: "int64") -> "void":
    return _pywrapcp.Assignment_SetEndValue(self, var, value)

SetForwardSequence

def SetForwardSequence(self, var, forward_sequence)
Expand source code
def SetForwardSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &") -> "void":
    return _pywrapcp.Assignment_SetForwardSequence(self, var, forward_sequence)

SetMax

def SetMax(self, var, m)
Expand source code
def SetMax(self, var: "IntVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetMax(self, var, m)

SetMin

def SetMin(self, var, m)
Expand source code
def SetMin(self, var: "IntVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetMin(self, var, m)

SetObjectiveMax

def SetObjectiveMax(self, m)
Expand source code
def SetObjectiveMax(self, m: "int64") -> "void":
    return _pywrapcp.Assignment_SetObjectiveMax(self, m)

SetObjectiveMin

def SetObjectiveMin(self, m)
Expand source code
def SetObjectiveMin(self, m: "int64") -> "void":
    return _pywrapcp.Assignment_SetObjectiveMin(self, m)

SetObjectiveRange

def SetObjectiveRange(self, l, u)
Expand source code
def SetObjectiveRange(self, l: "int64", u: "int64") -> "void":
    return _pywrapcp.Assignment_SetObjectiveRange(self, l, u)

SetObjectiveValue

def SetObjectiveValue(self, value)
Expand source code
def SetObjectiveValue(self, value: "int64") -> "void":
    return _pywrapcp.Assignment_SetObjectiveValue(self, value)

SetPerformedMax

def SetPerformedMax(self, var, m)
Expand source code
def SetPerformedMax(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetPerformedMax(self, var, m)

SetPerformedMin

def SetPerformedMin(self, var, m)
Expand source code
def SetPerformedMin(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetPerformedMin(self, var, m)

SetPerformedRange

def SetPerformedRange(self, var, mi, ma)
Expand source code
def SetPerformedRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.Assignment_SetPerformedRange(self, var, mi, ma)

SetPerformedValue

def SetPerformedValue(self, var, value)
Expand source code
def SetPerformedValue(self, var: "IntervalVar", value: "int64") -> "void":
    return _pywrapcp.Assignment_SetPerformedValue(self, var, value)

SetRange

def SetRange(self, var, l, u)
Expand source code
def SetRange(self, var: "IntVar", l: "int64", u: "int64") -> "void":
    return _pywrapcp.Assignment_SetRange(self, var, l, u)

SetSequence

def SetSequence(self, var, forward_sequence, backward_sequence, unperformed)
Expand source code
def SetSequence(self, var: "SequenceVar", forward_sequence: "std::vector< int > const &", backward_sequence: "std::vector< int > const &", unperformed: "std::vector< int > const &") -> "void":
    return _pywrapcp.Assignment_SetSequence(self, var, forward_sequence, backward_sequence, unperformed)

SetStartMax

def SetStartMax(self, var, m)
Expand source code
def SetStartMax(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetStartMax(self, var, m)

SetStartMin

def SetStartMin(self, var, m)
Expand source code
def SetStartMin(self, var: "IntervalVar", m: "int64") -> "void":
    return _pywrapcp.Assignment_SetStartMin(self, var, m)

SetStartRange

def SetStartRange(self, var, mi, ma)
Expand source code
def SetStartRange(self, var: "IntervalVar", mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.Assignment_SetStartRange(self, var, mi, ma)

SetStartValue

def SetStartValue(self, var, value)
Expand source code
def SetStartValue(self, var: "IntervalVar", value: "int64") -> "void":
    return _pywrapcp.Assignment_SetStartValue(self, var, value)

SetUnperformed

def SetUnperformed(self, var, unperformed)
Expand source code
def SetUnperformed(self, var: "SequenceVar", unperformed: "std::vector< int > const &") -> "void":
    return _pywrapcp.Assignment_SetUnperformed(self, var, unperformed)

SetValue

def SetValue(self, var, value)
Expand source code
def SetValue(self, var: "IntVar", value: "int64") -> "void":
    return _pywrapcp.Assignment_SetValue(self, var, value)

Size

def Size(self)
Expand source code
def Size(self) -> "int":
    return _pywrapcp.Assignment_Size(self)

StartMax

def StartMax(self, var)
Expand source code
def StartMax(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_StartMax(self, var)

StartMin

def StartMin(self, var)
Expand source code
def StartMin(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_StartMin(self, var)

StartValue

def StartValue(self, var)
Expand source code
def StartValue(self, var: "IntervalVar") -> "int64":
    return _pywrapcp.Assignment_StartValue(self, var)

Store

def Store(self)
Expand source code
def Store(self) -> "void":
    return _pywrapcp.Assignment_Store(self)

Unperformed

def Unperformed(self, var)
Expand source code
def Unperformed(self, var: "SequenceVar") -> "std::vector< int > const &":
    return _pywrapcp.Assignment_Unperformed(self, var)

Value

def Value(self, var)
Expand source code
def Value(self, var: "IntVar") -> "int64":
    return _pywrapcp.Assignment_Value(self, var)
Inherited members

AssignmentElement

class AssignmentElement (*args, **kwargs)
Expand source code
class AssignmentElement(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Activate(self) -> "void":
        return _pywrapcp.AssignmentElement_Activate(self)

    def Deactivate(self) -> "void":
        return _pywrapcp.AssignmentElement_Deactivate(self)

    def Activated(self) -> "bool":
        return _pywrapcp.AssignmentElement_Activated(self)
    __swig_destroy__ = _pywrapcp.delete_AssignmentElement
Subclasses
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

Activate

def Activate(self)
Expand source code
def Activate(self) -> "void":
    return _pywrapcp.AssignmentElement_Activate(self)

Activated

def Activated(self)
Expand source code
def Activated(self) -> "bool":
    return _pywrapcp.AssignmentElement_Activated(self)

Deactivate

def Deactivate(self)
Expand source code
def Deactivate(self) -> "void":
    return _pywrapcp.AssignmentElement_Deactivate(self)

BaseLns

class BaseLns (vars)

This is the base class for building an Lns operator. An Lns fragment is a collection of variables which will be relaxed. Fragments are built with NextFragment(), which returns false if there are no more fragments to build. Optionally one can override InitFragments, which is called from LocalSearchOperator::Start to initialize fragment data. Here's a sample relaxing one variable at a time: class OneVarLns : public BaseLns { public: OneVarLns(const std::vector& vars) : BaseLns(vars), index_(0) {} virtual ~OneVarLns() {} virtual void InitFragments() { index_ = 0; } virtual bool NextFragment() { const int size = Size(); if (index_ < size) { AppendToFragment(index_); ++index_; return true; } else { return false; } } private: int index_; };

Expand source code
class BaseLns(IntVarLocalSearchOperator):
    r""" This is the base class for building an Lns operator. An Lns fragment is a collection of variables which will be relaxed. Fragments are built with NextFragment(), which returns false if there are no more fragments to build. Optionally one can override InitFragments, which is called from LocalSearchOperator::Start to initialize fragment data. Here's a sample relaxing one variable at a time: class OneVarLns : public BaseLns {  public:   OneVarLns(const std::vector<IntVar*>& vars) : BaseLns(vars), index_(0) {}   virtual ~OneVarLns() {}   virtual void InitFragments() { index_ = 0; }   virtual bool NextFragment() {     const int size = Size();     if (index_ < size) {       AppendToFragment(index_);       ++index_;       return true;     } else {       return false;     }   }  private:   int index_; };"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == BaseLns:
            _self = None
        else:
            _self = self
        _pywrapcp.BaseLns_swiginit(self, _pywrapcp.new_BaseLns(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_BaseLns

    def InitFragments(self) -> "void":
        return _pywrapcp.BaseLns_InitFragments(self)

    def NextFragment(self) -> "bool":
        return _pywrapcp.BaseLns_NextFragment(self)

    def AppendToFragment(self, index: "int") -> "void":
        return _pywrapcp.BaseLns_AppendToFragment(self, index)

    def FragmentSize(self) -> "int":
        return _pywrapcp.BaseLns_FragmentSize(self)

    def __getitem__(self, index: "int") -> "int64":
        return _pywrapcp.BaseLns___getitem__(self, index)

    def __len__(self) -> "int":
        return _pywrapcp.BaseLns___len__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_BaseLns(self)
        return weakref.proxy(self)
Ancestors
Methods

AppendToFragment

def AppendToFragment(self, index)
Expand source code
def AppendToFragment(self, index: "int") -> "void":
    return _pywrapcp.BaseLns_AppendToFragment(self, index)

FragmentSize

def FragmentSize(self)
Expand source code
def FragmentSize(self) -> "int":
    return _pywrapcp.BaseLns_FragmentSize(self)

InitFragments

def InitFragments(self)
Expand source code
def InitFragments(self) -> "void":
    return _pywrapcp.BaseLns_InitFragments(self)

NextFragment

def NextFragment(self)
Expand source code
def NextFragment(self) -> "bool":
    return _pywrapcp.BaseLns_NextFragment(self)
Inherited members

BaseObject

class BaseObject

A BaseObject is the root of all reversibly allocated objects. A DebugString method and the associated << operator are implemented as a convenience.

Expand source code
class BaseObject(object):
    r""" A BaseObject is the root of all reversibly allocated objects. A DebugString method and the associated << operator are implemented as a convenience."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == BaseObject:
            _self = None
        else:
            _self = self
        _pywrapcp.BaseObject_swiginit(self, _pywrapcp.new_BaseObject(_self, ))
    __swig_destroy__ = _pywrapcp.delete_BaseObject

    def DebugString(self) -> "std::string":
        return _pywrapcp.BaseObject_DebugString(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.BaseObject___str__(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.BaseObject___repr__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_BaseObject(self)
        return weakref.proxy(self)
Subclasses
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.BaseObject_DebugString(self)

BasePathFilter

class BasePathFilter (*args, **kwargs)

Generic path-based filter class.

Expand source code
class BasePathFilter(IntVarLocalSearchFilter):
    r""" Generic path-based filter class."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_BasePathFilter

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        return _pywrapcp.BasePathFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def OnSynchronize(self, delta: "Assignment") -> "void":
        return _pywrapcp.BasePathFilter_OnSynchronize(self, delta)
Ancestors
Methods

OnSynchronize

def OnSynchronize(self, delta)
Expand source code
def OnSynchronize(self, delta: "Assignment") -> "void":
    return _pywrapcp.BasePathFilter_OnSynchronize(self, delta)
Inherited members

BooleanVar

class BooleanVar (*args, **kwargs)

The class IntVar is a subset of IntExpr. In addition to the IntExpr protocol, it offers persistence, removing values from the domains, and a finer model for events.

Expand source code
class BooleanVar(IntVar):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Min(self) -> "int64":
        return _pywrapcp.BooleanVar_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.BooleanVar_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetMax(self, m)

    def SetRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.BooleanVar_SetRange(self, mi, ma)

    def Bound(self) -> "bool":
        return _pywrapcp.BooleanVar_Bound(self)

    def Value(self) -> "int64":
        return _pywrapcp.BooleanVar_Value(self)

    def RemoveValue(self, v: "int64") -> "void":
        return _pywrapcp.BooleanVar_RemoveValue(self, v)

    def RemoveInterval(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.BooleanVar_RemoveInterval(self, l, u)

    def WhenBound(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenBound(self, d)

    def WhenRange(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenRange(self, d)

    def WhenDomain(self, d: "Demon") -> "void":
        return _pywrapcp.BooleanVar_WhenDomain(self, d)

    def Size(self) -> "uint64":
        return _pywrapcp.BooleanVar_Size(self)

    def Contains(self, v: "int64") -> "bool":
        return _pywrapcp.BooleanVar_Contains(self, v)

    def HoleIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        return _pywrapcp.BooleanVar_HoleIteratorAux(self, reversible)

    def DomainIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        return _pywrapcp.BooleanVar_DomainIteratorAux(self, reversible)

    def DebugString(self) -> "std::string":
        return _pywrapcp.BooleanVar_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.BooleanVar_DebugString(self)

Max

def Max(self)
Expand source code
def Max(self) -> "int64":
    return _pywrapcp.BooleanVar_Max(self)

Min

def Min(self)
Expand source code
def Min(self) -> "int64":
    return _pywrapcp.BooleanVar_Min(self)

SetMax

def SetMax(self, m)
Expand source code
def SetMax(self, m: "int64") -> "void":
    return _pywrapcp.BooleanVar_SetMax(self, m)

SetMin

def SetMin(self, m)
Expand source code
def SetMin(self, m: "int64") -> "void":
    return _pywrapcp.BooleanVar_SetMin(self, m)
Inherited members

CPFeasibilityFilter

class CPFeasibilityFilter (routing_model)

This filter accepts deltas for which the assignment satisfies the constraints of the Solver. This is verified by keeping an internal copy of the assignment with all Next vars and their updated values, and calling RestoreAssignment() on the assignment+delta. exception of Next Vars (woud fail on large instances). WARNING: In the case of mandatory nodes, when all vehicles are currently being used in the solution but uninserted nodes still remain, this filter will reject the solution, even if the node could be inserted on one of these routes, because all Next vars of vehicle starts are already instantiated.

Expand source code
class CPFeasibilityFilter(IntVarLocalSearchFilter):
    r""" This filter accepts deltas for which the assignment satisfies the constraints of the Solver. This is verified by keeping an internal copy of the assignment with all Next vars and their updated values, and calling RestoreAssignment() on the assignment+delta. exception of Next Vars (woud fail on large instances). WARNING: In the case of mandatory nodes, when all vehicles are currently being used in the solution but uninserted nodes still remain, this filter will reject the solution, even if the node could be inserted on one of these routes, because all Next vars of vehicle starts are already instantiated."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, routing_model: "RoutingModel"):
        _pywrapcp.CPFeasibilityFilter_swiginit(self, _pywrapcp.new_CPFeasibilityFilter(routing_model))
    __swig_destroy__ = _pywrapcp.delete_CPFeasibilityFilter

    def DebugString(self) -> "std::string":
        return _pywrapcp.CPFeasibilityFilter_DebugString(self)

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        return _pywrapcp.CPFeasibilityFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def OnSynchronize(self, delta: "Assignment") -> "void":
        return _pywrapcp.CPFeasibilityFilter_OnSynchronize(self, delta)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.CPFeasibilityFilter_DebugString(self)

OnSynchronize

def OnSynchronize(self, delta)
Expand source code
def OnSynchronize(self, delta: "Assignment") -> "void":
    return _pywrapcp.CPFeasibilityFilter_OnSynchronize(self, delta)
Inherited members

ChangeValue

class ChangeValue (vars)

Defines operators which change the value of variables; each neighbor corresponds to one modified variable. Sub-classes have to define ModifyValue which determines what the new variable value is going to be (given the current value and the variable).

Expand source code
class ChangeValue(IntVarLocalSearchOperator):
    r""" Defines operators which change the value of variables; each neighbor corresponds to *one* modified variable. Sub-classes have to define ModifyValue which determines what the new variable value is going to be (given the current value and the variable)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == ChangeValue:
            _self = None
        else:
            _self = self
        _pywrapcp.ChangeValue_swiginit(self, _pywrapcp.new_ChangeValue(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_ChangeValue

    def ModifyValue(self, index: "int64", value: "int64") -> "int64":
        return _pywrapcp.ChangeValue_ModifyValue(self, index, value)

    def OneNeighbor(self) -> "bool":
        r""" This method should not be overridden. Override ModifyValue() instead."""
        return _pywrapcp.ChangeValue_OneNeighbor(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_ChangeValue(self)
        return weakref.proxy(self)
Ancestors
Methods

ModifyValue

def ModifyValue(self, index, value)
Expand source code
def ModifyValue(self, index: "int64", value: "int64") -> "int64":
    return _pywrapcp.ChangeValue_ModifyValue(self, index, value)

OneNeighbor

def OneNeighbor(self)

This method should not be overridden. Override ModifyValue() instead.

Expand source code
def OneNeighbor(self) -> "bool":
    r""" This method should not be overridden. Override ModifyValue() instead."""
    return _pywrapcp.ChangeValue_OneNeighbor(self)
Inherited members

CheapestAdditionFilteredDecisionBuilder

class CheapestAdditionFilteredDecisionBuilder (*args, **kwargs)

Filtered-base decision builder based on the addition heuristic, extending a path from its start node with the cheapest arc.

Expand source code
class CheapestAdditionFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    r""" Filtered-base decision builder based on the addition heuristic, extending a path from its start node with the cheapest arc."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_CheapestAdditionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.CheapestAdditionFilteredDecisionBuilder_BuildSolution(self)
Ancestors
Subclasses
Inherited members

CheapestInsertionFilteredDecisionBuilder

class CheapestInsertionFilteredDecisionBuilder (*args, **kwargs)

Filter-based decision builder dedicated to routing.

Expand source code
class CheapestInsertionFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_CheapestInsertionFilteredDecisionBuilder
Ancestors
Subclasses
Inherited members

ChristofidesFilteredDecisionBuilder

class ChristofidesFilteredDecisionBuilder (*args, **kwargs)

Christofides addition heuristic. Initially created to solve TSPs, extended to support any model by extending routes as much as possible following the path found by the heuristic, before starting a new route.

Expand source code
class ChristofidesFilteredDecisionBuilder(RoutingFilteredDecisionBuilder):
    r""" Christofides addition heuristic. Initially created to solve TSPs, extended to support any model by extending routes as much as possible following the path found by the heuristic, before starting a new route."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ChristofidesFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.ChristofidesFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.ChristofidesFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.ChristofidesFilteredDecisionBuilder_DebugString(self)
Inherited members

ComparatorCheapestAdditionFilteredDecisionBuilder

class ComparatorCheapestAdditionFilteredDecisionBuilder (*args, **kwargs)

A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc comparator.

Expand source code
class ComparatorCheapestAdditionFilteredDecisionBuilder(CheapestAdditionFilteredDecisionBuilder):
    r""" A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc comparator."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ComparatorCheapestAdditionFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.ComparatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.ComparatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)
Inherited members

Constraint

class Constraint (solver)

A constraint is the main modeling object. It provides two methods: - Post() is responsible for creating the demons and attaching them to immediate demons(). - InitialPropagate() is called once just after Post and performs the initial propagation. The subsequent propagations will be performed by the demons Posted during the post() method.

Expand source code
class Constraint(PropagationBaseObject):
    r""" A constraint is the main modeling object. It provides two methods:   - Post() is responsible for creating the demons and attaching them to     immediate demons().   - InitialPropagate() is called once just after Post and performs     the initial propagation. The subsequent propagations will be performed     by the demons Posted during the post() method."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, solver: "Solver"):
        if self.__class__ == Constraint:
            _self = None
        else:
            _self = self
        _pywrapcp.Constraint_swiginit(self, _pywrapcp.new_Constraint(_self, solver))
    __swig_destroy__ = _pywrapcp.delete_Constraint

    def Post(self) -> "void":
        r""" This method is called when the constraint is processed by the solver. Its main usage is to attach demons to variables."""
        return _pywrapcp.Constraint_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        r""" This method performs the initial propagation of the constraint. It is called just after the post."""
        return _pywrapcp.Constraint_InitialPropagateWrapper(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Constraint_DebugString(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied). It returns nullptr if the constraint does not support this API."""
        return _pywrapcp.Constraint_Var(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.Constraint___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.Constraint___str__(self)

    def __add__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___add__(self, *args)

    def __radd__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___radd__(self, v)

    def __sub__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___sub__(self, *args)

    def __rsub__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___rsub__(self, v)

    def __mul__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___mul__(self, *args)

    def __rmul__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___rmul__(self, v)

    def __floordiv__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___floordiv__(self, v)

    def __neg__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___neg__(self)

    def __abs__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint___abs__(self)

    def Square(self) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint_Square(self)

    def __eq__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___eq__(self, *args)

    def __ne__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___ne__(self, *args)

    def __ge__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___ge__(self, *args)

    def __gt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___gt__(self, *args)

    def __le__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___le__(self, *args)

    def __lt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.Constraint___lt__(self, *args)

    def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        return _pywrapcp.Constraint_MapTo(self, vars)

    def IndexOf(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.Constraint_IndexOf(self, *args)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Constraint(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.Constraint_DebugString(self)

IndexOf

def IndexOf(self, *args)
Expand source code
def IndexOf(self, *args) -> "operations_research::IntExpr *":
    return _pywrapcp.Constraint_IndexOf(self, *args)

InitialPropagateWrapper

def InitialPropagateWrapper(self)

This method performs the initial propagation of the constraint. It is called just after the post.

Expand source code
def InitialPropagateWrapper(self) -> "void":
    r""" This method performs the initial propagation of the constraint. It is called just after the post."""
    return _pywrapcp.Constraint_InitialPropagateWrapper(self)

MapTo

def MapTo(self, vars)
Expand source code
def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
    return _pywrapcp.Constraint_MapTo(self, vars)

Post

def Post(self)

This method is called when the constraint is processed by the solver. Its main usage is to attach demons to variables.

Expand source code
def Post(self) -> "void":
    r""" This method is called when the constraint is processed by the solver. Its main usage is to attach demons to variables."""
    return _pywrapcp.Constraint_Post(self)

Square

def Square(self)
Expand source code
def Square(self) -> "operations_research::IntExpr *":
    return _pywrapcp.Constraint_Square(self)

Var

def Var(self)

Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied). It returns nullptr if the constraint does not support this API.

Expand source code
def Var(self) -> "operations_research::IntVar *":
    r""" Creates a Boolean variable representing the status of the constraint (false = constraint is violated, true = constraint is satisfied). It returns nullptr if the constraint does not support this API."""
    return _pywrapcp.Constraint_Var(self)
Inherited members

Decision

class Decision

A Decision represents a choice point in the search tree. The two main methods are Apply() to go left, or Refute() to go right.

Expand source code
class Decision(BaseObject):
    r""" A Decision represents a choice point in the search tree. The two main methods are Apply() to go left, or Refute() to go right."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == Decision:
            _self = None
        else:
            _self = self
        _pywrapcp.Decision_swiginit(self, _pywrapcp.new_Decision(_self, ))
    __swig_destroy__ = _pywrapcp.delete_Decision

    def ApplyWrapper(self, s: "Solver") -> "void":
        r""" Apply will be called first when the decision is executed."""
        return _pywrapcp.Decision_ApplyWrapper(self, s)

    def RefuteWrapper(self, s: "Solver") -> "void":
        r""" Refute will be called after a backtrack."""
        return _pywrapcp.Decision_RefuteWrapper(self, s)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Decision_DebugString(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.Decision___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.Decision___str__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Decision(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

ApplyWrapper

def ApplyWrapper(self, s)

Apply will be called first when the decision is executed.

Expand source code
def ApplyWrapper(self, s: "Solver") -> "void":
    r""" Apply will be called first when the decision is executed."""
    return _pywrapcp.Decision_ApplyWrapper(self, s)

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.Decision_DebugString(self)

RefuteWrapper

def RefuteWrapper(self, s)

Refute will be called after a backtrack.

Expand source code
def RefuteWrapper(self, s: "Solver") -> "void":
    r""" Refute will be called after a backtrack."""
    return _pywrapcp.Decision_RefuteWrapper(self, s)
Inherited members

DecisionBuilder

class DecisionBuilder

A DecisionBuilder is responsible for creating the search tree. The important method is Next(), which returns the next decision to execute.

Expand source code
class DecisionBuilder(BaseObject):
    r""" A DecisionBuilder is responsible for creating the search tree. The important method is Next(), which returns the next decision to execute."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self):
        if self.__class__ == DecisionBuilder:
            _self = None
        else:
            _self = self
        _pywrapcp.DecisionBuilder_swiginit(self, _pywrapcp.new_DecisionBuilder(_self, ))
    __swig_destroy__ = _pywrapcp.delete_DecisionBuilder

    def NextWrapper(self, s: "Solver") -> "operations_research::Decision *":
        r""" This is the main method of the decision builder class. It must return a decision (an instance of the class Decision). If it returns nullptr, this means that the decision builder has finished its work."""
        return _pywrapcp.DecisionBuilder_NextWrapper(self, s)

    def DebugString(self) -> "std::string":
        return _pywrapcp.DecisionBuilder_DebugString(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.DecisionBuilder___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.DecisionBuilder___str__(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_DecisionBuilder(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.DecisionBuilder_DebugString(self)

NextWrapper

def NextWrapper(self, s)

This is the main method of the decision builder class. It must return a decision (an instance of the class Decision). If it returns nullptr, this means that the decision builder has finished its work.

Expand source code
def NextWrapper(self, s: "Solver") -> "operations_research::Decision *":
    r""" This is the main method of the decision builder class. It must return a decision (an instance of the class Decision). If it returns nullptr, this means that the decision builder has finished its work."""
    return _pywrapcp.DecisionBuilder_NextWrapper(self, s)
Inherited members

DefaultPhaseParameters

class DefaultPhaseParameters

This struct holds all parameters for the default search. DefaultPhaseParameters is only used by Solver::MakeDefaultPhase methods. Note this is for advanced users only.

Expand source code
class DefaultPhaseParameters(object):
    r""" This struct holds all parameters for the default search. DefaultPhaseParameters is only used by Solver::MakeDefaultPhase methods. Note this is for advanced users only."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    CHOOSE_MAX_SUM_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_SUM_IMPACT
    CHOOSE_MAX_AVERAGE_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_AVERAGE_IMPACT
    CHOOSE_MAX_VALUE_IMPACT = _pywrapcp.DefaultPhaseParameters_CHOOSE_MAX_VALUE_IMPACT
    SELECT_MIN_IMPACT = _pywrapcp.DefaultPhaseParameters_SELECT_MIN_IMPACT
    SELECT_MAX_IMPACT = _pywrapcp.DefaultPhaseParameters_SELECT_MAX_IMPACT
    NONE = _pywrapcp.DefaultPhaseParameters_NONE
    NORMAL = _pywrapcp.DefaultPhaseParameters_NORMAL
    VERBOSE = _pywrapcp.DefaultPhaseParameters_VERBOSE
    var_selection_schema = property(_pywrapcp.DefaultPhaseParameters_var_selection_schema_get, _pywrapcp.DefaultPhaseParameters_var_selection_schema_set, doc=r""" This parameter describes how the next variable to instantiate will be chosen.""")
    value_selection_schema = property(_pywrapcp.DefaultPhaseParameters_value_selection_schema_get, _pywrapcp.DefaultPhaseParameters_value_selection_schema_set, doc=r""" This parameter describes which value to select for a given var.""")
    initialization_splits = property(_pywrapcp.DefaultPhaseParameters_initialization_splits_get, _pywrapcp.DefaultPhaseParameters_initialization_splits_set, doc=r""" Maximum number of intervals that the initialization of impacts will scan per variable.""")
    run_all_heuristics = property(_pywrapcp.DefaultPhaseParameters_run_all_heuristics_get, _pywrapcp.DefaultPhaseParameters_run_all_heuristics_set, doc=r""" The default phase will run heuristics periodically. This parameter indicates if we should run all heuristics, or a randomly selected one.""")
    heuristic_period = property(_pywrapcp.DefaultPhaseParameters_heuristic_period_get, _pywrapcp.DefaultPhaseParameters_heuristic_period_set, doc=r""" The distance in nodes between each run of the heuristics. A negative or null value will mean that we will not run heuristics at all.""")
    heuristic_num_failures_limit = property(_pywrapcp.DefaultPhaseParameters_heuristic_num_failures_limit_get, _pywrapcp.DefaultPhaseParameters_heuristic_num_failures_limit_set, doc=r""" The failure limit for each heuristic that we run.""")
    persistent_impact = property(_pywrapcp.DefaultPhaseParameters_persistent_impact_get, _pywrapcp.DefaultPhaseParameters_persistent_impact_set, doc=r""" Whether to keep the impact from the first search for other searches, or to recompute the impact for each new search.""")
    random_seed = property(_pywrapcp.DefaultPhaseParameters_random_seed_get, _pywrapcp.DefaultPhaseParameters_random_seed_set, doc=r""" Seed used to initialize the random part in some heuristics.""")
    display_level = property(_pywrapcp.DefaultPhaseParameters_display_level_get, _pywrapcp.DefaultPhaseParameters_display_level_set, doc=r""" This represents the amount of information displayed by the default search. NONE means no display, VERBOSE means extra information.""")
    decision_builder = property(_pywrapcp.DefaultPhaseParameters_decision_builder_get, _pywrapcp.DefaultPhaseParameters_decision_builder_set, doc=r""" When defined, this overrides the default impact based decision builder.""")

    def __init__(self):
        _pywrapcp.DefaultPhaseParameters_swiginit(self, _pywrapcp.new_DefaultPhaseParameters())
    __swig_destroy__ = _pywrapcp.delete_DefaultPhaseParameters
Class variables

CHOOSE_MAX_AVERAGE_IMPACT

var CHOOSE_MAX_AVERAGE_IMPACT

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

CHOOSE_MAX_SUM_IMPACT

var CHOOSE_MAX_SUM_IMPACT

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

CHOOSE_MAX_VALUE_IMPACT

var CHOOSE_MAX_VALUE_IMPACT

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

NONE

var NONE

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

NORMAL

var NORMAL

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

SELECT_MAX_IMPACT

var SELECT_MAX_IMPACT

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

SELECT_MIN_IMPACT

var SELECT_MIN_IMPACT

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4

VERBOSE

var VERBOSE

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4
Instance variables

decision_builder

var decision_builder

When defined, this overrides the default impact based decision builder.

display_level

var display_level

This represents the amount of information displayed by the default search. NONE means no display, VERBOSE means extra information.

heuristic_num_failures_limit

var heuristic_num_failures_limit

The failure limit for each heuristic that we run.

heuristic_period

var heuristic_period

The distance in nodes between each run of the heuristics. A negative or null value will mean that we will not run heuristics at all.

initialization_splits

var initialization_splits

Maximum number of intervals that the initialization of impacts will scan per variable.

persistent_impact

var persistent_impact

Whether to keep the impact from the first search for other searches, or to recompute the impact for each new search.

random_seed

var random_seed

Seed used to initialize the random part in some heuristics.

run_all_heuristics

var run_all_heuristics

The default phase will run heuristics periodically. This parameter indicates if we should run all heuristics, or a randomly selected one.

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

value_selection_schema

var value_selection_schema

This parameter describes which value to select for a given var.

var_selection_schema

var var_selection_schema

This parameter describes how the next variable to instantiate will be chosen.

Demon

class Demon

A Demon is the base element of a propagation queue. It is the main object responsible for implementing the actual propagation of the constraint and pruning the inconsistent values in the domains of the variables. The main concept is that demons are listeners that are attached to the variables and listen to their modifications. There are two methods: - Run() is the actual method called when the demon is processed. - priority() returns its priority. Standard priorities are slow, normal or fast. "immediate" is reserved for variables and is treated separately.

This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables.

Expand source code
class Demon(BaseObject):
    r""" A Demon is the base element of a propagation queue. It is the main   object responsible for implementing the actual propagation   of the constraint and pruning the inconsistent values in the domains   of the variables. The main concept is that demons are listeners that are   attached to the variables and listen to their modifications. There are two methods:  - Run() is the actual method called when the demon is processed.  - priority() returns its priority. Standard priorities are slow, normal    or fast. "immediate" is reserved for variables and is treated separately."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        r""" This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables."""
        if self.__class__ == Demon:
            _self = None
        else:
            _self = self
        _pywrapcp.Demon_swiginit(self, _pywrapcp.new_Demon(_self, ))
    __swig_destroy__ = _pywrapcp.delete_Demon

    def RunWrapper(self, s: "Solver") -> "void":
        r""" This is the main callback of the demon."""
        return _pywrapcp.Demon_RunWrapper(self, s)

    def Priority(self) -> "operations_research::Solver::DemonPriority":
        r""" This method returns the priority of the demon. Usually a demon is fast, slow or normal. Immediate demons are reserved for internal use to maintain variables."""
        return _pywrapcp.Demon_Priority(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Demon_DebugString(self)

    def Inhibit(self, s: "Solver") -> "void":
        r""" This method inhibits the demon in the search tree below the current position."""
        return _pywrapcp.Demon_Inhibit(self, s)

    def Desinhibit(self, s: "Solver") -> "void":
        r""" This method un-inhibits the demon that was previously inhibited."""
        return _pywrapcp.Demon_Desinhibit(self, s)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_Demon(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.Demon_DebugString(self)

Desinhibit

def Desinhibit(self, s)

This method un-inhibits the demon that was previously inhibited.

Expand source code
def Desinhibit(self, s: "Solver") -> "void":
    r""" This method un-inhibits the demon that was previously inhibited."""
    return _pywrapcp.Demon_Desinhibit(self, s)

Inhibit

def Inhibit(self, s)

This method inhibits the demon in the search tree below the current position.

Expand source code
def Inhibit(self, s: "Solver") -> "void":
    r""" This method inhibits the demon in the search tree below the current position."""
    return _pywrapcp.Demon_Inhibit(self, s)

Priority

def Priority(self)

This method returns the priority of the demon. Usually a demon is fast, slow or normal. Immediate demons are reserved for internal use to maintain variables.

Expand source code
def Priority(self) -> "operations_research::Solver::DemonPriority":
    r""" This method returns the priority of the demon. Usually a demon is fast, slow or normal. Immediate demons are reserved for internal use to maintain variables."""
    return _pywrapcp.Demon_Priority(self)

RunWrapper

def RunWrapper(self, s)

This is the main callback of the demon.

Expand source code
def RunWrapper(self, s: "Solver") -> "void":
    r""" This is the main callback of the demon."""
    return _pywrapcp.Demon_RunWrapper(self, s)
Inherited members

DisjunctiveConstraint

class DisjunctiveConstraint (*args, **kwargs)

A constraint is the main modeling object. It provides two methods: - Post() is responsible for creating the demons and attaching them to immediate demons(). - InitialPropagate() is called once just after Post and performs the initial propagation. The subsequent propagations will be performed by the demons Posted during the post() method.

Expand source code
class DisjunctiveConstraint(Constraint):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def SequenceVar(self) -> "operations_research::SequenceVar *":
        r""" Creates a sequence variable from the constraint."""
        return _pywrapcp.DisjunctiveConstraint_SequenceVar(self)

    def SetTransitionTime(self, transition_time: "operations_research::Solver::IndexEvaluator2") -> "void":
        r""" Add a transition time between intervals.  It forces the distance between the end of interval a and start of interval b that follows it to be at least transition_time(a, b). This function must always return a positive or null value."""
        return _pywrapcp.DisjunctiveConstraint_SetTransitionTime(self, transition_time)

    def TransitionTime(self, before_index: "int", after_index: "int") -> "int64":
        return _pywrapcp.DisjunctiveConstraint_TransitionTime(self, before_index, after_index)
Ancestors
Methods

SequenceVar

def SequenceVar(self)

Creates a sequence variable from the constraint.

Expand source code
def SequenceVar(self) -> "operations_research::SequenceVar *":
    r""" Creates a sequence variable from the constraint."""
    return _pywrapcp.DisjunctiveConstraint_SequenceVar(self)

SetTransitionTime

def SetTransitionTime(self, transition_time)

Add a transition time between intervals. It forces the distance between the end of interval a and start of interval b that follows it to be at least transition_time(a, b). This function must always return a positive or null value.

Expand source code
def SetTransitionTime(self, transition_time: "operations_research::Solver::IndexEvaluator2") -> "void":
    r""" Add a transition time between intervals.  It forces the distance between the end of interval a and start of interval b that follows it to be at least transition_time(a, b). This function must always return a positive or null value."""
    return _pywrapcp.DisjunctiveConstraint_SetTransitionTime(self, transition_time)

TransitionTime

def TransitionTime(self, before_index, after_index)
Expand source code
def TransitionTime(self, before_index: "int", after_index: "int") -> "int64":
    return _pywrapcp.DisjunctiveConstraint_TransitionTime(self, before_index, after_index)
Inherited members

EvaluatorCheapestAdditionFilteredDecisionBuilder

class EvaluatorCheapestAdditionFilteredDecisionBuilder (*args, **kwargs)

A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc evaluator.

Expand source code
class EvaluatorCheapestAdditionFilteredDecisionBuilder(CheapestAdditionFilteredDecisionBuilder):
    r""" A CheapestAdditionFilteredDecisionBuilder where the notion of 'cheapest arc' comes from an arc evaluator."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_EvaluatorCheapestAdditionFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.EvaluatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.EvaluatorCheapestAdditionFilteredDecisionBuilder_DebugString(self)
Inherited members

GlobalCheapestInsertionFilteredDecisionBuilder

class GlobalCheapestInsertionFilteredDecisionBuilder (*args, **kwargs)

Filter-based decision builder which builds a solution by inserting nodes at their cheapest position on any route; potentially several routes can be built in parallel. The cost of a position is computed from an arc-based cost callback. The node selected for insertion is the one which minimizes insertion cost. If a non null penalty evaluator is passed, making nodes unperformed is also taken into account with the corresponding penalty cost.

Expand source code
class GlobalCheapestInsertionFilteredDecisionBuilder(CheapestInsertionFilteredDecisionBuilder):
    r""" Filter-based decision builder which builds a solution by inserting nodes at their cheapest position on any route; potentially several routes can be built in parallel. The cost of a position is computed from an arc-based cost callback. The node selected for insertion is the one which minimizes insertion cost. If a non null penalty evaluator is passed, making nodes unperformed is also taken into account with the corresponding penalty cost."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_GlobalCheapestInsertionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.GlobalCheapestInsertionFilteredDecisionBuilder_DebugString(self)
Inherited members

GlobalVehicleBreaksConstraint

class GlobalVehicleBreaksConstraint (dimension)

GlobalVehicleBreaksConstraint ensures breaks constraints are enforced on all vehicles in the dimension passed to its constructor. It is intended to be used for dimensions representing time. A break constraint ensures break intervals fit on the route of a vehicle. For a given vehicle, it forces break intervals to be disjoint from visit intervals, where visit intervals start at CumulVar(node) and last for node_visit_transit[node]. Moreover, it ensures that there is enough time between two consecutive nodes of a route to do transit and vehicle breaks, i.e. if Next(nodeA) = nodeB, CumulVar(nodeA) = tA and CumulVar(nodeB) = tB, then SlackVar(nodeA) >= sum_{breaks [tA, tB)} duration(break).

Expand source code
class GlobalVehicleBreaksConstraint(Constraint):
    r""" GlobalVehicleBreaksConstraint ensures breaks constraints are enforced on all vehicles in the dimension passed to its constructor. It is intended to be used for dimensions representing time. A break constraint ensures break intervals fit on the route of a vehicle. For a given vehicle, it forces break intervals to be disjoint from visit intervals, where visit intervals start at CumulVar(node) and last for node_visit_transit[node]. Moreover, it ensures that there is enough time between two consecutive nodes of a route to do transit and vehicle breaks, i.e. if Next(nodeA) = nodeB, CumulVar(nodeA) = tA and CumulVar(nodeB) = tB, then SlackVar(nodeA) >= sum_{breaks [tA, tB)} duration(break)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, dimension: "RoutingDimension"):
        _pywrapcp.GlobalVehicleBreaksConstraint_swiginit(self, _pywrapcp.new_GlobalVehicleBreaksConstraint(dimension))

    def DebugString(self) -> "std::string":
        return _pywrapcp.GlobalVehicleBreaksConstraint_DebugString(self)

    def Post(self) -> "void":
        return _pywrapcp.GlobalVehicleBreaksConstraint_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        return _pywrapcp.GlobalVehicleBreaksConstraint_InitialPropagateWrapper(self)
    __swig_destroy__ = _pywrapcp.delete_GlobalVehicleBreaksConstraint
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.GlobalVehicleBreaksConstraint_DebugString(self)
Inherited members

IntExpr

class IntExpr (*args, **kwargs)

The class IntExpr is the base of all integer expressions in constraint programming. It contains the basic protocol for an expression: - setting and modifying its bound - querying if it is bound - listening to events modifying its bounds - casting it into a variable (instance of IntVar)

Expand source code
class IntExpr(PropagationBaseObject):
    r""" The class IntExpr is the base of all integer expressions in constraint programming. It contains the basic protocol for an expression:   - setting and modifying its bound   - querying if it is bound   - listening to events modifying its bounds   - casting it into a variable (instance of IntVar)"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def Min(self) -> "int64":
        return _pywrapcp.IntExpr_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.IntExpr_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.IntExpr_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.IntExpr_SetMax(self, m)

    def SetRange(self, l: "int64", u: "int64") -> "void":
        r""" This method sets both the min and the max of the expression."""
        return _pywrapcp.IntExpr_SetRange(self, l, u)

    def SetValue(self, v: "int64") -> "void":
        r""" This method sets the value of the expression."""
        return _pywrapcp.IntExpr_SetValue(self, v)

    def Bound(self) -> "bool":
        r""" Returns true if the min and the max of the expression are equal."""
        return _pywrapcp.IntExpr_Bound(self)

    def IsVar(self) -> "bool":
        r""" Returns true if the expression is indeed a variable."""
        return _pywrapcp.IntExpr_IsVar(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Creates a variable from the expression."""
        return _pywrapcp.IntExpr_Var(self)

    def VarWithName(self, name: "std::string const &") -> "operations_research::IntVar *":
        r""" Creates a variable from the expression and set the name of the resulting var. If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name()."""
        return _pywrapcp.IntExpr_VarWithName(self, name)

    def WhenRange(self, *args) -> "void":
        r"""
        *Overload 1:*
        Attach a demon that will watch the min or the max of the expression.

        |

        *Overload 2:*
        Attach a demon that will watch the min or the max of the expression.
        """
        return _pywrapcp.IntExpr_WhenRange(self, *args)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntExpr___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntExpr___str__(self)

    def __add__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___add__(self, *args)

    def __radd__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___radd__(self, v)

    def __sub__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___sub__(self, *args)

    def __rsub__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___rsub__(self, v)

    def __mul__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___mul__(self, *args)

    def __rmul__(self, v: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___rmul__(self, v)

    def __floordiv__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___floordiv__(self, *args)

    def __mod__(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___mod__(self, *args)

    def __neg__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___neg__(self)

    def __abs__(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr___abs__(self)

    def Square(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr_Square(self)

    def __eq__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___eq__(self, *args)

    def __ne__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___ne__(self, *args)

    def __ge__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___ge__(self, *args)

    def __gt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___gt__(self, *args)

    def __le__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___le__(self, *args)

    def __lt__(self, *args) -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr___lt__(self, *args)

    def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_MapTo(self, vars)

    def IndexOf(self, *args) -> "operations_research::IntExpr *":
        return _pywrapcp.IntExpr_IndexOf(self, *args)

    def IsMember(self, values: "std::vector< int64 > const &") -> "operations_research::IntVar *":
        return _pywrapcp.IntExpr_IsMember(self, values)

    def Member(self, values: "std::vector< int64 > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_Member(self, values)

    def NotMember(self, starts: "std::vector< int64 > const &", ends: "std::vector< int64 > const &") -> "operations_research::Constraint *":
        return _pywrapcp.IntExpr_NotMember(self, starts, ends)
Ancestors
Subclasses
Methods

Bound

def Bound(self)

Returns true if the min and the max of the expression are equal.

Expand source code
def Bound(self) -> "bool":
    r""" Returns true if the min and the max of the expression are equal."""
    return _pywrapcp.IntExpr_Bound(self)

IndexOf

def IndexOf(self, *args)
Expand source code
def IndexOf(self, *args) -> "operations_research::IntExpr *":
    return _pywrapcp.IntExpr_IndexOf(self, *args)

IsMember

def IsMember(self, values)
Expand source code
def IsMember(self, values: "std::vector< int64 > const &") -> "operations_research::IntVar *":
    return _pywrapcp.IntExpr_IsMember(self, values)

IsVar

def IsVar(self)

Returns true if the expression is indeed a variable.

Expand source code
def IsVar(self) -> "bool":
    r""" Returns true if the expression is indeed a variable."""
    return _pywrapcp.IntExpr_IsVar(self)

MapTo

def MapTo(self, vars)
Expand source code
def MapTo(self, vars: "std::vector< operations_research::IntVar * > const &") -> "operations_research::Constraint *":
    return _pywrapcp.IntExpr_MapTo(self, vars)

Max

def Max(self)
Expand source code
def Max(self) -> "int64":
    return _pywrapcp.IntExpr_Max(self)

Member

def Member(self, values)
Expand source code
def Member(self, values: "std::vector< int64 > const &") -> "operations_research::Constraint *":
    return _pywrapcp.IntExpr_Member(self, values)

Min

def Min(self)
Expand source code
def Min(self) -> "int64":
    return _pywrapcp.IntExpr_Min(self)

NotMember

def NotMember(self, starts, ends)
Expand source code
def NotMember(self, starts: "std::vector< int64 > const &", ends: "std::vector< int64 > const &") -> "operations_research::Constraint *":
    return _pywrapcp.IntExpr_NotMember(self, starts, ends)

SetMax

def SetMax(self, m)
Expand source code
def SetMax(self, m: "int64") -> "void":
    return _pywrapcp.IntExpr_SetMax(self, m)

SetMin

def SetMin(self, m)
Expand source code
def SetMin(self, m: "int64") -> "void":
    return _pywrapcp.IntExpr_SetMin(self, m)

SetRange

def SetRange(self, l, u)

This method sets both the min and the max of the expression.

Expand source code
def SetRange(self, l: "int64", u: "int64") -> "void":
    r""" This method sets both the min and the max of the expression."""
    return _pywrapcp.IntExpr_SetRange(self, l, u)

SetValue

def SetValue(self, v)

This method sets the value of the expression.

Expand source code
def SetValue(self, v: "int64") -> "void":
    r""" This method sets the value of the expression."""
    return _pywrapcp.IntExpr_SetValue(self, v)

Square

def Square(self)
Expand source code
def Square(self) -> "operations_research::IntExpr *":
    return _pywrapcp.IntExpr_Square(self)

Var

def Var(self)

Creates a variable from the expression.

Expand source code
def Var(self) -> "operations_research::IntVar *":
    r""" Creates a variable from the expression."""
    return _pywrapcp.IntExpr_Var(self)

VarWithName

def VarWithName(self, name)

Creates a variable from the expression and set the name of the resulting var. If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name().

Expand source code
def VarWithName(self, name: "std::string const &") -> "operations_research::IntVar *":
    r""" Creates a variable from the expression and set the name of the resulting var. If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name()."""
    return _pywrapcp.IntExpr_VarWithName(self, name)

WhenRange

def WhenRange(self, *args)

Overload 1: Attach a demon that will watch the min or the max of the expression.

|

Overload 2: Attach a demon that will watch the min or the max of the expression.

Expand source code
def WhenRange(self, *args) -> "void":
    r"""
    *Overload 1:*
    Attach a demon that will watch the min or the max of the expression.

    |

    *Overload 2:*
    Attach a demon that will watch the min or the max of the expression.
    """
    return _pywrapcp.IntExpr_WhenRange(self, *args)
Inherited members

IntVar

class IntVar (*args, **kwargs)

The class IntVar is a subset of IntExpr. In addition to the IntExpr protocol, it offers persistence, removing values from the domains, and a finer model for events.

Expand source code
class IntVar(IntExpr):
    r""" The class IntVar is a subset of IntExpr. In addition to the IntExpr protocol, it offers persistence, removing values from the domains, and a finer model for events."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def IsVar(self) -> "bool":
        return _pywrapcp.IntVar_IsVar(self)

    def Var(self) -> "operations_research::IntVar *":
        return _pywrapcp.IntVar_Var(self)

    def Value(self) -> "int64":
        r""" This method returns the value of the variable. This method checks before that the variable is bound."""
        return _pywrapcp.IntVar_Value(self)

    def RemoveValue(self, v: "int64") -> "void":
        r""" This method removes the value 'v' from the domain of the variable."""
        return _pywrapcp.IntVar_RemoveValue(self, v)

    def RemoveInterval(self, l: "int64", u: "int64") -> "void":
        r""" This method removes the interval 'l' .. 'u' from the domain of the variable. It assumes that 'l' <= 'u'."""
        return _pywrapcp.IntVar_RemoveInterval(self, l, u)

    def RemoveValues(self, values: "std::vector< int64 > const &") -> "void":
        r""" This method remove the values from the domain of the variable."""
        return _pywrapcp.IntVar_RemoveValues(self, values)

    def SetValues(self, values: "std::vector< int64 > const &") -> "void":
        r""" This method intersects the current domain with the values in the array."""
        return _pywrapcp.IntVar_SetValues(self, values)

    def WhenBound(self, *args) -> "void":
        r"""
        *Overload 1:*
        This method attaches a demon that will be awakened when the variable is bound.

        |

        *Overload 2:*
        This method attaches a closure that will be awakened when the variable is bound.
        """
        return _pywrapcp.IntVar_WhenBound(self, *args)

    def WhenDomain(self, *args) -> "void":
        r"""
        *Overload 1:*
        This method attaches a demon that will watch any domain modification of the domain of the variable.

        |

        *Overload 2:*
        This method attaches a closure that will watch any domain modification of the domain of the variable.
        """
        return _pywrapcp.IntVar_WhenDomain(self, *args)

    def Size(self) -> "uint64":
        r""" This method returns the number of values in the domain of the variable."""
        return _pywrapcp.IntVar_Size(self)

    def Contains(self, v: "int64") -> "bool":
        r""" This method returns whether the value 'v' is in the domain of the variable."""
        return _pywrapcp.IntVar_Contains(self, v)

    def HoleIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        r""" Creates a hole iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
        return _pywrapcp.IntVar_HoleIteratorAux(self, reversible)

    def DomainIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
        r""" Creates a domain iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
        return _pywrapcp.IntVar_DomainIteratorAux(self, reversible)

    def OldMin(self) -> "int64":
        r""" Returns the previous min."""
        return _pywrapcp.IntVar_OldMin(self)

    def OldMax(self) -> "int64":
        r""" Returns the previous max."""
        return _pywrapcp.IntVar_OldMax(self)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntVar___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntVar___str__(self)

    def DomainIterator(self):
      return iter(self.DomainIteratorAux(False))

    def HoleIterator(self):
      return iter(self.HoleIteratorAux(False))
Ancestors
Subclasses
Methods

Contains

def Contains(self, v)

This method returns whether the value 'v' is in the domain of the variable.

Expand source code
def Contains(self, v: "int64") -> "bool":
    r""" This method returns whether the value 'v' is in the domain of the variable."""
    return _pywrapcp.IntVar_Contains(self, v)

DomainIterator

def DomainIterator(self)
Expand source code
def DomainIterator(self):
  return iter(self.DomainIteratorAux(False))

DomainIteratorAux

def DomainIteratorAux(self, reversible)

Creates a domain iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.

Expand source code
def DomainIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
    r""" Creates a domain iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
    return _pywrapcp.IntVar_DomainIteratorAux(self, reversible)

HoleIterator

def HoleIterator(self)
Expand source code
def HoleIterator(self):
  return iter(self.HoleIteratorAux(False))

HoleIteratorAux

def HoleIteratorAux(self, reversible)

Creates a hole iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object.

Expand source code
def HoleIteratorAux(self, reversible: "bool") -> "operations_research::IntVarIterator *":
    r""" Creates a hole iterator. When 'reversible' is false, the returned object is created on the normal C++ heap and the solver does NOT take ownership of the object."""
    return _pywrapcp.IntVar_HoleIteratorAux(self, reversible)

OldMax

def OldMax(self)

Returns the previous max.

Expand source code
def OldMax(self) -> "int64":
    r""" Returns the previous max."""
    return _pywrapcp.IntVar_OldMax(self)

OldMin

def OldMin(self)

Returns the previous min.

Expand source code
def OldMin(self) -> "int64":
    r""" Returns the previous min."""
    return _pywrapcp.IntVar_OldMin(self)

RemoveInterval

def RemoveInterval(self, l, u)

This method removes the interval 'l' .. 'u' from the domain of the variable. It assumes that 'l' <= 'u'.

Expand source code
def RemoveInterval(self, l: "int64", u: "int64") -> "void":
    r""" This method removes the interval 'l' .. 'u' from the domain of the variable. It assumes that 'l' <= 'u'."""
    return _pywrapcp.IntVar_RemoveInterval(self, l, u)

RemoveValue

def RemoveValue(self, v)

This method removes the value 'v' from the domain of the variable.

Expand source code
def RemoveValue(self, v: "int64") -> "void":
    r""" This method removes the value 'v' from the domain of the variable."""
    return _pywrapcp.IntVar_RemoveValue(self, v)

RemoveValues

def RemoveValues(self, values)

This method remove the values from the domain of the variable.

Expand source code
def RemoveValues(self, values: "std::vector< int64 > const &") -> "void":
    r""" This method remove the values from the domain of the variable."""
    return _pywrapcp.IntVar_RemoveValues(self, values)

SetValues

def SetValues(self, values)

This method intersects the current domain with the values in the array.

Expand source code
def SetValues(self, values: "std::vector< int64 > const &") -> "void":
    r""" This method intersects the current domain with the values in the array."""
    return _pywrapcp.IntVar_SetValues(self, values)

Size

def Size(self)

This method returns the number of values in the domain of the variable.

Expand source code
def Size(self) -> "uint64":
    r""" This method returns the number of values in the domain of the variable."""
    return _pywrapcp.IntVar_Size(self)

Value

def Value(self)

This method returns the value of the variable. This method checks before that the variable is bound.

Expand source code
def Value(self) -> "int64":
    r""" This method returns the value of the variable. This method checks before that the variable is bound."""
    return _pywrapcp.IntVar_Value(self)

WhenBound

def WhenBound(self, *args)

Overload 1: This method attaches a demon that will be awakened when the variable is bound.

|

Overload 2: This method attaches a closure that will be awakened when the variable is bound.

Expand source code
def WhenBound(self, *args) -> "void":
    r"""
    *Overload 1:*
    This method attaches a demon that will be awakened when the variable is bound.

    |

    *Overload 2:*
    This method attaches a closure that will be awakened when the variable is bound.
    """
    return _pywrapcp.IntVar_WhenBound(self, *args)

WhenDomain

def WhenDomain(self, *args)

Overload 1: This method attaches a demon that will watch any domain modification of the domain of the variable.

|

Overload 2: This method attaches a closure that will watch any domain modification of the domain of the variable.

Expand source code
def WhenDomain(self, *args) -> "void":
    r"""
    *Overload 1:*
    This method attaches a demon that will watch any domain modification of the domain of the variable.

    |

    *Overload 2:*
    This method attaches a closure that will watch any domain modification of the domain of the variable.
    """
    return _pywrapcp.IntVar_WhenDomain(self, *args)
Inherited members

IntVarContainer

class IntVarContainer (*args, **kwargs)
Expand source code
class IntVarContainer(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Contains(self, var: "IntVar") -> "bool":
        return _pywrapcp.IntVarContainer_Contains(self, var)

    def Element(self, index: "int") -> "operations_research::IntVarElement *":
        return _pywrapcp.IntVarContainer_Element(self, index)

    def Size(self) -> "int":
        return _pywrapcp.IntVarContainer_Size(self)

    def Store(self) -> "void":
        return _pywrapcp.IntVarContainer_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.IntVarContainer_Restore(self)

    def __eq__(self, container: "IntVarContainer") -> "bool":
        r""" Returns true if this and 'container' both represent the same V* -> E map. Runs in linear time; requires that the == operator on the type E is well defined."""
        return _pywrapcp.IntVarContainer___eq__(self, container)

    def __ne__(self, container: "IntVarContainer") -> "bool":
        return _pywrapcp.IntVarContainer___ne__(self, container)
    __swig_destroy__ = _pywrapcp.delete_IntVarContainer
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

Contains

def Contains(self, var)
Expand source code
def Contains(self, var: "IntVar") -> "bool":
    return _pywrapcp.IntVarContainer_Contains(self, var)

Element

def Element(self, index)
Expand source code
def Element(self, index: "int") -> "operations_research::IntVarElement *":
    return _pywrapcp.IntVarContainer_Element(self, index)

Restore

def Restore(self)
Expand source code
def Restore(self) -> "void":
    return _pywrapcp.IntVarContainer_Restore(self)

Size

def Size(self)
Expand source code
def Size(self) -> "int":
    return _pywrapcp.IntVarContainer_Size(self)

Store

def Store(self)
Expand source code
def Store(self) -> "void":
    return _pywrapcp.IntVarContainer_Store(self)

IntVarElement

class IntVarElement (*args, **kwargs)
Expand source code
class IntVarElement(AssignmentElement):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Var(self) -> "operations_research::IntVar *":
        return _pywrapcp.IntVarElement_Var(self)

    def Min(self) -> "int64":
        return _pywrapcp.IntVarElement_Min(self)

    def SetMin(self, m: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetMin(self, m)

    def Max(self) -> "int64":
        return _pywrapcp.IntVarElement_Max(self)

    def SetMax(self, m: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetMax(self, m)

    def Value(self) -> "int64":
        return _pywrapcp.IntVarElement_Value(self)

    def Bound(self) -> "bool":
        return _pywrapcp.IntVarElement_Bound(self)

    def SetRange(self, l: "int64", u: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetRange(self, l, u)

    def SetValue(self, v: "int64") -> "void":
        return _pywrapcp.IntVarElement_SetValue(self, v)

    def __eq__(self, element: "IntVarElement") -> "bool":
        return _pywrapcp.IntVarElement___eq__(self, element)

    def __ne__(self, element: "IntVarElement") -> "bool":
        return _pywrapcp.IntVarElement___ne__(self, element)
    __swig_destroy__ = _pywrapcp.delete_IntVarElement
Ancestors
Methods

Bound

def Bound(self)
Expand source code
def Bound(self) -> "bool":
    return _pywrapcp.IntVarElement_Bound(self)

Max

def Max(self)
Expand source code
def Max(self) -> "int64":
    return _pywrapcp.IntVarElement_Max(self)

Min

def Min(self)
Expand source code
def Min(self) -> "int64":
    return _pywrapcp.IntVarElement_Min(self)

SetMax

def SetMax(self, m)
Expand source code
def SetMax(self, m: "int64") -> "void":
    return _pywrapcp.IntVarElement_SetMax(self, m)

SetMin

def SetMin(self, m)
Expand source code
def SetMin(self, m: "int64") -> "void":
    return _pywrapcp.IntVarElement_SetMin(self, m)

SetRange

def SetRange(self, l, u)
Expand source code
def SetRange(self, l: "int64", u: "int64") -> "void":
    return _pywrapcp.IntVarElement_SetRange(self, l, u)

SetValue

def SetValue(self, v)
Expand source code
def SetValue(self, v: "int64") -> "void":
    return _pywrapcp.IntVarElement_SetValue(self, v)

Value

def Value(self)
Expand source code
def Value(self) -> "int64":
    return _pywrapcp.IntVarElement_Value(self)

Var

def Var(self)
Expand source code
def Var(self) -> "operations_research::IntVar *":
    return _pywrapcp.IntVarElement_Var(self)
Inherited members

IntVarFilteredDecisionBuilder

class IntVarFilteredDecisionBuilder (*args, **kwargs)

Decision builders building a solution using local search filters to evaluate its feasibility. This is very fast but can eventually fail when the solution is restored if filters did not detect all infeasiblities. More details: Using local search filters to build a solution. The approach is pretty straight-forward: have a general assignment storing the current solution, build delta assigment representing possible extensions to the current solution and validate them with filters. The tricky bit comes from using the assignment and filter APIs in a way which avoids the lazy creation of internal hash_maps between variables and indices. Generic filter-based decision builder applied to IntVars. when the code is mature enough.

Expand source code
class IntVarFilteredDecisionBuilder(DecisionBuilder):
    r""" Decision builders building a solution using local search filters to evaluate its feasibility. This is very fast but can eventually fail when the solution is restored if filters did not detect all infeasiblities. More details: Using local search filters to build a solution. The approach is pretty straight-forward: have a general assignment storing the current solution, build delta assigment representing possible extensions to the current solution and validate them with filters. The tricky bit comes from using the assignment and filter APIs in a way which avoids the lazy creation of internal hash_maps between variables and indices. Generic filter-based decision builder applied to IntVars. when the code is mature enough."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_IntVarFilteredDecisionBuilder

    def NextWrapper(self, solver: "Solver") -> "operations_research::Decision *":
        return _pywrapcp.IntVarFilteredDecisionBuilder_NextWrapper(self, solver)

    def BuildSolution(self) -> "bool":
        r""" Virtual method to redefine to build a solution."""
        return _pywrapcp.IntVarFilteredDecisionBuilder_BuildSolution(self)

    def number_of_decisions(self) -> "int64":
        r""" Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters."""
        return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_decisions(self)

    def number_of_rejects(self) -> "int64":
        return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_rejects(self)
Ancestors
Subclasses
Methods

BuildSolution

def BuildSolution(self)

Virtual method to redefine to build a solution.

Expand source code
def BuildSolution(self) -> "bool":
    r""" Virtual method to redefine to build a solution."""
    return _pywrapcp.IntVarFilteredDecisionBuilder_BuildSolution(self)

number_of_decisions

def number_of_decisions(self)

Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters.

Expand source code
def number_of_decisions(self) -> "int64":
    r""" Returns statistics on search, number of decisions sent to filters, number of decisions rejected by filters."""
    return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_decisions(self)

number_of_rejects

def number_of_rejects(self)
Expand source code
def number_of_rejects(self) -> "int64":
    return _pywrapcp.IntVarFilteredDecisionBuilder_number_of_rejects(self)
Inherited members

IntVarIterator

class IntVarIterator (*args, **kwargs)

The class Iterator has two direct subclasses. HoleIterators iterates over all holes, that is value removed between the current min and max of the variable since the last time the variable was processed in the queue. DomainIterators iterates over all elements of the variable domain. Both iterators are not robust to domain changes. Hole iterators can also report values outside the current min and max of the variable. HoleIterators should only be called from a demon attached to the variable that has created this iterator. IntVar* current_var; std::unique_ptr it(current_var->MakeHoleIterator(false)); for (const int64 hole : InitAndGetValues(it)) { /// use the hole }

Expand source code
class IntVarIterator(BaseObject):
    r""" The class Iterator has two direct subclasses. HoleIterators iterates over all holes, that is value removed between the current min and max of the variable since the last time the variable was processed in the queue. DomainIterators iterates over all elements of the variable domain. Both iterators are not robust to domain changes. Hole iterators can also report values outside the current min and max of the variable. HoleIterators should only be called from a demon attached to the variable that has created this iterator. IntVar* current_var; std::unique_ptr<IntVarIterator> it(current_var->MakeHoleIterator(false)); for (const int64 hole : InitAndGetValues(it)) {   /// use the hole }"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Init(self) -> "void":
        r""" This method must be called before each loop."""
        return _pywrapcp.IntVarIterator_Init(self)

    def Ok(self) -> "bool":
        r""" This method indicates if we can call Value() or not."""
        return _pywrapcp.IntVarIterator_Ok(self)

    def Value(self) -> "int64":
        r""" This method returns the current value of the iterator."""
        return _pywrapcp.IntVarIterator_Value(self)

    def Next(self) -> "void":
        r""" This method moves the iterator to the next value."""
        return _pywrapcp.IntVarIterator_Next(self)

    def DebugString(self) -> "std::string":
        r""" Pretty Print."""
        return _pywrapcp.IntVarIterator_DebugString(self)

    def __iter__(self):
      self.Init()
      return self

    def next(self):
      if self.Ok():
        result = self.Value()
        self.Next()
        return result
      else:
        raise StopIteration()

    def __next__(self):
      return self.next()
Ancestors
Methods

DebugString

def DebugString(self)

Pretty Print.

Expand source code
def DebugString(self) -> "std::string":
    r""" Pretty Print."""
    return _pywrapcp.IntVarIterator_DebugString(self)

Init

def Init(self)

This method must be called before each loop.

Expand source code
def Init(self) -> "void":
    r""" This method must be called before each loop."""
    return _pywrapcp.IntVarIterator_Init(self)

Next

def Next(self)

This method moves the iterator to the next value.

Expand source code
def Next(self) -> "void":
    r""" This method moves the iterator to the next value."""
    return _pywrapcp.IntVarIterator_Next(self)

Ok

def Ok(self)

This method indicates if we can call Value() or not.

Expand source code
def Ok(self) -> "bool":
    r""" This method indicates if we can call Value() or not."""
    return _pywrapcp.IntVarIterator_Ok(self)

Value

def Value(self)

This method returns the current value of the iterator.

Expand source code
def Value(self) -> "int64":
    r""" This method returns the current value of the iterator."""
    return _pywrapcp.IntVarIterator_Value(self)

next

def next(self)
Expand source code
def next(self):
  if self.Ok():
    result = self.Value()
    self.Next()
    return result
  else:
    raise StopIteration()
Inherited members

IntVarLocalSearchFilter

class IntVarLocalSearchFilter (vars)

Local Search Filters are used for fast neighbor pruning. Filtering a move is done in several phases: - in the Relax phase, filters determine which parts of their internals will be changed by the candidate, and modify intermediary State - in the Accept phase, filters check that the candidate is feasible, - if the Accept phase succeeds, the solver may decide to trigger a Synchronize phase that makes filters change their internal representation to the last candidate, - otherwise (Accept fails or the solver does not want to synchronize), a Revert phase makes filters erase any intermediary State generated by the Relax and Accept phases. A given filter has phases called with the following pattern: (Relax.Accept.Synchronize | Relax.Accept.Revert | Relax.Revert)*. Filters's Revert() is always called in the reverse order their Accept() was called, to allow late filters to use state done/undone by early filters' Accept()/Revert().

Expand source code
class IntVarLocalSearchFilter(LocalSearchFilter):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, vars: "std::vector< operations_research::IntVar * > const &"):
        if self.__class__ == IntVarLocalSearchFilter:
            _self = None
        else:
            _self = self
        _pywrapcp.IntVarLocalSearchFilter_swiginit(self, _pywrapcp.new_IntVarLocalSearchFilter(_self, vars))
    __swig_destroy__ = _pywrapcp.delete_IntVarLocalSearchFilter

    def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
        r""" This method should not be overridden. Override OnSynchronize() instead which is called before exiting this method."""
        return _pywrapcp.IntVarLocalSearchFilter_Synchronize(self, assignment, delta)

    def Size(self) -> "int":
        return _pywrapcp.IntVarLocalSearchFilter_Size(self)

    def Value(self, index: "int") -> "int64":
        return _pywrapcp.IntVarLocalSearchFilter_Value(self, index)

    def IndexFromVar(self, var: "IntVar") -> "int64":
        return _pywrapcp.IntVarLocalSearchFilter_IndexFromVar(self, var)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_IntVarLocalSearchFilter(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

IndexFromVar

def IndexFromVar(self, var)
Expand source code
def IndexFromVar(self, var: "IntVar") -> "int64":
    return _pywrapcp.IntVarLocalSearchFilter_IndexFromVar(self, var)

Size

def Size(self)
Expand source code
def Size(self) -> "int":
    return _pywrapcp.IntVarLocalSearchFilter_Size(self)

Synchronize

def Synchronize(self, assignment, delta)

This method should not be overridden. Override OnSynchronize() instead which is called before exiting this method.

Expand source code
def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
    r""" This method should not be overridden. Override OnSynchronize() instead which is called before exiting this method."""
    return _pywrapcp.IntVarLocalSearchFilter_Synchronize(self, assignment, delta)

Value

def Value(self, index)
Expand source code
def Value(self, index: "int") -> "int64":
    return _pywrapcp.IntVarLocalSearchFilter_Value(self, index)
Inherited members

IntVarLocalSearchOperator

class IntVarLocalSearchOperator (*args)

Base operator class for operators manipulating variables.

Expand source code
class IntVarLocalSearchOperator(IntVarLocalSearchOperatorTemplate):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        if self.__class__ == IntVarLocalSearchOperator:
            _self = None
        else:
            _self = self
        _pywrapcp.IntVarLocalSearchOperator_swiginit(self, _pywrapcp.new_IntVarLocalSearchOperator(_self, *args))
    __swig_destroy__ = _pywrapcp.delete_IntVarLocalSearchOperator

    def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        r""" Redefines MakeNextNeighbor to export a simpler interface. The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead."""
        return _pywrapcp.IntVarLocalSearchOperator_NextNeighbor(self, delta, deltadelta)

    def OneNeighbor(self) -> "bool":
        r""" Creates a new neighbor. It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator."""
        return _pywrapcp.IntVarLocalSearchOperator_OneNeighbor(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_IntVarLocalSearchOperator(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

NextNeighbor

def NextNeighbor(self, delta, deltadelta)

Redefines MakeNextNeighbor to export a simpler interface. The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead.

Expand source code
def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
    r""" Redefines MakeNextNeighbor to export a simpler interface. The calls to ApplyChanges() and RevertChanges() are factored in this method, hiding both delta and deltadelta from subclasses which only need to override MakeOneNeighbor(). Therefore this method should not be overridden. Override MakeOneNeighbor() instead."""
    return _pywrapcp.IntVarLocalSearchOperator_NextNeighbor(self, delta, deltadelta)

OneNeighbor

def OneNeighbor(self)

Creates a new neighbor. It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator.

Expand source code
def OneNeighbor(self) -> "bool":
    r""" Creates a new neighbor. It returns false when the neighborhood is completely explored. MakeNextNeighbor() in a subclass of IntVarLocalSearchOperator."""
    return _pywrapcp.IntVarLocalSearchOperator_OneNeighbor(self)
Inherited members

IntVarLocalSearchOperatorTemplate

class IntVarLocalSearchOperatorTemplate (*args, **kwargs)

Base operator class for operators manipulating variables.

Expand source code
class IntVarLocalSearchOperatorTemplate(LocalSearchOperator):
    r""" Base operator class for operators manipulating variables."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Start(self, assignment: "Assignment") -> "void":
        r""" This method should not be overridden. Override OnStart() instead which is called before exiting this method."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Start(self, assignment)

    def IsIncremental(self) -> "bool":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_IsIncremental(self)

    def Size(self) -> "int":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Size(self)

    def Value(self, index: "int64") -> "long long const &":
        r""" Returns the value in the current assignment of the variable of given index."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_Value(self, index)

    def OldValue(self, index: "int64") -> "long long const &":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_OldValue(self, index)

    def SetValue(self, index: "int64", value: "long long const &") -> "void":
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_SetValue(self, index, value)

    def OnStart(self) -> "void":
        r""" Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly."""
        return _pywrapcp.IntVarLocalSearchOperatorTemplate_OnStart(self)
Ancestors
Subclasses
Methods

IsIncremental

def IsIncremental(self)
Expand source code
def IsIncremental(self) -> "bool":
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_IsIncremental(self)

OldValue

def OldValue(self, index)
Expand source code
def OldValue(self, index: "int64") -> "long long const &":
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_OldValue(self, index)

OnStart

def OnStart(self)

Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly.

Expand source code
def OnStart(self) -> "void":
    r""" Called by Start() after synchronizing the operator with the current assignment. Should be overridden instead of Start() to avoid calling VarLocalSearchOperator::Start explicitly."""
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_OnStart(self)

SetValue

def SetValue(self, index, value)
Expand source code
def SetValue(self, index: "int64", value: "long long const &") -> "void":
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_SetValue(self, index, value)

Size

def Size(self)
Expand source code
def Size(self) -> "int":
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_Size(self)

Start

def Start(self, assignment)

This method should not be overridden. Override OnStart() instead which is called before exiting this method.

Expand source code
def Start(self, assignment: "Assignment") -> "void":
    r""" This method should not be overridden. Override OnStart() instead which is called before exiting this method."""
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_Start(self, assignment)

Value

def Value(self, index)

Returns the value in the current assignment of the variable of given index.

Expand source code
def Value(self, index: "int64") -> "long long const &":
    r""" Returns the value in the current assignment of the variable of given index."""
    return _pywrapcp.IntVarLocalSearchOperatorTemplate_Value(self, index)
Inherited members

IntervalVar

class IntervalVar (*args, **kwargs)

Interval variables are often used in scheduling. The main characteristics of an IntervalVar are the start position, duration, and end date. All these characteristics can be queried and set, and demons can be posted on their modifications. An important aspect is optionality: an IntervalVar can be performed or not. If unperformed, then it simply does not exist, and its characteristics cannot be accessed any more. An interval var is automatically marked as unperformed when it is not consistent anymore (start greater than end, duration < 0…)

Expand source code
class IntervalVar(PropagationBaseObject):
    r""" Interval variables are often used in scheduling. The main characteristics of an IntervalVar are the start position, duration, and end date. All these characteristics can be queried and set, and demons can be posted on their modifications. An important aspect is optionality: an IntervalVar can be performed or not. If unperformed, then it simply does not exist, and its characteristics cannot be accessed any more. An interval var is automatically marked as unperformed when it is not consistent anymore (start greater than end, duration < 0...)"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")

    def StartMin(self) -> "int64":
        r""" These methods query, set, and watch the start position of the interval var."""
        return _pywrapcp.IntervalVar_StartMin(self)

    def StartMax(self) -> "int64":
        return _pywrapcp.IntervalVar_StartMax(self)

    def SetStartMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartMin(self, m)

    def SetStartMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartMax(self, m)

    def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetStartRange(self, mi, ma)

    def OldStartMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldStartMin(self)

    def OldStartMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldStartMax(self)

    def WhenStartRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenStartRange(self, *args)

    def WhenStartBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenStartBound(self, *args)

    def DurationMin(self) -> "int64":
        r""" These methods query, set, and watch the duration of the interval var."""
        return _pywrapcp.IntervalVar_DurationMin(self)

    def DurationMax(self) -> "int64":
        return _pywrapcp.IntervalVar_DurationMax(self)

    def SetDurationMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationMin(self, m)

    def SetDurationMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationMax(self, m)

    def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetDurationRange(self, mi, ma)

    def OldDurationMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldDurationMin(self)

    def OldDurationMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldDurationMax(self)

    def WhenDurationRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenDurationRange(self, *args)

    def WhenDurationBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenDurationBound(self, *args)

    def EndMin(self) -> "int64":
        r""" These methods query, set, and watch the end position of the interval var."""
        return _pywrapcp.IntervalVar_EndMin(self)

    def EndMax(self) -> "int64":
        return _pywrapcp.IntervalVar_EndMax(self)

    def SetEndMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndMin(self, m)

    def SetEndMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndMax(self, m)

    def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVar_SetEndRange(self, mi, ma)

    def OldEndMin(self) -> "int64":
        return _pywrapcp.IntervalVar_OldEndMin(self)

    def OldEndMax(self) -> "int64":
        return _pywrapcp.IntervalVar_OldEndMax(self)

    def WhenEndRange(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenEndRange(self, *args)

    def WhenEndBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenEndBound(self, *args)

    def MustBePerformed(self) -> "bool":
        r""" These methods query, set, and watch the performed status of the interval var."""
        return _pywrapcp.IntervalVar_MustBePerformed(self)

    def MayBePerformed(self) -> "bool":
        return _pywrapcp.IntervalVar_MayBePerformed(self)

    def CannotBePerformed(self) -> "bool":
        return _pywrapcp.IntervalVar_CannotBePerformed(self)

    def IsPerformedBound(self) -> "bool":
        return _pywrapcp.IntervalVar_IsPerformedBound(self)

    def SetPerformed(self, val: "bool") -> "void":
        return _pywrapcp.IntervalVar_SetPerformed(self, val)

    def WasPerformedBound(self) -> "bool":
        return _pywrapcp.IntervalVar_WasPerformedBound(self)

    def WhenPerformedBound(self, *args) -> "void":
        return _pywrapcp.IntervalVar_WhenPerformedBound(self, *args)

    def WhenAnything(self, *args) -> "void":
        r"""
        *Overload 1:*
        Attaches a demon awakened when anything about this interval changes.

        |

        *Overload 2:*
        Attaches a closure awakened when anything about this interval changes.
        """
        return _pywrapcp.IntervalVar_WhenAnything(self, *args)

    def StartExpr(self) -> "operations_research::IntExpr *":
        r""" These methods create expressions encapsulating the start, end and duration of the interval var. Please note that these must not be used if the interval var is unperformed."""
        return _pywrapcp.IntervalVar_StartExpr(self)

    def DurationExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_DurationExpr(self)

    def EndExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_EndExpr(self)

    def PerformedExpr(self) -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_PerformedExpr(self)

    def SafeStartExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        r""" These methods create expressions encapsulating the start, end and duration of the interval var. If the interval var is unperformed, they will return the unperformed_value."""
        return _pywrapcp.IntervalVar_SafeStartExpr(self, unperformed_value)

    def SafeDurationExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_SafeDurationExpr(self, unperformed_value)

    def SafeEndExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
        return _pywrapcp.IntervalVar_SafeEndExpr(self, unperformed_value)

    def EndsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterEnd(self, other)

    def EndsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterEndWithDelay(self, other, delay)

    def EndsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterStart(self, other)

    def EndsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfterStartWithDelay(self, other, delay)

    def EndsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtEnd(self, other)

    def EndsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtEndWithDelay(self, other, delay)

    def EndsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtStart(self, other)

    def EndsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAtStartWithDelay(self, other, delay)

    def StartsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterEnd(self, other)

    def StartsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterEndWithDelay(self, other, delay)

    def StartsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterStart(self, other)

    def StartsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfterStartWithDelay(self, other, delay)

    def StartsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtEnd(self, other)

    def StartsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtEndWithDelay(self, other, delay)

    def StartsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtStart(self, other)

    def StartsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAtStartWithDelay(self, other, delay)

    def StaysInSync(self, other: "IntervalVar") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StaysInSync(self, other)

    def StaysInSyncWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StaysInSyncWithDelay(self, other, delay)

    def EndsAfter(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAfter(self, date)

    def EndsAt(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsAt(self, date)

    def EndsBefore(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_EndsBefore(self, date)

    def StartsAfter(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAfter(self, date)

    def StartsAt(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsAt(self, date)

    def StartsBefore(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_StartsBefore(self, date)

    def CrossesDate(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_CrossesDate(self, date)

    def AvoidsDate(self, date: "int64") -> "operations_research::Constraint *":
        return _pywrapcp.IntervalVar_AvoidsDate(self, date)

    def __repr__(self) -> "std::string":
        return _pywrapcp.IntervalVar___repr__(self)

    def __str__(self) -> "std::string":
        return _pywrapcp.IntervalVar___str__(self)
Ancestors
Methods

AvoidsDate

def AvoidsDate(self, date)
Expand source code
def AvoidsDate(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_AvoidsDate(self, date)

CannotBePerformed

def CannotBePerformed(self)
Expand source code
def CannotBePerformed(self) -> "bool":
    return _pywrapcp.IntervalVar_CannotBePerformed(self)

CrossesDate

def CrossesDate(self, date)
Expand source code
def CrossesDate(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_CrossesDate(self, date)

DurationExpr

def DurationExpr(self)
Expand source code
def DurationExpr(self) -> "operations_research::IntExpr *":
    return _pywrapcp.IntervalVar_DurationExpr(self)

DurationMax

def DurationMax(self)
Expand source code
def DurationMax(self) -> "int64":
    return _pywrapcp.IntervalVar_DurationMax(self)

DurationMin

def DurationMin(self)

These methods query, set, and watch the duration of the interval var.

Expand source code
def DurationMin(self) -> "int64":
    r""" These methods query, set, and watch the duration of the interval var."""
    return _pywrapcp.IntervalVar_DurationMin(self)

EndExpr

def EndExpr(self)
Expand source code
def EndExpr(self) -> "operations_research::IntExpr *":
    return _pywrapcp.IntervalVar_EndExpr(self)

EndMax

def EndMax(self)
Expand source code
def EndMax(self) -> "int64":
    return _pywrapcp.IntervalVar_EndMax(self)

EndMin

def EndMin(self)

These methods query, set, and watch the end position of the interval var.

Expand source code
def EndMin(self) -> "int64":
    r""" These methods query, set, and watch the end position of the interval var."""
    return _pywrapcp.IntervalVar_EndMin(self)

EndsAfter

def EndsAfter(self, date)
Expand source code
def EndsAfter(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAfter(self, date)

EndsAfterEnd

def EndsAfterEnd(self, other)
Expand source code
def EndsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAfterEnd(self, other)

EndsAfterEndWithDelay

def EndsAfterEndWithDelay(self, other, delay)
Expand source code
def EndsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAfterEndWithDelay(self, other, delay)

EndsAfterStart

def EndsAfterStart(self, other)
Expand source code
def EndsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAfterStart(self, other)

EndsAfterStartWithDelay

def EndsAfterStartWithDelay(self, other, delay)
Expand source code
def EndsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAfterStartWithDelay(self, other, delay)

EndsAt

def EndsAt(self, date)
Expand source code
def EndsAt(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAt(self, date)

EndsAtEnd

def EndsAtEnd(self, other)
Expand source code
def EndsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAtEnd(self, other)

EndsAtEndWithDelay

def EndsAtEndWithDelay(self, other, delay)
Expand source code
def EndsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAtEndWithDelay(self, other, delay)

EndsAtStart

def EndsAtStart(self, other)
Expand source code
def EndsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAtStart(self, other)

EndsAtStartWithDelay

def EndsAtStartWithDelay(self, other, delay)
Expand source code
def EndsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsAtStartWithDelay(self, other, delay)

EndsBefore

def EndsBefore(self, date)
Expand source code
def EndsBefore(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_EndsBefore(self, date)

IsPerformedBound

def IsPerformedBound(self)
Expand source code
def IsPerformedBound(self) -> "bool":
    return _pywrapcp.IntervalVar_IsPerformedBound(self)

MayBePerformed

def MayBePerformed(self)
Expand source code
def MayBePerformed(self) -> "bool":
    return _pywrapcp.IntervalVar_MayBePerformed(self)

MustBePerformed

def MustBePerformed(self)

These methods query, set, and watch the performed status of the interval var.

Expand source code
def MustBePerformed(self) -> "bool":
    r""" These methods query, set, and watch the performed status of the interval var."""
    return _pywrapcp.IntervalVar_MustBePerformed(self)

OldDurationMax

def OldDurationMax(self)
Expand source code
def OldDurationMax(self) -> "int64":
    return _pywrapcp.IntervalVar_OldDurationMax(self)

OldDurationMin

def OldDurationMin(self)
Expand source code
def OldDurationMin(self) -> "int64":
    return _pywrapcp.IntervalVar_OldDurationMin(self)

OldEndMax

def OldEndMax(self)
Expand source code
def OldEndMax(self) -> "int64":
    return _pywrapcp.IntervalVar_OldEndMax(self)

OldEndMin

def OldEndMin(self)
Expand source code
def OldEndMin(self) -> "int64":
    return _pywrapcp.IntervalVar_OldEndMin(self)

OldStartMax

def OldStartMax(self)
Expand source code
def OldStartMax(self) -> "int64":
    return _pywrapcp.IntervalVar_OldStartMax(self)

OldStartMin

def OldStartMin(self)
Expand source code
def OldStartMin(self) -> "int64":
    return _pywrapcp.IntervalVar_OldStartMin(self)

PerformedExpr

def PerformedExpr(self)
Expand source code
def PerformedExpr(self) -> "operations_research::IntExpr *":
    return _pywrapcp.IntervalVar_PerformedExpr(self)

SafeDurationExpr

def SafeDurationExpr(self, unperformed_value)
Expand source code
def SafeDurationExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
    return _pywrapcp.IntervalVar_SafeDurationExpr(self, unperformed_value)

SafeEndExpr

def SafeEndExpr(self, unperformed_value)
Expand source code
def SafeEndExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
    return _pywrapcp.IntervalVar_SafeEndExpr(self, unperformed_value)

SafeStartExpr

def SafeStartExpr(self, unperformed_value)

These methods create expressions encapsulating the start, end and duration of the interval var. If the interval var is unperformed, they will return the unperformed_value.

Expand source code
def SafeStartExpr(self, unperformed_value: "int64") -> "operations_research::IntExpr *":
    r""" These methods create expressions encapsulating the start, end and duration of the interval var. If the interval var is unperformed, they will return the unperformed_value."""
    return _pywrapcp.IntervalVar_SafeStartExpr(self, unperformed_value)

SetDurationMax

def SetDurationMax(self, m)
Expand source code
def SetDurationMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetDurationMax(self, m)

SetDurationMin

def SetDurationMin(self, m)
Expand source code
def SetDurationMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetDurationMin(self, m)

SetDurationRange

def SetDurationRange(self, mi, ma)
Expand source code
def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetDurationRange(self, mi, ma)

SetEndMax

def SetEndMax(self, m)
Expand source code
def SetEndMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetEndMax(self, m)

SetEndMin

def SetEndMin(self, m)
Expand source code
def SetEndMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetEndMin(self, m)

SetEndRange

def SetEndRange(self, mi, ma)
Expand source code
def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetEndRange(self, mi, ma)

SetPerformed

def SetPerformed(self, val)
Expand source code
def SetPerformed(self, val: "bool") -> "void":
    return _pywrapcp.IntervalVar_SetPerformed(self, val)

SetStartMax

def SetStartMax(self, m)
Expand source code
def SetStartMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetStartMax(self, m)

SetStartMin

def SetStartMin(self, m)
Expand source code
def SetStartMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetStartMin(self, m)

SetStartRange

def SetStartRange(self, mi, ma)
Expand source code
def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVar_SetStartRange(self, mi, ma)

StartExpr

def StartExpr(self)

These methods create expressions encapsulating the start, end and duration of the interval var. Please note that these must not be used if the interval var is unperformed.

Expand source code
def StartExpr(self) -> "operations_research::IntExpr *":
    r""" These methods create expressions encapsulating the start, end and duration of the interval var. Please note that these must not be used if the interval var is unperformed."""
    return _pywrapcp.IntervalVar_StartExpr(self)

StartMax

def StartMax(self)
Expand source code
def StartMax(self) -> "int64":
    return _pywrapcp.IntervalVar_StartMax(self)

StartMin

def StartMin(self)

These methods query, set, and watch the start position of the interval var.

Expand source code
def StartMin(self) -> "int64":
    r""" These methods query, set, and watch the start position of the interval var."""
    return _pywrapcp.IntervalVar_StartMin(self)

StartsAfter

def StartsAfter(self, date)
Expand source code
def StartsAfter(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAfter(self, date)

StartsAfterEnd

def StartsAfterEnd(self, other)
Expand source code
def StartsAfterEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAfterEnd(self, other)

StartsAfterEndWithDelay

def StartsAfterEndWithDelay(self, other, delay)
Expand source code
def StartsAfterEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAfterEndWithDelay(self, other, delay)

StartsAfterStart

def StartsAfterStart(self, other)
Expand source code
def StartsAfterStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAfterStart(self, other)

StartsAfterStartWithDelay

def StartsAfterStartWithDelay(self, other, delay)
Expand source code
def StartsAfterStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAfterStartWithDelay(self, other, delay)

StartsAt

def StartsAt(self, date)
Expand source code
def StartsAt(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAt(self, date)

StartsAtEnd

def StartsAtEnd(self, other)
Expand source code
def StartsAtEnd(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAtEnd(self, other)

StartsAtEndWithDelay

def StartsAtEndWithDelay(self, other, delay)
Expand source code
def StartsAtEndWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAtEndWithDelay(self, other, delay)

StartsAtStart

def StartsAtStart(self, other)
Expand source code
def StartsAtStart(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAtStart(self, other)

StartsAtStartWithDelay

def StartsAtStartWithDelay(self, other, delay)
Expand source code
def StartsAtStartWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsAtStartWithDelay(self, other, delay)

StartsBefore

def StartsBefore(self, date)
Expand source code
def StartsBefore(self, date: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StartsBefore(self, date)

StaysInSync

def StaysInSync(self, other)
Expand source code
def StaysInSync(self, other: "IntervalVar") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StaysInSync(self, other)

StaysInSyncWithDelay

def StaysInSyncWithDelay(self, other, delay)
Expand source code
def StaysInSyncWithDelay(self, other: "IntervalVar", delay: "int64") -> "operations_research::Constraint *":
    return _pywrapcp.IntervalVar_StaysInSyncWithDelay(self, other, delay)

WasPerformedBound

def WasPerformedBound(self)
Expand source code
def WasPerformedBound(self) -> "bool":
    return _pywrapcp.IntervalVar_WasPerformedBound(self)

WhenAnything

def WhenAnything(self, *args)

Overload 1: Attaches a demon awakened when anything about this interval changes.

|

Overload 2: Attaches a closure awakened when anything about this interval changes.

Expand source code
def WhenAnything(self, *args) -> "void":
    r"""
    *Overload 1:*
    Attaches a demon awakened when anything about this interval changes.

    |

    *Overload 2:*
    Attaches a closure awakened when anything about this interval changes.
    """
    return _pywrapcp.IntervalVar_WhenAnything(self, *args)

WhenDurationBound

def WhenDurationBound(self, *args)
Expand source code
def WhenDurationBound(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenDurationBound(self, *args)

WhenDurationRange

def WhenDurationRange(self, *args)
Expand source code
def WhenDurationRange(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenDurationRange(self, *args)

WhenEndBound

def WhenEndBound(self, *args)
Expand source code
def WhenEndBound(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenEndBound(self, *args)

WhenEndRange

def WhenEndRange(self, *args)
Expand source code
def WhenEndRange(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenEndRange(self, *args)

WhenPerformedBound

def WhenPerformedBound(self, *args)
Expand source code
def WhenPerformedBound(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenPerformedBound(self, *args)

WhenStartBound

def WhenStartBound(self, *args)
Expand source code
def WhenStartBound(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenStartBound(self, *args)

WhenStartRange

def WhenStartRange(self, *args)
Expand source code
def WhenStartRange(self, *args) -> "void":
    return _pywrapcp.IntervalVar_WhenStartRange(self, *args)
Inherited members

IntervalVarContainer

class IntervalVarContainer (*args, **kwargs)
Expand source code
class IntervalVarContainer(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Contains(self, var: "IntervalVar") -> "bool":
        return _pywrapcp.IntervalVarContainer_Contains(self, var)

    def Element(self, index: "int") -> "operations_research::IntervalVarElement *":
        return _pywrapcp.IntervalVarContainer_Element(self, index)

    def Size(self) -> "int":
        return _pywrapcp.IntervalVarContainer_Size(self)

    def Store(self) -> "void":
        return _pywrapcp.IntervalVarContainer_Store(self)

    def Restore(self) -> "void":
        return _pywrapcp.IntervalVarContainer_Restore(self)

    def __eq__(self, container: "IntervalVarContainer") -> "bool":
        r""" Returns true if this and 'container' both represent the same V* -> E map. Runs in linear time; requires that the == operator on the type E is well defined."""
        return _pywrapcp.IntervalVarContainer___eq__(self, container)

    def __ne__(self, container: "IntervalVarContainer") -> "bool":
        return _pywrapcp.IntervalVarContainer___ne__(self, container)
    __swig_destroy__ = _pywrapcp.delete_IntervalVarContainer
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

Contains

def Contains(self, var)
Expand source code
def Contains(self, var: "IntervalVar") -> "bool":
    return _pywrapcp.IntervalVarContainer_Contains(self, var)

Element

def Element(self, index)
Expand source code
def Element(self, index: "int") -> "operations_research::IntervalVarElement *":
    return _pywrapcp.IntervalVarContainer_Element(self, index)

Restore

def Restore(self)
Expand source code
def Restore(self) -> "void":
    return _pywrapcp.IntervalVarContainer_Restore(self)

Size

def Size(self)
Expand source code
def Size(self) -> "int":
    return _pywrapcp.IntervalVarContainer_Size(self)

Store

def Store(self)
Expand source code
def Store(self) -> "void":
    return _pywrapcp.IntervalVarContainer_Store(self)

IntervalVarElement

class IntervalVarElement (*args, **kwargs)
Expand source code
class IntervalVarElement(AssignmentElement):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Var(self) -> "operations_research::IntervalVar *":
        return _pywrapcp.IntervalVarElement_Var(self)

    def StartMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartMin(self)

    def StartMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartMax(self)

    def StartValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_StartValue(self)

    def DurationMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationMin(self)

    def DurationMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationMax(self)

    def DurationValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_DurationValue(self)

    def EndMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndMin(self)

    def EndMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndMax(self)

    def EndValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_EndValue(self)

    def PerformedMin(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedMin(self)

    def PerformedMax(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedMax(self)

    def PerformedValue(self) -> "int64":
        return _pywrapcp.IntervalVarElement_PerformedValue(self)

    def SetStartMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartMin(self, m)

    def SetStartMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartMax(self, m)

    def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartRange(self, mi, ma)

    def SetStartValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetStartValue(self, v)

    def SetDurationMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationMin(self, m)

    def SetDurationMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationMax(self, m)

    def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationRange(self, mi, ma)

    def SetDurationValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetDurationValue(self, v)

    def SetEndMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndMin(self, m)

    def SetEndMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndMax(self, m)

    def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndRange(self, mi, ma)

    def SetEndValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetEndValue(self, v)

    def SetPerformedMin(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedMin(self, m)

    def SetPerformedMax(self, m: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedMax(self, m)

    def SetPerformedRange(self, mi: "int64", ma: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedRange(self, mi, ma)

    def SetPerformedValue(self, v: "int64") -> "void":
        return _pywrapcp.IntervalVarElement_SetPerformedValue(self, v)

    def __eq__(self, element: "IntervalVarElement") -> "bool":
        return _pywrapcp.IntervalVarElement___eq__(self, element)

    def __ne__(self, element: "IntervalVarElement") -> "bool":
        return _pywrapcp.IntervalVarElement___ne__(self, element)
    __swig_destroy__ = _pywrapcp.delete_IntervalVarElement
Ancestors
Methods

DurationMax

def DurationMax(self)
Expand source code
def DurationMax(self) -> "int64":
    return _pywrapcp.IntervalVarElement_DurationMax(self)

DurationMin

def DurationMin(self)
Expand source code
def DurationMin(self) -> "int64":
    return _pywrapcp.IntervalVarElement_DurationMin(self)

DurationValue

def DurationValue(self)
Expand source code
def DurationValue(self) -> "int64":
    return _pywrapcp.IntervalVarElement_DurationValue(self)

EndMax

def EndMax(self)
Expand source code
def EndMax(self) -> "int64":
    return _pywrapcp.IntervalVarElement_EndMax(self)

EndMin

def EndMin(self)
Expand source code
def EndMin(self) -> "int64":
    return _pywrapcp.IntervalVarElement_EndMin(self)

EndValue

def EndValue(self)
Expand source code
def EndValue(self) -> "int64":
    return _pywrapcp.IntervalVarElement_EndValue(self)

PerformedMax

def PerformedMax(self)
Expand source code
def PerformedMax(self) -> "int64":
    return _pywrapcp.IntervalVarElement_PerformedMax(self)

PerformedMin

def PerformedMin(self)
Expand source code
def PerformedMin(self) -> "int64":
    return _pywrapcp.IntervalVarElement_PerformedMin(self)

PerformedValue

def PerformedValue(self)
Expand source code
def PerformedValue(self) -> "int64":
    return _pywrapcp.IntervalVarElement_PerformedValue(self)

SetDurationMax

def SetDurationMax(self, m)
Expand source code
def SetDurationMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetDurationMax(self, m)

SetDurationMin

def SetDurationMin(self, m)
Expand source code
def SetDurationMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetDurationMin(self, m)

SetDurationRange

def SetDurationRange(self, mi, ma)
Expand source code
def SetDurationRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetDurationRange(self, mi, ma)

SetDurationValue

def SetDurationValue(self, v)
Expand source code
def SetDurationValue(self, v: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetDurationValue(self, v)

SetEndMax

def SetEndMax(self, m)
Expand source code
def SetEndMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetEndMax(self, m)

SetEndMin

def SetEndMin(self, m)
Expand source code
def SetEndMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetEndMin(self, m)

SetEndRange

def SetEndRange(self, mi, ma)
Expand source code
def SetEndRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetEndRange(self, mi, ma)

SetEndValue

def SetEndValue(self, v)
Expand source code
def SetEndValue(self, v: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetEndValue(self, v)

SetPerformedMax

def SetPerformedMax(self, m)
Expand source code
def SetPerformedMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetPerformedMax(self, m)

SetPerformedMin

def SetPerformedMin(self, m)
Expand source code
def SetPerformedMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetPerformedMin(self, m)

SetPerformedRange

def SetPerformedRange(self, mi, ma)
Expand source code
def SetPerformedRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetPerformedRange(self, mi, ma)

SetPerformedValue

def SetPerformedValue(self, v)
Expand source code
def SetPerformedValue(self, v: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetPerformedValue(self, v)

SetStartMax

def SetStartMax(self, m)
Expand source code
def SetStartMax(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetStartMax(self, m)

SetStartMin

def SetStartMin(self, m)
Expand source code
def SetStartMin(self, m: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetStartMin(self, m)

SetStartRange

def SetStartRange(self, mi, ma)
Expand source code
def SetStartRange(self, mi: "int64", ma: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetStartRange(self, mi, ma)

SetStartValue

def SetStartValue(self, v)
Expand source code
def SetStartValue(self, v: "int64") -> "void":
    return _pywrapcp.IntervalVarElement_SetStartValue(self, v)

StartMax

def StartMax(self)
Expand source code
def StartMax(self) -> "int64":
    return _pywrapcp.IntervalVarElement_StartMax(self)

StartMin

def StartMin(self)
Expand source code
def StartMin(self) -> "int64":
    return _pywrapcp.IntervalVarElement_StartMin(self)

StartValue

def StartValue(self)
Expand source code
def StartValue(self) -> "int64":
    return _pywrapcp.IntervalVarElement_StartValue(self)

Var

def Var(self)
Expand source code
def Var(self) -> "operations_research::IntervalVar *":
    return _pywrapcp.IntervalVarElement_Var(self)
Inherited members

LocalCheapestInsertionFilteredDecisionBuilder

class LocalCheapestInsertionFilteredDecisionBuilder (*args, **kwargs)

Filter-base decision builder which builds a solution by inserting nodes at their cheapest position. The cost of a position is computed an arc-based cost callback. Node selected for insertion are considered in decreasing order of distance to the start/ends of the routes, i.e. farthest nodes are inserted first.

Expand source code
class LocalCheapestInsertionFilteredDecisionBuilder(CheapestInsertionFilteredDecisionBuilder):
    r""" Filter-base decision builder which builds a solution by inserting nodes at their cheapest position. The cost of a position is computed an arc-based cost callback. Node selected for insertion are considered in decreasing order of distance to the start/ends of the routes, i.e. farthest nodes are inserted first."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_LocalCheapestInsertionFilteredDecisionBuilder

    def BuildSolution(self) -> "bool":
        return _pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_BuildSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.LocalCheapestInsertionFilteredDecisionBuilder_DebugString(self)
Inherited members

LocalSearchFilter

class LocalSearchFilter (*args, **kwargs)

Local Search Filters are used for fast neighbor pruning. Filtering a move is done in several phases: - in the Relax phase, filters determine which parts of their internals will be changed by the candidate, and modify intermediary State - in the Accept phase, filters check that the candidate is feasible, - if the Accept phase succeeds, the solver may decide to trigger a Synchronize phase that makes filters change their internal representation to the last candidate, - otherwise (Accept fails or the solver does not want to synchronize), a Revert phase makes filters erase any intermediary State generated by the Relax and Accept phases. A given filter has phases called with the following pattern: (Relax.Accept.Synchronize | Relax.Accept.Revert | Relax.Revert)*. Filters's Revert() is always called in the reverse order their Accept() was called, to allow late filters to use state done/undone by early filters' Accept()/Revert().

Expand source code
class LocalSearchFilter(BaseObject):
    r""" Local Search Filters are used for fast neighbor pruning. Filtering a move is done in several phases: - in the Relax phase, filters determine which parts of their internals   will be changed by the candidate, and modify intermediary State - in the Accept phase, filters check that the candidate is feasible, - if the Accept phase succeeds, the solver may decide to trigger a   Synchronize phase that makes filters change their internal representation   to the last candidate, - otherwise (Accept fails or the solver does not want to synchronize),   a Revert phase makes filters erase any intermediary State generated by the   Relax and Accept phases. A given filter has phases called with the following pattern: (Relax.Accept.Synchronize | Relax.Accept.Revert | Relax.Revert)*. Filters's Revert() is always called in the reverse order their Accept() was called, to allow late filters to use state done/undone by early filters' Accept()/Revert()."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
        r""" Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted. TODO(user): Remove arguments when there are no more need for those."""
        return _pywrapcp.LocalSearchFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

    def IsIncremental(self) -> "bool":
        return _pywrapcp.LocalSearchFilter_IsIncremental(self)

    def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
        r""" Synchronizes the filter with the current solution, delta being the difference with the solution passed to the previous call to Synchronize() or IncrementalSynchronize(). 'delta' can be used to incrementally synchronizing the filter with the new solution by only considering the changes in delta."""
        return _pywrapcp.LocalSearchFilter_Synchronize(self, assignment, delta)
    __swig_destroy__ = _pywrapcp.delete_LocalSearchFilter
Ancestors
Subclasses
Methods

Accept

def Accept(self, delta, deltadelta, objective_min, objective_max)

Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted. TODO(user): Remove arguments when there are no more need for those.

Expand source code
def Accept(self, delta: "Assignment", deltadelta: "Assignment", objective_min: "int64", objective_max: "int64") -> "bool":
    r""" Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds the variables which have been modified and their new value. If the filter represents a part of the global objective, its contribution must be between objective_min and objective_max. Sample: supposing one wants to maintain a[0,1] + b[0,1] <= 1, for the assignment (a,1), (b,0), the delta (b,1) will be rejected but the delta (a,0) will be accepted. TODO(user): Remove arguments when there are no more need for those."""
    return _pywrapcp.LocalSearchFilter_Accept(self, delta, deltadelta, objective_min, objective_max)

IsIncremental

def IsIncremental(self)
Expand source code
def IsIncremental(self) -> "bool":
    return _pywrapcp.LocalSearchFilter_IsIncremental(self)

Synchronize

def Synchronize(self, assignment, delta)

Synchronizes the filter with the current solution, delta being the difference with the solution passed to the previous call to Synchronize() or IncrementalSynchronize(). 'delta' can be used to incrementally synchronizing the filter with the new solution by only considering the changes in delta.

Expand source code
def Synchronize(self, assignment: "Assignment", delta: "Assignment") -> "void":
    r""" Synchronizes the filter with the current solution, delta being the difference with the solution passed to the previous call to Synchronize() or IncrementalSynchronize(). 'delta' can be used to incrementally synchronizing the filter with the new solution by only considering the changes in delta."""
    return _pywrapcp.LocalSearchFilter_Synchronize(self, assignment, delta)
Inherited members

LocalSearchOperator

class LocalSearchOperator (*args, **kwargs)

This class represent a reversible FIFO structure. The main difference w.r.t a standard FIFO structure is that a Solver is given as parameter to the modifiers such that the solver can store the backtrack information Iterator's traversing order should not be changed, as some algorithm depend on it to be consistent. It's main use is to store a list of demons in the various classes of variables. The base class for all local search operators. A local search operator is an object that defines the neighborhood of a solution. In other words, a neighborhood is the set of solutions which can be reached from a given solution using an operator. The behavior of the LocalSearchOperator class is similar to iterators. The operator is synchronized with an assignment (gives the current values of the variables); this is done in the Start() method. Then one can iterate over the neighbors using the MakeNextNeighbor method. This method returns an assignment which represents the incremental changes to the current solution. It also returns a second assignment representing the changes to the last solution defined by the neighborhood operator; this assignment is empty if the neighborhood operator cannot track this information.

Expand source code
class LocalSearchOperator(BaseObject):
    r""" This class represent a reversible FIFO structure. The main difference w.r.t a standard FIFO structure is that a Solver is given as parameter to the modifiers such that the solver can store the backtrack information Iterator's traversing order should not be changed, as some algorithm depend on it to be consistent. It's main use is to store a list of demons in the various classes of variables. The base class for all local search operators. A local search operator is an object that defines the neighborhood of a solution. In other words, a neighborhood is the set of solutions which can be reached from a given solution using an operator. The behavior of the LocalSearchOperator class is similar to iterators. The operator is synchronized with an assignment (gives the current values of the variables); this is done in the Start() method. Then one can iterate over the neighbors using the MakeNextNeighbor method. This method returns an assignment which represents the incremental changes to the current solution. It also returns a second assignment representing the changes to the last solution defined by the neighborhood operator; this assignment is empty if the neighborhood operator cannot track this information."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        return _pywrapcp.LocalSearchOperator_NextNeighbor(self, delta, deltadelta)

    def Start(self, assignment: "Assignment") -> "void":
        return _pywrapcp.LocalSearchOperator_Start(self, assignment)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_LocalSearchOperator(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

NextNeighbor

def NextNeighbor(self, delta, deltadelta)
Expand source code
def NextNeighbor(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
    return _pywrapcp.LocalSearchOperator_NextNeighbor(self, delta, deltadelta)

Start

def Start(self, assignment)
Expand source code
def Start(self, assignment: "Assignment") -> "void":
    return _pywrapcp.LocalSearchOperator_Start(self, assignment)
Inherited members

NumericalRevInteger

class NumericalRevInteger (val)

Subclass of Rev which adds numerical operations.

Expand source code
class NumericalRevInteger(RevInteger):
    r""" Subclass of Rev<T> which adds numerical operations."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "long long const &"):
        _pywrapcp.NumericalRevInteger_swiginit(self, _pywrapcp.new_NumericalRevInteger(val))

    def Add(self, s: "Solver", to_add: "long long const &") -> "void":
        return _pywrapcp.NumericalRevInteger_Add(self, s, to_add)

    def Incr(self, s: "Solver") -> "void":
        return _pywrapcp.NumericalRevInteger_Incr(self, s)

    def Decr(self, s: "Solver") -> "void":
        return _pywrapcp.NumericalRevInteger_Decr(self, s)
    __swig_destroy__ = _pywrapcp.delete_NumericalRevInteger
Ancestors
Methods

Add

def Add(self, s, to_add)
Expand source code
def Add(self, s: "Solver", to_add: "long long const &") -> "void":
    return _pywrapcp.NumericalRevInteger_Add(self, s, to_add)

Decr

def Decr(self, s)
Expand source code
def Decr(self, s: "Solver") -> "void":
    return _pywrapcp.NumericalRevInteger_Decr(self, s)

Incr

def Incr(self, s)
Expand source code
def Incr(self, s: "Solver") -> "void":
    return _pywrapcp.NumericalRevInteger_Incr(self, s)
Inherited members

OptimizeVar

class OptimizeVar (*args, **kwargs)

This class encapsulates an objective. It requires the direction (minimize or maximize), the variable to optimize, and the improvement step.

Expand source code
class OptimizeVar(SearchMonitor):
    r""" This class encapsulates an objective. It requires the direction (minimize or maximize), the variable to optimize, and the improvement step."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def Best(self) -> "int64":
        r""" Returns the best value found during search."""
        return _pywrapcp.OptimizeVar_Best(self)

    def Var(self) -> "operations_research::IntVar *":
        r""" Returns the variable that is optimized."""
        return _pywrapcp.OptimizeVar_Var(self)

    def AcceptDelta(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
        r""" Internal methods."""
        return _pywrapcp.OptimizeVar_AcceptDelta(self, delta, deltadelta)

    def EnterSearch(self) -> "void":
        return _pywrapcp.OptimizeVar_EnterSearch(self)

    def BeginNextDecision(self, db: "DecisionBuilder") -> "void":
        return _pywrapcp.OptimizeVar_BeginNextDecision(self, db)

    def RefuteDecision(self, d: "Decision") -> "void":
        return _pywrapcp.OptimizeVar_RefuteDecision(self, d)

    def AtSolution(self) -> "bool":
        return _pywrapcp.OptimizeVar_AtSolution(self)

    def AcceptSolution(self) -> "bool":
        return _pywrapcp.OptimizeVar_AcceptSolution(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.OptimizeVar_DebugString(self)
Ancestors
Methods

AcceptDelta

def AcceptDelta(self, delta, deltadelta)

Internal methods.

Expand source code
def AcceptDelta(self, delta: "Assignment", deltadelta: "Assignment") -> "bool":
    r""" Internal methods."""
    return _pywrapcp.OptimizeVar_AcceptDelta(self, delta, deltadelta)

Best

def Best(self)

Returns the best value found during search.

Expand source code
def Best(self) -> "int64":
    r""" Returns the best value found during search."""
    return _pywrapcp.OptimizeVar_Best(self)

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.OptimizeVar_DebugString(self)

Var

def Var(self)

Returns the variable that is optimized.

Expand source code
def Var(self) -> "operations_research::IntVar *":
    r""" Returns the variable that is optimized."""
    return _pywrapcp.OptimizeVar_Var(self)
Inherited members

Pack

class Pack (*args, **kwargs)

A constraint is the main modeling object. It provides two methods: - Post() is responsible for creating the demons and attaching them to immediate demons(). - InitialPropagate() is called once just after Post and performs the initial propagation. The subsequent propagations will be performed by the demons Posted during the post() method.

Expand source code
class Pack(Constraint):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def AddWeightedSumLessOrEqualConstantDimension(self, *args) -> "void":
        r"""
        *Overload 1:*
        Dimensions are additional constraints than can restrict what is possible with the pack constraint. It can be used to set capacity limits, to count objects per bin, to compute unassigned penalties... This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is less or equal 'bounds[b]'.

        |

        *Overload 2:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i)) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.

        |

        *Overload 3:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.
        """
        return _pywrapcp.Pack_AddWeightedSumLessOrEqualConstantDimension(self, *args)

    def AddWeightedSumEqualVarDimension(self, *args) -> "void":
        r"""
        *Overload 1:*
        This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].

        |

        *Overload 2:*
        This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b)) of all objects i assigned to 'b' is equal to loads[b].
        """
        return _pywrapcp.Pack_AddWeightedSumEqualVarDimension(self, *args)

    def AddSumVariableWeightsLessOrEqualConstantDimension(self, usage: "std::vector< operations_research::IntVar * > const &", capacity: "std::vector< int64 > const &") -> "void":
        r""" This dimension imposes: forall b in bins,    sum (i in items: usage[i] * is_assigned(i, b)) <= capacity[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b. This can be used to model shapes of items by linking variables of the same item on parallel dimensions with an allowed assignment constraint."""
        return _pywrapcp.Pack_AddSumVariableWeightsLessOrEqualConstantDimension(self, usage, capacity)

    def AddWeightedSumOfAssignedDimension(self, weights: "std::vector< int64 > const &", cost_var: "IntVar") -> "void":
        r""" This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin."""
        return _pywrapcp.Pack_AddWeightedSumOfAssignedDimension(self, weights, cost_var)

    def AddCountUsedBinDimension(self, count_var: "IntVar") -> "void":
        r""" This dimension links 'count_var' to the actual number of bins used in the pack."""
        return _pywrapcp.Pack_AddCountUsedBinDimension(self, count_var)

    def AddCountAssignedItemsDimension(self, count_var: "IntVar") -> "void":
        r""" This dimension links 'count_var' to the actual number of items assigned to a bin in the pack."""
        return _pywrapcp.Pack_AddCountAssignedItemsDimension(self, count_var)

    def Post(self) -> "void":
        return _pywrapcp.Pack_Post(self)

    def InitialPropagateWrapper(self) -> "void":
        return _pywrapcp.Pack_InitialPropagateWrapper(self)

    def DebugString(self) -> "std::string":
        return _pywrapcp.Pack_DebugString(self)
Ancestors
Methods

AddCountAssignedItemsDimension

def AddCountAssignedItemsDimension(self, count_var)

This dimension links 'count_var' to the actual number of items assigned to a bin in the pack.

Expand source code
def AddCountAssignedItemsDimension(self, count_var: "IntVar") -> "void":
    r""" This dimension links 'count_var' to the actual number of items assigned to a bin in the pack."""
    return _pywrapcp.Pack_AddCountAssignedItemsDimension(self, count_var)

AddCountUsedBinDimension

def AddCountUsedBinDimension(self, count_var)

This dimension links 'count_var' to the actual number of bins used in the pack.

Expand source code
def AddCountUsedBinDimension(self, count_var: "IntVar") -> "void":
    r""" This dimension links 'count_var' to the actual number of bins used in the pack."""
    return _pywrapcp.Pack_AddCountUsedBinDimension(self, count_var)

AddSumVariableWeightsLessOrEqualConstantDimension

def AddSumVariableWeightsLessOrEqualConstantDimension(self, usage, capacity)

This dimension imposes: forall b in bins, sum (i in items: usage[i] * is_assigned(i, b)) <= capacity[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b. This can be used to model shapes of items by linking variables of the same item on parallel dimensions with an allowed assignment constraint.

Expand source code
def AddSumVariableWeightsLessOrEqualConstantDimension(self, usage: "std::vector< operations_research::IntVar * > const &", capacity: "std::vector< int64 > const &") -> "void":
    r""" This dimension imposes: forall b in bins,    sum (i in items: usage[i] * is_assigned(i, b)) <= capacity[b] where is_assigned(i, b) is true if and only if item i is assigned to the bin b. This can be used to model shapes of items by linking variables of the same item on parallel dimensions with an allowed assignment constraint."""
    return _pywrapcp.Pack_AddSumVariableWeightsLessOrEqualConstantDimension(self, usage, capacity)

AddWeightedSumEqualVarDimension

def AddWeightedSumEqualVarDimension(self, *args)

Overload 1: This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].

|

Overload 2: This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b)) of all objects i assigned to 'b' is equal to loads[b].

Expand source code
def AddWeightedSumEqualVarDimension(self, *args) -> "void":
    r"""
    *Overload 1:*
    This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is equal to loads[b].

    |

    *Overload 2:*
    This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b)) of all objects i assigned to 'b' is equal to loads[b].
    """
    return _pywrapcp.Pack_AddWeightedSumEqualVarDimension(self, *args)

AddWeightedSumLessOrEqualConstantDimension

def AddWeightedSumLessOrEqualConstantDimension(self, *args)

Overload 1: Dimensions are additional constraints than can restrict what is possible with the pack constraint. It can be used to set capacity limits, to count objects per bin, to compute unassigned penalties… This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is less or equal 'bounds[b]'.

|

Overload 2: This dimension imposes that for all bins b, the weighted sum (weights->Run(i)) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.

|

Overload 3: This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.

Expand source code
def AddWeightedSumLessOrEqualConstantDimension(self, *args) -> "void":
    r"""
    *Overload 1:*
    Dimensions are additional constraints than can restrict what is possible with the pack constraint. It can be used to set capacity limits, to count objects per bin, to compute unassigned penalties... This dimension imposes that for all bins b, the weighted sum (weights[i]) of all objects i assigned to 'b' is less or equal 'bounds[b]'.

    |

    *Overload 2:*
    This dimension imposes that for all bins b, the weighted sum (weights->Run(i)) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.

    |

    *Overload 3:*
    This dimension imposes that for all bins b, the weighted sum (weights->Run(i, b) of all objects i assigned to 'b' is less or equal to 'bounds[b]'. Ownership of the callback is transferred to the pack constraint.
    """
    return _pywrapcp.Pack_AddWeightedSumLessOrEqualConstantDimension(self, *args)

AddWeightedSumOfAssignedDimension

def AddWeightedSumOfAssignedDimension(self, weights, cost_var)

This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin.

Expand source code
def AddWeightedSumOfAssignedDimension(self, weights: "std::vector< int64 > const &", cost_var: "IntVar") -> "void":
    r""" This dimension enforces that cost_var == sum of weights[i] for all objects 'i' assigned to a bin."""
    return _pywrapcp.Pack_AddWeightedSumOfAssignedDimension(self, weights, cost_var)

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.Pack_DebugString(self)
Inherited members

ParallelSavingsFilteredDecisionBuilder

class ParallelSavingsFilteredDecisionBuilder (*args, **kwargs)

Filter-based decision builder which builds a solution by using Clarke & Wright's Savings heuristic. For each pair of nodes, the savings value is the difference between the cost of two routes visiting one node each and one route visiting both nodes. Routes are built sequentially, each route being initialized from the pair with the best avalaible savings value then extended by selecting the nodes with best savings on both ends of the partial route. Cost is based on the arc cost function of the routing model and cost classes are taken into account.

Expand source code
class ParallelSavingsFilteredDecisionBuilder(SavingsFilteredDecisionBuilder):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_ParallelSavingsFilteredDecisionBuilder

    def DebugString(self) -> "std::string":
        return _pywrapcp.ParallelSavingsFilteredDecisionBuilder_DebugString(self)
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.ParallelSavingsFilteredDecisionBuilder_DebugString(self)
Inherited members

PathOperator

class PathOperator (*args, **kwargs)

Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a neighbor; this class provides the iteration on a given number of (base) nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments).

Expand source code
class PathOperator(IntVarLocalSearchOperator):
    r""" Base class of the local search operators dedicated to path modifications (a path is a set of nodes linked together by arcs). This family of neighborhoods supposes they are handling next variables representing the arcs (var[i] represents the node immediately after i on a path). Several services are provided: - arc manipulators (SetNext(), ReverseChain(), MoveChain()) - path inspectors (Next(), IsPathEnd()) - path iterators: operators need a given number of nodes to define a   neighbor; this class provides the iteration on a given number of (base)   nodes which can be used to define a neighbor (through the BaseNode method) Subclasses only need to override MakeNeighbor to create neighbors using the services above (no direct manipulation of assignments)."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr

    def Neighbor(self) -> "bool":
        return _pywrapcp.PathOperator_Neighbor(self)
Ancestors
Methods

Neighbor

def Neighbor(self)
Expand source code
def Neighbor(self) -> "bool":
    return _pywrapcp.PathOperator_Neighbor(self)
Inherited members

PropagationBaseObject

class PropagationBaseObject (s)

NOLINT The PropagationBaseObject is a subclass of BaseObject that is also friend to the Solver class. It allows accessing methods useful when writing new constraints or new expressions.

Expand source code
class PropagationBaseObject(BaseObject):
    r""" NOLINT The PropagationBaseObject is a subclass of BaseObject that is also friend to the Solver class. It allows accessing methods useful when writing new constraints or new expressions."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, s: "Solver"):
        if self.__class__ == PropagationBaseObject:
            _self = None
        else:
            _self = self
        _pywrapcp.PropagationBaseObject_swiginit(self, _pywrapcp.new_PropagationBaseObject(_self, s))
    __swig_destroy__ = _pywrapcp.delete_PropagationBaseObject

    def DebugString(self) -> "std::string":
        return _pywrapcp.PropagationBaseObject_DebugString(self)

    def solver(self) -> "operations_research::Solver *":
        return _pywrapcp.PropagationBaseObject_solver(self)

    def Name(self) -> "std::string":
        r""" Object naming."""
        return _pywrapcp.PropagationBaseObject_Name(self)
    def __disown__(self):
        self.this.disown()
        _pywrapcp.disown_PropagationBaseObject(self)
        return weakref.proxy(self)
Ancestors
Subclasses
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self) -> "std::string":
    return _pywrapcp.PropagationBaseObject_DebugString(self)

Name

def Name(self)

Object naming.

Expand source code
def Name(self) -> "std::string":
    r""" Object naming."""
    return _pywrapcp.PropagationBaseObject_Name(self)

solver

def solver(self)
Expand source code
def solver(self) -> "operations_research::Solver *":
    return _pywrapcp.PropagationBaseObject_solver(self)
Inherited members

PyConstraint

class PyConstraint (solver)

A constraint is the main modeling object. It provides two methods: - Post() is responsible for creating the demons and attaching them to immediate demons(). - InitialPropagate() is called once just after Post and performs the initial propagation. The subsequent propagations will be performed by the demons Posted during the post() method.

Expand source code
class PyConstraint(Constraint):

  def __init__(self, solver):
    Constraint.__init__(self, solver)
    self.__demons = []

  def Demon(self, method, *args):
    demon = PyConstraintDemon(self, method, False, *args)
    self.__demons.append(demon)
    return demon

  def DelayedDemon(self, method, *args):
    demon = PyConstraintDemon(self, method, True, *args)
    self.__demons.append(demon)
    return demon

  def InitialPropagateDemon(self):
    return self.solver().ConstraintInitialPropagateCallback(self)

  def DelayedInitialPropagateDemon(self):
    return self.solver().DelayedConstraintInitialPropagateCallback(self)

  def InitialPropagateWrapper(self):
    try:
      self.InitialPropagate()
    except Exception as e:
      if 'CP Solver fail' in str(e):
        self.solver().ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyConstraint"
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self):
  return "PyConstraint"

DelayedDemon

def DelayedDemon(self, method, *args)
Expand source code
def DelayedDemon(self, method, *args):
  demon = PyConstraintDemon(self, method, True, *args)
  self.__demons.append(demon)
  return demon

DelayedInitialPropagateDemon

def DelayedInitialPropagateDemon(self)
Expand source code
def DelayedInitialPropagateDemon(self):
  return self.solver().DelayedConstraintInitialPropagateCallback(self)

Demon

def Demon(self, method, *args)
Expand source code
def Demon(self, method, *args):
  demon = PyConstraintDemon(self, method, False, *args)
  self.__demons.append(demon)
  return demon

InitialPropagateDemon

def InitialPropagateDemon(self)
Expand source code
def InitialPropagateDemon(self):
  return self.solver().ConstraintInitialPropagateCallback(self)
Inherited members

PyConstraintDemon

class PyConstraintDemon (ct, method, delayed, *args)

A Demon is the base element of a propagation queue. It is the main object responsible for implementing the actual propagation of the constraint and pruning the inconsistent values in the domains of the variables. The main concept is that demons are listeners that are attached to the variables and listen to their modifications. There are two methods: - Run() is the actual method called when the demon is processed. - priority() returns its priority. Standard priorities are slow, normal or fast. "immediate" is reserved for variables and is treated separately.

This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables.

Expand source code
class PyConstraintDemon(PyDemon):

  def __init__(self, ct, method, delayed, *args):
    PyDemon.__init__(self)
    self.__constraint = ct
    self.__method = method
    self.__delayed = delayed
    self.__args = args

  def Run(self, solver):
    self.__method(self.__constraint, *self.__args)

  def Priority(self):
    return Solver.DELAYED_PRIORITY if self.__delayed else Solver.NORMAL_PRIORITY

  def DebugString(self):
    return 'PyConstraintDemon'
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self):
  return 'PyConstraintDemon'

Run

def Run(self, solver)
Expand source code
def Run(self, solver):
  self.__method(self.__constraint, *self.__args)
Inherited members

PyDecision

class PyDecision

A Decision represents a choice point in the search tree. The two main methods are Apply() to go left, or Refute() to go right.

Expand source code
class PyDecision(Decision):

  def __init__(self):
    Decision.__init__(self)

  def ApplyWrapper(self, solver):
    try:
       self.Apply(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def RefuteWrapper(self, solver):
    try:
       self.Refute(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyDecision"
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self):
  return "PyDecision"
Inherited members

PyDecisionBuilder

class PyDecisionBuilder

A DecisionBuilder is responsible for creating the search tree. The important method is Next(), which returns the next decision to execute.

Expand source code
class PyDecisionBuilder(DecisionBuilder):

  def __init__(self):
    DecisionBuilder.__init__(self)

  def NextWrapper(self, solver):
    try:
      return self.Next(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        return solver.FailDecision()
      else:
        raise

  def DebugString(self):
    return "PyDecisionBuilder"
Ancestors
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self):
  return "PyDecisionBuilder"
Inherited members

PyDemon

class PyDemon

A Demon is the base element of a propagation queue. It is the main object responsible for implementing the actual propagation of the constraint and pruning the inconsistent values in the domains of the variables. The main concept is that demons are listeners that are attached to the variables and listen to their modifications. There are two methods: - Run() is the actual method called when the demon is processed. - priority() returns its priority. Standard priorities are slow, normal or fast. "immediate" is reserved for variables and is treated separately.

This indicates the priority of a demon. Immediate demons are treated separately and corresponds to variables.

Expand source code
class PyDemon(Demon):

  def RunWrapper(self, solver):
    try:
      self.Run(solver)
    except Exception as e:
      if 'CP Solver fail' in str(e):
        solver.ShouldFail()
      else:
        raise

  def DebugString(self):
    return "PyDemon"
Ancestors
Subclasses
Methods

DebugString

def DebugString(self)
Expand source code
def DebugString(self):
  return "PyDemon"
Inherited members

RevBool

class RevBool (val)

This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree. Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue.

Expand source code
class RevBool(object):
    r""" This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree.  Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "bool const &"):
        _pywrapcp.RevBool_swiginit(self, _pywrapcp.new_RevBool(val))

    def Value(self) -> "bool const &":
        return _pywrapcp.RevBool_Value(self)

    def SetValue(self, s: "Solver", val: "bool const &") -> "void":
        return _pywrapcp.RevBool_SetValue(self, s, val)
    __swig_destroy__ = _pywrapcp.delete_RevBool
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

SetValue

def SetValue(self, s, val)
Expand source code
def SetValue(self, s: "Solver", val: "bool const &") -> "void":
    return _pywrapcp.RevBool_SetValue(self, s, val)

Value

def Value(self)
Expand source code
def Value(self) -> "bool const &":
    return _pywrapcp.RevBool_Value(self)

RevInteger

class RevInteger (val)

This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree. Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue.

Expand source code
class RevInteger(object):
    r""" This class adds reversibility to a POD type. It contains the stamp optimization. i.e. the SaveValue call is done only once per node of the search tree.  Please note that actual stamps always starts at 1, thus an initial value of 0 will always trigger the first SaveValue."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, val: "long long const &"):
        _pywrapcp.RevInteger_swiginit(self, _pywrapcp.new_RevInteger(val))

    def Value(self) -> "long long const &":
        return _pywrapcp.RevInteger_Value(self)

    def SetValue(self, s: "Solver", val: "long long const &") -> "void":
        return _pywrapcp.RevInteger_SetValue(self, s, val)
    __swig_destroy__ = _pywrapcp.delete_RevInteger
Subclasses
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

SetValue

def SetValue(self, s, val)
Expand source code
def SetValue(self, s: "Solver", val: "long long const &") -> "void":
    return _pywrapcp.RevInteger_SetValue(self, s, val)

Value

def Value(self)
Expand source code
def Value(self) -> "long long const &":
    return _pywrapcp.RevInteger_Value(self)

RoutingDimension

class RoutingDimension (*args, **kwargs)

Dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumuls(j) = cumuls(i) + transits(i) + slacks(i) + state_dependent_transits(i) where slack is a positive slack variable (can represent waiting times for a time dimension), and state_dependent_transits is a non-purely functional version of transits_. Favour transits over state_dependent_transits when possible, because purely functional callbacks allow more optimisations and make the model faster and easier to solve. for a given vehicle, it is passed as an external vector, it would be better to have this information here.

Expand source code
class RoutingDimension(object):
    r""" Dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumuls(j) = cumuls(i) + transits(i) + slacks(i) +             state_dependent_transits(i) where slack is a positive slack variable (can represent waiting times for a time dimension), and state_dependent_transits is a non-purely functional version of transits_. Favour transits over state_dependent_transits when possible, because purely functional callbacks allow more optimisations and make the model faster and easier to solve. for a given vehicle, it is passed as an external vector, it would be better to have this information here."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_RoutingDimension

    def model(self) -> "operations_research::RoutingModel *":
        r""" Returns the model on which the dimension was created."""
        return _pywrapcp.RoutingDimension_model(self)

    def GetTransitValue(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
        r""" Returns the transition value for a given pair of nodes (as var index); this value is the one taken by the corresponding transit variable when the 'next' variable for 'from_index' is bound to 'to_index'."""
        return _pywrapcp.RoutingDimension_GetTransitValue(self, from_index, to_index, vehicle)

    def GetTransitValueFromClass(self, from_index: "int64", to_index: "int64", vehicle_class: "int64") -> "int64":
        r""" Same as above but taking a vehicle class of the dimension instead of a vehicle (the class of a vehicle can be obtained with vehicle_to_class())."""
        return _pywrapcp.RoutingDimension_GetTransitValueFromClass(self, from_index, to_index, vehicle_class)

    def CumulVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Get the cumul, transit and slack variables for the given node (given as int64 var index)."""
        return _pywrapcp.RoutingDimension_CumulVar(self, index)

    def TransitVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_TransitVar(self, index)

    def FixedTransitVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_FixedTransitVar(self, index)

    def SlackVar(self, index: "int64") -> "operations_research::IntVar *":
        return _pywrapcp.RoutingDimension_SlackVar(self, index)

    def SetSpanUpperBoundForVehicle(self, upper_bound: "int64", vehicle: "int") -> "void":
        r""" Sets an upper bound on the dimension span on a given vehicle. This is the preferred way to limit the "length" of the route of a vehicle according to a dimension."""
        return _pywrapcp.RoutingDimension_SetSpanUpperBoundForVehicle(self, upper_bound, vehicle)

    def SetSpanCostCoefficientForVehicle(self, coefficient: "int64", vehicle: "int") -> "void":
        r""" Sets a cost proportional to the dimension span on a given vehicle, or on all vehicles at once. "coefficient" must be nonnegative. This is handy to model costs proportional to idle time when the dimension represents time. The cost for a vehicle is   span_cost = coefficient * (dimension end value - dimension start value)."""
        return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForVehicle(self, coefficient, vehicle)

    def SetSpanCostCoefficientForAllVehicles(self, coefficient: "int64") -> "void":
        return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForAllVehicles(self, coefficient)

    def SetGlobalSpanCostCoefficient(self, coefficient: "int64") -> "void":
        r""" Sets a cost proportional to the *global* dimension span, that is the difference between the largest value of route end cumul variables and the smallest value of route start cumul variables. In other words: global_span_cost =   coefficient * (Max(dimension end value) - Min(dimension start value))."""
        return _pywrapcp.RoutingDimension_SetGlobalSpanCostCoefficient(self, coefficient)

    def SetCumulVarSoftUpperBound(self, index: "int64", upper_bound: "int64", coefficient: "int64") -> "void":
        r""" Sets a soft upper bound to the cumul variable of a given variable index. If the value of the cumul variable is greater than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar <= upper_bound -> cost = 0    cumulVar > upper_bound -> cost = coefficient * (cumulVar - upper_bound) This is also handy to model tardiness costs when the dimension represents time."""
        return _pywrapcp.RoutingDimension_SetCumulVarSoftUpperBound(self, index, upper_bound, coefficient)

    def HasCumulVarSoftUpperBound(self, index: "int64") -> "bool":
        r""" Returns true if a soft upper bound has been set for a given variable index."""
        return _pywrapcp.RoutingDimension_HasCumulVarSoftUpperBound(self, index)

    def GetCumulVarSoftUpperBound(self, index: "int64") -> "int64":
        r""" Returns the soft upper bound of a cumul variable for a given variable index. The "hard" upper bound of the variable is returned if no soft upper bound has been set."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBound(self, index)

    def GetCumulVarSoftUpperBoundCoefficient(self, index: "int64") -> "int64":
        r""" Returns the cost coefficient of the soft upper bound of a cumul variable for a given variable index. If no soft upper bound has been set, 0 is returned."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBoundCoefficient(self, index)

    def SetCumulVarSoftLowerBound(self, index: "int64", lower_bound: "int64", coefficient: "int64") -> "void":
        r""" Sets a soft lower bound to the cumul variable of a given variable index. If the value of the cumul variable is less than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar > lower_bound -> cost = 0   cumulVar <= lower_bound -> cost = coefficient * (lower_bound -               cumulVar). This is also handy to model earliness costs when the dimension represents time. Note: Using soft lower and upper bounds or span costs together is, as of 6/2014, not well supported in the sense that an optimal schedule is not guaranteed."""
        return _pywrapcp.RoutingDimension_SetCumulVarSoftLowerBound(self, index, lower_bound, coefficient)

    def HasCumulVarSoftLowerBound(self, index: "int64") -> "bool":
        r""" Returns true if a soft lower bound has been set for a given variable index."""
        return _pywrapcp.RoutingDimension_HasCumulVarSoftLowerBound(self, index)

    def GetCumulVarSoftLowerBound(self, index: "int64") -> "int64":
        r""" Returns the soft lower bound of a cumul variable for a given variable index. The "hard" lower bound of the variable is returned if no soft lower bound has been set."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBound(self, index)

    def GetCumulVarSoftLowerBoundCoefficient(self, index: "int64") -> "int64":
        r""" Returns the cost coefficient of the soft lower bound of a cumul variable for a given variable index. If no soft lower bound has been set, 0 is returned."""
        return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBoundCoefficient(self, index)

    def SetBreakIntervalsOfVehicle(self, breaks: "std::vector< operations_research::IntervalVar * >", vehicle: "int", node_visit_transits: "std::vector< int64 >") -> "void":
        r""" Sets the breaks for a given vehicle. Breaks are represented by IntervalVars. They may interrupt transits between nodes and increase the value of corresponding slack variables. A break may take place before the start of a vehicle, after the end of a vehicle, or during a travel i -> j. In that case, the interval [break.Start(), break.End()) must be a subset of [CumulVar(i) + pre_travel(i, j), CumulVar(j) - post_travel(i, j)). In other words, a break may not overlap any node n's visit, given by [CumulVar(n) - post_travel(_, n), CumulVar(n) + pre_travel(n, _)). This formula considers post_travel(_, start) and pre_travel(end, _) to be 0; pre_travel will never be called on any (_, start) and post_travel will never we called on any (end, _). If pre_travel_evaluator or post_travel_evaluator is -1, it will be taken as a function that always returns 0. Deprecated, sets pre_travel(i, j) = node_visit_transit[i]."""
        return _pywrapcp.RoutingDimension_SetBreakIntervalsOfVehicle(self, breaks, vehicle, node_visit_transits)

    def SetBreakDistanceDurationOfVehicle(self, distance: "int64", duration: "int64", vehicle: "int") -> "void":
        r""" With breaks supposed to be consecutive, this forces the distance between breaks of size at least minimum_break_duration to be at least distance. This supposes that the time until route start and after route end are infinite breaks."""
        return _pywrapcp.RoutingDimension_SetBreakDistanceDurationOfVehicle(self, distance, duration, vehicle)

    def InitializeBreaks(self) -> "void":
        r""" Sets up vehicle_break_intervals_, vehicle_break_distance_duration_, pre_travel_evaluators and post_travel_evaluators."""
        return _pywrapcp.RoutingDimension_InitializeBreaks(self)

    def HasBreakConstraints(self) -> "bool":
        r""" Returns true if any break interval or break distance was defined."""
        return _pywrapcp.RoutingDimension_HasBreakConstraints(self)

    def GetPreTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
        return _pywrapcp.RoutingDimension_GetPreTravelEvaluatorOfVehicle(self, vehicle)

    def GetPostTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
        return _pywrapcp.RoutingDimension_GetPostTravelEvaluatorOfVehicle(self, vehicle)

    def base_dimension(self) -> "operations_research::RoutingDimension const *":
        r""" Returns the parent in the dependency tree if any or nullptr otherwise."""
        return _pywrapcp.RoutingDimension_base_dimension(self)

    def ShortestTransitionSlack(self, node: "int64") -> "int64":
        r""" It makes sense to use the function only for self-dependent dimension. For such dimensions the value of the slack of a node determines the transition cost of the next transit. Provided that   1. cumul[node] is fixed,   2. next[node] and next[next[node]] (if exists) are fixed, the value of slack[node] for which cumul[next[node]] + transit[next[node]] is minimized can be found in O(1) using this function."""
        return _pywrapcp.RoutingDimension_ShortestTransitionSlack(self, node)

    def name(self) -> "std::string const &":
        r""" Returns the name of the dimension."""
        return _pywrapcp.RoutingDimension_name(self)

    def SetPickupToDeliveryLimitFunctionForPair(self, limit_function: "operations_research::RoutingDimension::PickupToDeliveryLimitFunction", pair_index: "int") -> "void":
        return _pywrapcp.RoutingDimension_SetPickupToDeliveryLimitFunctionForPair(self, limit_function, pair_index)

    def HasPickupToDeliveryLimits(self) -> "bool":
        return _pywrapcp.RoutingDimension_HasPickupToDeliveryLimits(self)

    def AddNodePrecedence(self, first_node: "int64", second_node: "int64", offset: "int64") -> "void":
        return _pywrapcp.RoutingDimension_AddNodePrecedence(self, first_node, second_node, offset)

    def GetSpanUpperBoundForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetSpanUpperBoundForVehicle(self, vehicle)

    def GetSpanCostCoefficientForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetSpanCostCoefficientForVehicle(self, vehicle)

    def global_span_cost_coefficient(self) -> "int64":
        return _pywrapcp.RoutingDimension_global_span_cost_coefficient(self)

    def GetGlobalOptimizerOffset(self) -> "int64":
        return _pywrapcp.RoutingDimension_GetGlobalOptimizerOffset(self)

    def GetLocalOptimizerOffsetForVehicle(self, vehicle: "int") -> "int64":
        return _pywrapcp.RoutingDimension_GetLocalOptimizerOffsetForVehicle(self, vehicle)
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

AddNodePrecedence

def AddNodePrecedence(self, first_node, second_node, offset)
Expand source code
def AddNodePrecedence(self, first_node: "int64", second_node: "int64", offset: "int64") -> "void":
    return _pywrapcp.RoutingDimension_AddNodePrecedence(self, first_node, second_node, offset)

CumulVar

def CumulVar(self, index)

Get the cumul, transit and slack variables for the given node (given as int64 var index).

Expand source code
def CumulVar(self, index: "int64") -> "operations_research::IntVar *":
    r""" Get the cumul, transit and slack variables for the given node (given as int64 var index)."""
    return _pywrapcp.RoutingDimension_CumulVar(self, index)

FixedTransitVar

def FixedTransitVar(self, index)
Expand source code
def FixedTransitVar(self, index: "int64") -> "operations_research::IntVar *":
    return _pywrapcp.RoutingDimension_FixedTransitVar(self, index)

GetCumulVarSoftLowerBound

def GetCumulVarSoftLowerBound(self, index)

Returns the soft lower bound of a cumul variable for a given variable index. The "hard" lower bound of the variable is returned if no soft lower bound has been set.

Expand source code
def GetCumulVarSoftLowerBound(self, index: "int64") -> "int64":
    r""" Returns the soft lower bound of a cumul variable for a given variable index. The "hard" lower bound of the variable is returned if no soft lower bound has been set."""
    return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBound(self, index)

GetCumulVarSoftLowerBoundCoefficient

def GetCumulVarSoftLowerBoundCoefficient(self, index)

Returns the cost coefficient of the soft lower bound of a cumul variable for a given variable index. If no soft lower bound has been set, 0 is returned.

Expand source code
def GetCumulVarSoftLowerBoundCoefficient(self, index: "int64") -> "int64":
    r""" Returns the cost coefficient of the soft lower bound of a cumul variable for a given variable index. If no soft lower bound has been set, 0 is returned."""
    return _pywrapcp.RoutingDimension_GetCumulVarSoftLowerBoundCoefficient(self, index)

GetCumulVarSoftUpperBound

def GetCumulVarSoftUpperBound(self, index)

Returns the soft upper bound of a cumul variable for a given variable index. The "hard" upper bound of the variable is returned if no soft upper bound has been set.

Expand source code
def GetCumulVarSoftUpperBound(self, index: "int64") -> "int64":
    r""" Returns the soft upper bound of a cumul variable for a given variable index. The "hard" upper bound of the variable is returned if no soft upper bound has been set."""
    return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBound(self, index)

GetCumulVarSoftUpperBoundCoefficient

def GetCumulVarSoftUpperBoundCoefficient(self, index)

Returns the cost coefficient of the soft upper bound of a cumul variable for a given variable index. If no soft upper bound has been set, 0 is returned.

Expand source code
def GetCumulVarSoftUpperBoundCoefficient(self, index: "int64") -> "int64":
    r""" Returns the cost coefficient of the soft upper bound of a cumul variable for a given variable index. If no soft upper bound has been set, 0 is returned."""
    return _pywrapcp.RoutingDimension_GetCumulVarSoftUpperBoundCoefficient(self, index)

GetGlobalOptimizerOffset

def GetGlobalOptimizerOffset(self)
Expand source code
def GetGlobalOptimizerOffset(self) -> "int64":
    return _pywrapcp.RoutingDimension_GetGlobalOptimizerOffset(self)

GetLocalOptimizerOffsetForVehicle

def GetLocalOptimizerOffsetForVehicle(self, vehicle)
Expand source code
def GetLocalOptimizerOffsetForVehicle(self, vehicle: "int") -> "int64":
    return _pywrapcp.RoutingDimension_GetLocalOptimizerOffsetForVehicle(self, vehicle)

GetPostTravelEvaluatorOfVehicle

def GetPostTravelEvaluatorOfVehicle(self, vehicle)
Expand source code
def GetPostTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
    return _pywrapcp.RoutingDimension_GetPostTravelEvaluatorOfVehicle(self, vehicle)

GetPreTravelEvaluatorOfVehicle

def GetPreTravelEvaluatorOfVehicle(self, vehicle)
Expand source code
def GetPreTravelEvaluatorOfVehicle(self, vehicle: "int") -> "int":
    return _pywrapcp.RoutingDimension_GetPreTravelEvaluatorOfVehicle(self, vehicle)

GetSpanCostCoefficientForVehicle

def GetSpanCostCoefficientForVehicle(self, vehicle)
Expand source code
def GetSpanCostCoefficientForVehicle(self, vehicle: "int") -> "int64":
    return _pywrapcp.RoutingDimension_GetSpanCostCoefficientForVehicle(self, vehicle)

GetSpanUpperBoundForVehicle

def GetSpanUpperBoundForVehicle(self, vehicle)
Expand source code
def GetSpanUpperBoundForVehicle(self, vehicle: "int") -> "int64":
    return _pywrapcp.RoutingDimension_GetSpanUpperBoundForVehicle(self, vehicle)

GetTransitValue

def GetTransitValue(self, from_index, to_index, vehicle)

Returns the transition value for a given pair of nodes (as var index); this value is the one taken by the corresponding transit variable when the 'next' variable for 'from_index' is bound to 'to_index'.

Expand source code
def GetTransitValue(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
    r""" Returns the transition value for a given pair of nodes (as var index); this value is the one taken by the corresponding transit variable when the 'next' variable for 'from_index' is bound to 'to_index'."""
    return _pywrapcp.RoutingDimension_GetTransitValue(self, from_index, to_index, vehicle)

GetTransitValueFromClass

def GetTransitValueFromClass(self, from_index, to_index, vehicle_class)

Same as above but taking a vehicle class of the dimension instead of a vehicle (the class of a vehicle can be obtained with vehicle_to_class()).

Expand source code
def GetTransitValueFromClass(self, from_index: "int64", to_index: "int64", vehicle_class: "int64") -> "int64":
    r""" Same as above but taking a vehicle class of the dimension instead of a vehicle (the class of a vehicle can be obtained with vehicle_to_class())."""
    return _pywrapcp.RoutingDimension_GetTransitValueFromClass(self, from_index, to_index, vehicle_class)

HasBreakConstraints

def HasBreakConstraints(self)

Returns true if any break interval or break distance was defined.

Expand source code
def HasBreakConstraints(self) -> "bool":
    r""" Returns true if any break interval or break distance was defined."""
    return _pywrapcp.RoutingDimension_HasBreakConstraints(self)

HasCumulVarSoftLowerBound

def HasCumulVarSoftLowerBound(self, index)

Returns true if a soft lower bound has been set for a given variable index.

Expand source code
def HasCumulVarSoftLowerBound(self, index: "int64") -> "bool":
    r""" Returns true if a soft lower bound has been set for a given variable index."""
    return _pywrapcp.RoutingDimension_HasCumulVarSoftLowerBound(self, index)

HasCumulVarSoftUpperBound

def HasCumulVarSoftUpperBound(self, index)

Returns true if a soft upper bound has been set for a given variable index.

Expand source code
def HasCumulVarSoftUpperBound(self, index: "int64") -> "bool":
    r""" Returns true if a soft upper bound has been set for a given variable index."""
    return _pywrapcp.RoutingDimension_HasCumulVarSoftUpperBound(self, index)

HasPickupToDeliveryLimits

def HasPickupToDeliveryLimits(self)
Expand source code
def HasPickupToDeliveryLimits(self) -> "bool":
    return _pywrapcp.RoutingDimension_HasPickupToDeliveryLimits(self)

InitializeBreaks

def InitializeBreaks(self)

Sets up vehicle_break_intervals_, vehicle_break_distance_duration_, pre_travel_evaluators and post_travel_evaluators.

Expand source code
def InitializeBreaks(self) -> "void":
    r""" Sets up vehicle_break_intervals_, vehicle_break_distance_duration_, pre_travel_evaluators and post_travel_evaluators."""
    return _pywrapcp.RoutingDimension_InitializeBreaks(self)

SetBreakDistanceDurationOfVehicle

def SetBreakDistanceDurationOfVehicle(self, distance, duration, vehicle)

With breaks supposed to be consecutive, this forces the distance between breaks of size at least minimum_break_duration to be at least distance. This supposes that the time until route start and after route end are infinite breaks.

Expand source code
def SetBreakDistanceDurationOfVehicle(self, distance: "int64", duration: "int64", vehicle: "int") -> "void":
    r""" With breaks supposed to be consecutive, this forces the distance between breaks of size at least minimum_break_duration to be at least distance. This supposes that the time until route start and after route end are infinite breaks."""
    return _pywrapcp.RoutingDimension_SetBreakDistanceDurationOfVehicle(self, distance, duration, vehicle)

SetBreakIntervalsOfVehicle

def SetBreakIntervalsOfVehicle(self, breaks, vehicle, node_visit_transits)

Sets the breaks for a given vehicle. Breaks are represented by IntervalVars. They may interrupt transits between nodes and increase the value of corresponding slack variables. A break may take place before the start of a vehicle, after the end of a vehicle, or during a travel i -> j. In that case, the interval [break.Start(), break.End()) must be a subset of [CumulVar(i) + pre_travel(i, j), CumulVar(j) - post_travel(i, j)). In other words, a break may not overlap any node n's visit, given by [CumulVar(n) - post_travel(, n), CumulVar(n) + pre_travel(n, )). This formula considers post_travel(, start) and pre_travel(end, ) to be 0; pre_travel will never be called on any (, start) and post_travel will never we called on any (end, ). If pre_travel_evaluator or post_travel_evaluator is -1, it will be taken as a function that always returns 0. Deprecated, sets pre_travel(i, j) = node_visit_transit[i].

Expand source code
def SetBreakIntervalsOfVehicle(self, breaks: "std::vector< operations_research::IntervalVar * >", vehicle: "int", node_visit_transits: "std::vector< int64 >") -> "void":
    r""" Sets the breaks for a given vehicle. Breaks are represented by IntervalVars. They may interrupt transits between nodes and increase the value of corresponding slack variables. A break may take place before the start of a vehicle, after the end of a vehicle, or during a travel i -> j. In that case, the interval [break.Start(), break.End()) must be a subset of [CumulVar(i) + pre_travel(i, j), CumulVar(j) - post_travel(i, j)). In other words, a break may not overlap any node n's visit, given by [CumulVar(n) - post_travel(_, n), CumulVar(n) + pre_travel(n, _)). This formula considers post_travel(_, start) and pre_travel(end, _) to be 0; pre_travel will never be called on any (_, start) and post_travel will never we called on any (end, _). If pre_travel_evaluator or post_travel_evaluator is -1, it will be taken as a function that always returns 0. Deprecated, sets pre_travel(i, j) = node_visit_transit[i]."""
    return _pywrapcp.RoutingDimension_SetBreakIntervalsOfVehicle(self, breaks, vehicle, node_visit_transits)

SetCumulVarSoftLowerBound

def SetCumulVarSoftLowerBound(self, index, lower_bound, coefficient)

Sets a soft lower bound to the cumul variable of a given variable index. If the value of the cumul variable is less than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model: cumulVar > lower_bound -> cost = 0 cumulVar <= lower_bound -> cost = coefficient * (lower_bound - cumulVar). This is also handy to model earliness costs when the dimension represents time. Note: Using soft lower and upper bounds or span costs together is, as of 6/2014, not well supported in the sense that an optimal schedule is not guaranteed.

Expand source code
def SetCumulVarSoftLowerBound(self, index: "int64", lower_bound: "int64", coefficient: "int64") -> "void":
    r""" Sets a soft lower bound to the cumul variable of a given variable index. If the value of the cumul variable is less than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar > lower_bound -> cost = 0   cumulVar <= lower_bound -> cost = coefficient * (lower_bound -               cumulVar). This is also handy to model earliness costs when the dimension represents time. Note: Using soft lower and upper bounds or span costs together is, as of 6/2014, not well supported in the sense that an optimal schedule is not guaranteed."""
    return _pywrapcp.RoutingDimension_SetCumulVarSoftLowerBound(self, index, lower_bound, coefficient)

SetCumulVarSoftUpperBound

def SetCumulVarSoftUpperBound(self, index, upper_bound, coefficient)

Sets a soft upper bound to the cumul variable of a given variable index. If the value of the cumul variable is greater than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model: cumulVar <= upper_bound -> cost = 0 cumulVar > upper_bound -> cost = coefficient * (cumulVar - upper_bound) This is also handy to model tardiness costs when the dimension represents time.

Expand source code
def SetCumulVarSoftUpperBound(self, index: "int64", upper_bound: "int64", coefficient: "int64") -> "void":
    r""" Sets a soft upper bound to the cumul variable of a given variable index. If the value of the cumul variable is greater than the bound, a cost proportional to the difference between this value and the bound is added to the cost function of the model:   cumulVar <= upper_bound -> cost = 0    cumulVar > upper_bound -> cost = coefficient * (cumulVar - upper_bound) This is also handy to model tardiness costs when the dimension represents time."""
    return _pywrapcp.RoutingDimension_SetCumulVarSoftUpperBound(self, index, upper_bound, coefficient)

SetGlobalSpanCostCoefficient

def SetGlobalSpanCostCoefficient(self, coefficient)

Sets a cost proportional to the global dimension span, that is the difference between the largest value of route end cumul variables and the smallest value of route start cumul variables. In other words: global_span_cost = coefficient * (Max(dimension end value) - Min(dimension start value)).

Expand source code
def SetGlobalSpanCostCoefficient(self, coefficient: "int64") -> "void":
    r""" Sets a cost proportional to the *global* dimension span, that is the difference between the largest value of route end cumul variables and the smallest value of route start cumul variables. In other words: global_span_cost =   coefficient * (Max(dimension end value) - Min(dimension start value))."""
    return _pywrapcp.RoutingDimension_SetGlobalSpanCostCoefficient(self, coefficient)

SetPickupToDeliveryLimitFunctionForPair

def SetPickupToDeliveryLimitFunctionForPair(self, limit_function, pair_index)
Expand source code
def SetPickupToDeliveryLimitFunctionForPair(self, limit_function: "operations_research::RoutingDimension::PickupToDeliveryLimitFunction", pair_index: "int") -> "void":
    return _pywrapcp.RoutingDimension_SetPickupToDeliveryLimitFunctionForPair(self, limit_function, pair_index)

SetSpanCostCoefficientForAllVehicles

def SetSpanCostCoefficientForAllVehicles(self, coefficient)
Expand source code
def SetSpanCostCoefficientForAllVehicles(self, coefficient: "int64") -> "void":
    return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForAllVehicles(self, coefficient)

SetSpanCostCoefficientForVehicle

def SetSpanCostCoefficientForVehicle(self, coefficient, vehicle)

Sets a cost proportional to the dimension span on a given vehicle, or on all vehicles at once. "coefficient" must be nonnegative. This is handy to model costs proportional to idle time when the dimension represents time. The cost for a vehicle is span_cost = coefficient * (dimension end value - dimension start value).

Expand source code
def SetSpanCostCoefficientForVehicle(self, coefficient: "int64", vehicle: "int") -> "void":
    r""" Sets a cost proportional to the dimension span on a given vehicle, or on all vehicles at once. "coefficient" must be nonnegative. This is handy to model costs proportional to idle time when the dimension represents time. The cost for a vehicle is   span_cost = coefficient * (dimension end value - dimension start value)."""
    return _pywrapcp.RoutingDimension_SetSpanCostCoefficientForVehicle(self, coefficient, vehicle)

SetSpanUpperBoundForVehicle

def SetSpanUpperBoundForVehicle(self, upper_bound, vehicle)

Sets an upper bound on the dimension span on a given vehicle. This is the preferred way to limit the "length" of the route of a vehicle according to a dimension.

Expand source code
def SetSpanUpperBoundForVehicle(self, upper_bound: "int64", vehicle: "int") -> "void":
    r""" Sets an upper bound on the dimension span on a given vehicle. This is the preferred way to limit the "length" of the route of a vehicle according to a dimension."""
    return _pywrapcp.RoutingDimension_SetSpanUpperBoundForVehicle(self, upper_bound, vehicle)

ShortestTransitionSlack

def ShortestTransitionSlack(self, node)

It makes sense to use the function only for self-dependent dimension. For such dimensions the value of the slack of a node determines the transition cost of the next transit. Provided that 1. cumul[node] is fixed, 2. next[node] and next[next[node]] (if exists) are fixed, the value of slack[node] for which cumul[next[node]] + transit[next[node]] is minimized can be found in O(1) using this function.

Expand source code
def ShortestTransitionSlack(self, node: "int64") -> "int64":
    r""" It makes sense to use the function only for self-dependent dimension. For such dimensions the value of the slack of a node determines the transition cost of the next transit. Provided that   1. cumul[node] is fixed,   2. next[node] and next[next[node]] (if exists) are fixed, the value of slack[node] for which cumul[next[node]] + transit[next[node]] is minimized can be found in O(1) using this function."""
    return _pywrapcp.RoutingDimension_ShortestTransitionSlack(self, node)

SlackVar

def SlackVar(self, index)
Expand source code
def SlackVar(self, index: "int64") -> "operations_research::IntVar *":
    return _pywrapcp.RoutingDimension_SlackVar(self, index)

TransitVar

def TransitVar(self, index)
Expand source code
def TransitVar(self, index: "int64") -> "operations_research::IntVar *":
    return _pywrapcp.RoutingDimension_TransitVar(self, index)

base_dimension

def base_dimension(self)

Returns the parent in the dependency tree if any or nullptr otherwise.

Expand source code
def base_dimension(self) -> "operations_research::RoutingDimension const *":
    r""" Returns the parent in the dependency tree if any or nullptr otherwise."""
    return _pywrapcp.RoutingDimension_base_dimension(self)

global_span_cost_coefficient

def global_span_cost_coefficient(self)
Expand source code
def global_span_cost_coefficient(self) -> "int64":
    return _pywrapcp.RoutingDimension_global_span_cost_coefficient(self)

model

def model(self)

Returns the model on which the dimension was created.

Expand source code
def model(self) -> "operations_research::RoutingModel *":
    r""" Returns the model on which the dimension was created."""
    return _pywrapcp.RoutingDimension_model(self)

name

def name(self)

Returns the name of the dimension.

Expand source code
def name(self) -> "std::string const &":
    r""" Returns the name of the dimension."""
    return _pywrapcp.RoutingDimension_name(self)

RoutingFilteredDecisionBuilder

class RoutingFilteredDecisionBuilder (*args, **kwargs)

Filter-based decision builder dedicated to routing.

Expand source code
class RoutingFilteredDecisionBuilder(IntVarFilteredDecisionBuilder):
    r""" Filter-based decision builder dedicated to routing."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _pywrapcp.delete_RoutingFilteredDecisionBuilder

    def model(self) -> "operations_research::RoutingModel *":
        return _pywrapcp.RoutingFilteredDecisionBuilder_model(self)

    def GetStartChainEnd(self, vehicle: "int") -> "int":
        r""" Returns the end of the start chain of vehicle,"""
        return _pywrapcp.RoutingFilteredDecisionBuilder_GetStartChainEnd(self, vehicle)

    def GetEndChainStart(self, vehicle: "int") -> "int":
        r""" Returns the start of the end chain of vehicle,"""
        return _pywrapcp.RoutingFilteredDecisionBuilder_GetEndChainStart(self, vehicle)

    def MakeDisjunctionNodesUnperformed(self, node: "int64") -> "void":
        r""" Make nodes in the same disjunction as 'node' unperformed. 'node' is a variable index corresponding to a node."""
        return _pywrapcp.RoutingFilteredDecisionBuilder_MakeDisjunctionNodesUnperformed(self, node)

    def MakeUnassignedNodesUnperformed(self) -> "void":
        r""" Make all unassigned nodes unperformed."""
        return _pywrapcp.RoutingFilteredDecisionBuilder_MakeUnassignedNodesUnperformed(self)
Ancestors
Subclasses
Methods

GetEndChainStart

def GetEndChainStart(self, vehicle)

Returns the start of the end chain of vehicle,

Expand source code
def GetEndChainStart(self, vehicle: "int") -> "int":
    r""" Returns the start of the end chain of vehicle,"""
    return _pywrapcp.RoutingFilteredDecisionBuilder_GetEndChainStart(self, vehicle)

GetStartChainEnd

def GetStartChainEnd(self, vehicle)

Returns the end of the start chain of vehicle,

Expand source code
def GetStartChainEnd(self, vehicle: "int") -> "int":
    r""" Returns the end of the start chain of vehicle,"""
    return _pywrapcp.RoutingFilteredDecisionBuilder_GetStartChainEnd(self, vehicle)

MakeDisjunctionNodesUnperformed

def MakeDisjunctionNodesUnperformed(self, node)

Make nodes in the same disjunction as 'node' unperformed. 'node' is a variable index corresponding to a node.

Expand source code
def MakeDisjunctionNodesUnperformed(self, node: "int64") -> "void":
    r""" Make nodes in the same disjunction as 'node' unperformed. 'node' is a variable index corresponding to a node."""
    return _pywrapcp.RoutingFilteredDecisionBuilder_MakeDisjunctionNodesUnperformed(self, node)

MakeUnassignedNodesUnperformed

def MakeUnassignedNodesUnperformed(self)

Make all unassigned nodes unperformed.

Expand source code
def MakeUnassignedNodesUnperformed(self) -> "void":
    r""" Make all unassigned nodes unperformed."""
    return _pywrapcp.RoutingFilteredDecisionBuilder_MakeUnassignedNodesUnperformed(self)

model

def model(self)
Expand source code
def model(self) -> "operations_research::RoutingModel *":
    return _pywrapcp.RoutingFilteredDecisionBuilder_model(self)
Inherited members

RoutingIndexManager

class RoutingIndexManager (*args)

Manager for any NodeIndex <-> variable index conversion. The routing solver uses variable indices internally and through its API. These variable indices are tricky to manage directly because one Node can correspond to a multitude of variables, depending on the number of times they appear in the model, and if they're used as start and/or end points. This class aims to simplify variable index usage, allowing users to use NodeIndex instead. Usage: .cpp} auto starts_ends = …; /// These are NodeIndex. RoutingIndexManager manager(10, 4, starts_ends); // 10 nodes, 4 vehicles. RoutingModel model(manager);

Expand source code
class RoutingIndexManager(object):
    r""" Manager for any NodeIndex <-> variable index conversion. The routing solver uses variable indices internally and through its API. These variable indices are tricky to manage directly because one Node can correspond to a multitude of variables, depending on the number of times they appear in the model, and if they're used as start and/or end points. This class aims to simplify variable index usage, allowing users to use NodeIndex instead. Usage:   .cpp}   auto starts_ends = ...;  /// These are NodeIndex.   RoutingIndexManager manager(10, 4, starts_ends);  // 10 nodes, 4 vehicles.   RoutingModel model(manager);"""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _pywrapcp.RoutingIndexManager_swiginit(self, _pywrapcp.new_RoutingIndexManager(*args))
    __swig_destroy__ = _pywrapcp.delete_RoutingIndexManager

    def GetNumberOfNodes(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfNodes(self)

    def GetNumberOfVehicles(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfVehicles(self)

    def GetNumberOfIndices(self) -> "int":
        return _pywrapcp.RoutingIndexManager_GetNumberOfIndices(self)

    def NodeToIndex(self, node: "operations_research::RoutingIndexManager::NodeIndex") -> "int64":
        return _pywrapcp.RoutingIndexManager_NodeToIndex(self, node)

    def IndexToNode(self, index: "int64") -> "operations_research::RoutingIndexManager::NodeIndex":
        return _pywrapcp.RoutingIndexManager_IndexToNode(self, index)
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

GetNumberOfIndices

def GetNumberOfIndices(self)
Expand source code
def GetNumberOfIndices(self) -> "int":
    return _pywrapcp.RoutingIndexManager_GetNumberOfIndices(self)

GetNumberOfNodes

def GetNumberOfNodes(self)
Expand source code
def GetNumberOfNodes(self) -> "int":
    return _pywrapcp.RoutingIndexManager_GetNumberOfNodes(self)

GetNumberOfVehicles

def GetNumberOfVehicles(self)
Expand source code
def GetNumberOfVehicles(self) -> "int":
    return _pywrapcp.RoutingIndexManager_GetNumberOfVehicles(self)

IndexToNode

def IndexToNode(self, index)
Expand source code
def IndexToNode(self, index: "int64") -> "operations_research::RoutingIndexManager::NodeIndex":
    return _pywrapcp.RoutingIndexManager_IndexToNode(self, index)

NodeToIndex

def NodeToIndex(self, node)
Expand source code
def NodeToIndex(self, node: "operations_research::RoutingIndexManager::NodeIndex") -> "int64":
    return _pywrapcp.RoutingIndexManager_NodeToIndex(self, node)

RoutingModel

class RoutingModel (*args)
Expand source code
class RoutingModel(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    ROUTING_NOT_SOLVED = _pywrapcp.RoutingModel_ROUTING_NOT_SOLVED
    r""" Problem not solved yet (before calling RoutingModel::Solve())."""
    ROUTING_SUCCESS = _pywrapcp.RoutingModel_ROUTING_SUCCESS
    r""" Problem solved successfully after calling RoutingModel::Solve()."""
    ROUTING_FAIL = _pywrapcp.RoutingModel_ROUTING_FAIL
    r""" No solution found to the problem after calling RoutingModel::Solve()."""
    ROUTING_FAIL_TIMEOUT = _pywrapcp.RoutingModel_ROUTING_FAIL_TIMEOUT
    r""" Time limit reached before finding a solution with RoutingModel::Solve()."""
    ROUTING_INVALID = _pywrapcp.RoutingModel_ROUTING_INVALID
    r""" Model, model parameters or flags are not valid."""
    PICKUP_AND_DELIVERY_NO_ORDER = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_NO_ORDER
    r""" Any precedence is accepted."""
    PICKUP_AND_DELIVERY_LIFO = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_LIFO
    r""" Deliveries must be performed in reverse order of pickups."""
    PICKUP_AND_DELIVERY_FIFO = _pywrapcp.RoutingModel_PICKUP_AND_DELIVERY_FIFO
    r""" Deliveries must be performed in the same order as pickups."""

    def __init__(self, *args):
        _pywrapcp.RoutingModel_swiginit(self, _pywrapcp.new_RoutingModel(*args))
    __swig_destroy__ = _pywrapcp.delete_RoutingModel

    def RegisterUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
        r""" Registers 'callback' and returns its index."""
        return _pywrapcp.RoutingModel_RegisterUnaryTransitCallback(self, callback)

    def RegisterPositiveUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
        return _pywrapcp.RoutingModel_RegisterPositiveUnaryTransitCallback(self, callback)

    def RegisterTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
        return _pywrapcp.RoutingModel_RegisterTransitCallback(self, callback)

    def RegisterPositiveTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
        return _pywrapcp.RoutingModel_RegisterPositiveTransitCallback(self, callback)

    def TransitCallback(self, callback_index: "int") -> "operations_research::RoutingModel::TransitCallback2 const &":
        return _pywrapcp.RoutingModel_TransitCallback(self, callback_index)

    def UnaryTransitCallbackOrNull(self, callback_index: "int") -> "operations_research::RoutingModel::TransitCallback1 const &":
        return _pywrapcp.RoutingModel_UnaryTransitCallbackOrNull(self, callback_index)

    def AddDimension(self, evaluator_index: "int", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Model creation Methods to add dimensions to routes; dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumul(j) = cumul(i) + transit(i) + slack(i) where slack is a positive slack variable (can represent waiting times for a time dimension). Setting the value of fix_start_cumul_to_zero to true will force the "cumul" variable of the start node of all vehicles to be equal to 0. Creates a dimension where the transit variable is constrained to be equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the slack variable and 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension). Takes ownership of the callback 'evaluator'."""
        return _pywrapcp.RoutingModel_AddDimension(self, evaluator_index, slack_max, capacity, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleTransits(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransits(self, evaluator_indices, slack_max, capacity, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleCapacity(self, evaluator_index: "int", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleCapacity(self, evaluator_index, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

    def AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

    def AddConstantDimensionWithSlack(self, value: "int64", capacity: "int64", slack_max: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Creates a dimension where the transit variable is constrained to be equal to 'value'; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
        return _pywrapcp.RoutingModel_AddConstantDimensionWithSlack(self, value, capacity, slack_max, fix_start_cumul_to_zero, name)

    def AddConstantDimension(self, value: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        return _pywrapcp.RoutingModel_AddConstantDimension(self, value, capacity, fix_start_cumul_to_zero, name)

    def AddVectorDimension(self, values: "std::vector< int64 >", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
        r""" Creates a dimension where the transit variable is constrained to be equal to 'values[i]' for node i; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
        return _pywrapcp.RoutingModel_AddVectorDimension(self, values, capacity, fix_start_cumul_to_zero, name)

    def MakePathSpansAndTotalSlacks(self, dimension: "RoutingDimension", spans: "std::vector< operations_research::IntVar * >", total_slacks: "std::vector< operations_research::IntVar * >") -> "operations_research::Constraint *":
        r""" For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of   slacks on that vehicle, that is,   dimension->CumulVar(end) - dimension->CumulVar(start) -   sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be   dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account."""
        return _pywrapcp.RoutingModel_MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks)

    def GetAllDimensionNames(self) -> "std::vector< ::std::string >":
        r""" Outputs the names of all dimensions added to the routing engine."""
        return _pywrapcp.RoutingModel_GetAllDimensionNames(self)

    def GetDimensions(self) -> "std::vector< operations_research::RoutingDimension * > const &":
        r""" Returns all dimensions of the model."""
        return _pywrapcp.RoutingModel_GetDimensions(self)

    def GetDimensionsWithSoftOrSpanCosts(self) -> "std::vector< operations_research::RoutingDimension * >":
        r""" Returns dimensions with soft or vehicle span costs."""
        return _pywrapcp.RoutingModel_GetDimensionsWithSoftOrSpanCosts(self)

    def GetGlobalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::GlobalDimensionCumulOptimizer > > const &":
        r""" Returns [global|local]_dimension_optimizers_, which are empty if the model has not been closed."""
        return _pywrapcp.RoutingModel_GetGlobalDimensionCumulOptimizers(self)

    def GetLocalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &":
        return _pywrapcp.RoutingModel_GetLocalDimensionCumulOptimizers(self)

    def GetMutableGlobalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::GlobalDimensionCumulOptimizer *":
        r""" Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none."""
        return _pywrapcp.RoutingModel_GetMutableGlobalCumulOptimizer(self, dimension)

    def GetMutableLocalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *":
        return _pywrapcp.RoutingModel_GetMutableLocalCumulOptimizer(self, dimension)

    def HasDimension(self, dimension_name: "std::string const &") -> "bool":
        r""" Returns true if a dimension exists for a given dimension name."""
        return _pywrapcp.RoutingModel_HasDimension(self, dimension_name)

    def GetDimensionOrDie(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension const &":
        r""" Returns a dimension from its name. Dies if the dimension does not exist."""
        return _pywrapcp.RoutingModel_GetDimensionOrDie(self, dimension_name)

    def GetMutableDimension(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension *":
        r""" Returns a dimension from its name. Returns nullptr if the dimension does not exist."""
        return _pywrapcp.RoutingModel_GetMutableDimension(self, dimension_name)

    def SetPrimaryConstrainedDimension(self, dimension_name: "std::string const &") -> "void":
        r""" Set the given dimension as "primary constrained". As of August 2013, this is only used by ArcIsMoreConstrainedThanArc(). "dimension" must be the name of an existing dimension, or be empty, in which case there will not be a primary dimension after this call."""
        return _pywrapcp.RoutingModel_SetPrimaryConstrainedDimension(self, dimension_name)

    def GetPrimaryConstrainedDimension(self) -> "std::string const &":
        r""" Get the primary constrained dimension, or an empty std::string if it is unset."""
        return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self)

    def AddDisjunction(self, *args) -> "operations_research::RoutingModel::DisjunctionIndex":
        r""" Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active. Start and end indices of any vehicle cannot be part of a disjunction. If a penalty is given, at most 'max_cardinality' of the indices can be active, and if less are active, 'penalty' is payed per inactive index. This is equivalent to adding the constraint:     p + Sum(i)active[i] == max_cardinality where p is an integer variable, and the following cost to the cost function:     p * penalty. 'penalty' must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited."""
        return _pywrapcp.RoutingModel_AddDisjunction(self, *args)

    def GetDisjunctionIndices(self, index: "int64") -> "std::vector< operations_research::RoutingModel::DisjunctionIndex > const &":
        r""" Returns the indices of the disjunctions to which an index belongs."""
        return _pywrapcp.RoutingModel_GetDisjunctionIndices(self, index)

    def GetDisjunctionPenalty(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
        r""" Returns the penalty of the node disjunction of index 'index'."""
        return _pywrapcp.RoutingModel_GetDisjunctionPenalty(self, index)

    def GetDisjunctionMaxCardinality(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
        r""" Returns the maximum number of possible active nodes of the node disjunction of index 'index'."""
        return _pywrapcp.RoutingModel_GetDisjunctionMaxCardinality(self, index)

    def GetNumberOfDisjunctions(self) -> "int":
        r""" Returns the number of node disjunctions in the model."""
        return _pywrapcp.RoutingModel_GetNumberOfDisjunctions(self)

    def GetPerfectBinaryDisjunctions(self) -> "std::vector< std::pair< int64,int64 > >":
        r""" Returns the list of all perfect binary disjunctions, as pairs of variable indices: a disjunction is "perfect" when its variables do not appear in any other disjunction. Each pair is sorted (lowest variable index first), and the output vector is also sorted (lowest pairs first)."""
        return _pywrapcp.RoutingModel_GetPerfectBinaryDisjunctions(self)

    def IgnoreDisjunctionsAlreadyForcedToZero(self) -> "void":
        r""" SPECIAL: Makes the solver ignore all the disjunctions whose active variables are all trivially zero (i.e. Max() == 0), by setting their max_cardinality to 0. This can be useful when using the BaseBinaryDisjunctionNeighborhood operators, in the context of arc-based routing."""
        return _pywrapcp.RoutingModel_IgnoreDisjunctionsAlreadyForcedToZero(self)

    def AddSoftSameVehicleConstraint(self, indices: "std::vector< int64 > const &", cost: "int64") -> "void":
        r""" Adds a soft contraint to force a set of variable indices to be on the same vehicle. If all nodes are not on the same vehicle, each extra vehicle used adds 'cost' to the cost function."""
        return _pywrapcp.RoutingModel_AddSoftSameVehicleConstraint(self, indices, cost)

    def SetAllowedVehiclesForIndex(self, vehicles: "std::vector< int > const &", index: "int64") -> "void":
        r""" Sets the vehicles which can visit a given node. If the node is in a disjunction, this will not prevent it from being unperformed. Specifying an empty vector of vehicles has no effect (all vehicles will be allowed to visit the node)."""
        return _pywrapcp.RoutingModel_SetAllowedVehiclesForIndex(self, vehicles, index)

    def IsVehicleAllowedForIndex(self, vehicle: "int", index: "int64") -> "bool":
        r""" Returns true if a vehicle is allowed to visit a given node."""
        return _pywrapcp.RoutingModel_IsVehicleAllowedForIndex(self, vehicle, index)

    def AddPickupAndDelivery(self, pickup: "int64", delivery: "int64") -> "void":
        r""" Notifies that index1 and index2 form a pair of nodes which should belong to the same route. This methods helps the search find better solutions, especially in the local search phase. It should be called each time you have an equality constraint linking the vehicle variables of two node (including for instance pickup and delivery problems):     Solver* const solver = routing.solver();     int64 index1 = manager.NodeToIndex(node1);     int64 index2 = manager.NodeToIndex(node2);     solver->AddConstraint(solver->MakeEquality(         routing.VehicleVar(index1),         routing.VehicleVar(index2)));     routing.AddPickupAndDelivery(index1, index2);"""
        return _pywrapcp.RoutingModel_AddPickupAndDelivery(self, pickup, delivery)

    def AddPickupAndDeliverySets(self, pickup_disjunction: "operations_research::RoutingModel::DisjunctionIndex", delivery_disjunction: "operations_research::RoutingModel::DisjunctionIndex") -> "void":
        r""" Same as AddPickupAndDelivery but notifying that the performed node from the disjunction of index 'pickup_disjunction' is on the same route as the performed node from the disjunction of index 'delivery_disjunction'."""
        return _pywrapcp.RoutingModel_AddPickupAndDeliverySets(self, pickup_disjunction, delivery_disjunction)

    def GetPickupIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
        r""" Returns pairs for which the node is a pickup; the first element of each pair is the index in the pickup and delivery pairs list in which the pickup appears, the second element is its index in the pickups list."""
        return _pywrapcp.RoutingModel_GetPickupIndexPairs(self, node_index)

    def GetDeliveryIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
        r""" Same as above for deliveries."""
        return _pywrapcp.RoutingModel_GetDeliveryIndexPairs(self, node_index)

    def SetPickupAndDeliveryPolicyOfAllVehicles(self, policy: "operations_research::RoutingModel::PickupAndDeliveryPolicy") -> "void":
        r""" Sets the Pickup and delivery policy of all vehicles. It is equivalent to calling SetPickupAndDeliveryPolicyOfVehicle on all vehicles."""
        return _pywrapcp.RoutingModel_SetPickupAndDeliveryPolicyOfAllVehicles(self, policy)

    def SetPickupAndDeliveryPolicyOfVehicle(self, policy: "operations_research::RoutingModel::PickupAndDeliveryPolicy", vehicle: "int") -> "void":
        return _pywrapcp.RoutingModel_SetPickupAndDeliveryPolicyOfVehicle(self, policy, vehicle)

    def GetPickupAndDeliveryPolicyOfVehicle(self, vehicle: "int") -> "operations_research::RoutingModel::PickupAndDeliveryPolicy":
        return _pywrapcp.RoutingModel_GetPickupAndDeliveryPolicyOfVehicle(self, vehicle)

    def GetNumOfSingletonNodes(self) -> "int":
        r""" Returns the number of non-start/end nodes which do not appear in a pickup/delivery pair."""
        return _pywrapcp.RoutingModel_GetNumOfSingletonNodes(self)

    def SetVisitType(self, index: "int64", type: "int") -> "void":
        r""" Set the node visit types and incompatibilities/requirements between the types (see below). NOTE: The visit type of a node must be positive, and all nodes belonging to the same pickup/delivery pair must have the same type (or no type at all). NOTE: Before adding any incompatibilities and/or requirements on types:       1) All corresponding node types must have been set.       2) CloseVisitTypes() must be called so all containers are resized          accordingly. NOTE: These incompatibilities and requirements are only handled when each node index appears in at most one pickup/delivery pair, i.e. when the same node isn't a pickup and/or delivery in multiple pickup/delivery pairs."""
        return _pywrapcp.RoutingModel_SetVisitType(self, index, type)

    def GetVisitType(self, index: "int64") -> "int":
        return _pywrapcp.RoutingModel_GetVisitType(self, index)

    def CloseVisitTypes(self) -> "void":
        r""" This function should be called once all node visit types have been set and prior to adding any incompatibilities/requirements. "close" types."""
        return _pywrapcp.RoutingModel_CloseVisitTypes(self)

    def GetNumberOfVisitTypes(self) -> "int":
        return _pywrapcp.RoutingModel_GetNumberOfVisitTypes(self)

    def AddHardTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
        r""" Incompatibilities: Two nodes with "hard" incompatible types cannot share the same route at all, while with a "temporal" incompatibility they can't be on the same route at the same time."""
        return _pywrapcp.RoutingModel_AddHardTypeIncompatibility(self, type1, type2)

    def AddTemporalTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
        return _pywrapcp.RoutingModel_AddTemporalTypeIncompatibility(self, type1, type2)

    def GetHardTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
        r""" Returns visit types incompatible with a given type."""
        return _pywrapcp.RoutingModel_GetHardTypeIncompatibilitiesOfType(self, type)

    def GetTemporalTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
        return _pywrapcp.RoutingModel_GetTemporalTypeIncompatibilitiesOfType(self, type)

    def HasHardTypeIncompatibilities(self) -> "bool":
        r""" Returns true iff any hard (resp. temporal) type incompatibilities have been added to the model."""
        return _pywrapcp.RoutingModel_HasHardTypeIncompatibilities(self)

    def HasTemporalTypeIncompatibilities(self) -> "bool":
        return _pywrapcp.RoutingModel_HasTemporalTypeIncompatibilities(self)

    def AddSameVehicleRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
        r""" Requirements: NOTE: As of 2019-04, cycles in the requirement graph are not supported, and lead to the dependent nodes being skipped if possible (otherwise the model is considered infeasible). The following functions specify that "dependent_type" requires at least one of the types in "required_type_alternatives". For same-vehicle requirements, a node of dependent type type_D requires at least one node of type type_R among the required alternatives on the same route."""
        return _pywrapcp.RoutingModel_AddSameVehicleRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

    def AddTemporalRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
        r""" If type_D temporally depends on type_R, any non-delivery node_D of type_D requires at least one non-delivered node of type_R on its vehicle at the time node_D is visited."""
        return _pywrapcp.RoutingModel_AddTemporalRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

    def GetSameVehicleRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
        r""" Returns the sets of same-vehicle/temporal requirement alternatives for the given type."""
        return _pywrapcp.RoutingModel_GetSameVehicleRequiredTypeAlternativesOfType(self, type)

    def GetTemporalRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
        return _pywrapcp.RoutingModel_GetTemporalRequiredTypeAlternativesOfType(self, type)

    def HasSameVehicleTypeRequirements(self) -> "bool":
        r""" Returns true iff any same-route (resp. temporal) type requirements have been added to the model."""
        return _pywrapcp.RoutingModel_HasSameVehicleTypeRequirements(self)

    def HasTemporalTypeRequirements(self) -> "bool":
        return _pywrapcp.RoutingModel_HasTemporalTypeRequirements(self)

    def HasTypeRegulations(self) -> "bool":
        r""" Returns true iff the model has any incompatibilities or requirements set on node types."""
        return _pywrapcp.RoutingModel_HasTypeRegulations(self)

    def UnperformedPenalty(self, var_index: "int64") -> "int64":
        r""" Get the "unperformed" penalty of a node. This is only well defined if the node is only part of a single Disjunction involving only itself, and that disjunction has a penalty. In all other cases, including forced active nodes, this returns 0."""
        return _pywrapcp.RoutingModel_UnperformedPenalty(self, var_index)

    def UnperformedPenaltyOrValue(self, default_value: "int64", var_index: "int64") -> "int64":
        r""" Same as above except that it returns default_value instead of 0 when penalty is not well defined (default value is passed as first argument to simplify the usage of the method in a callback)."""
        return _pywrapcp.RoutingModel_UnperformedPenaltyOrValue(self, default_value, var_index)

    def GetDepot(self) -> "int64":
        r""" Returns the variable index of the first starting or ending node of all routes. If all routes start  and end at the same node (single depot), this is the node returned."""
        return _pywrapcp.RoutingModel_GetDepot(self)

    def SetArcCostEvaluatorOfAllVehicles(self, evaluator_index: "int") -> "void":
        r""" Sets the cost function of the model such that the cost of a segment of a route between node 'from' and 'to' is evaluator(from, to), whatever the route or vehicle performing the route."""
        return _pywrapcp.RoutingModel_SetArcCostEvaluatorOfAllVehicles(self, evaluator_index)

    def SetArcCostEvaluatorOfVehicle(self, evaluator_index: "int", vehicle: "int") -> "void":
        r""" Sets the cost function for a given vehicle route."""
        return _pywrapcp.RoutingModel_SetArcCostEvaluatorOfVehicle(self, evaluator_index, vehicle)

    def SetFixedCostOfAllVehicles(self, cost: "int64") -> "void":
        r""" Sets the fixed cost of all vehicle routes. It is equivalent to calling SetFixedCostOfVehicle on all vehicle routes."""
        return _pywrapcp.RoutingModel_SetFixedCostOfAllVehicles(self, cost)

    def SetFixedCostOfVehicle(self, cost: "int64", vehicle: "int") -> "void":
        r""" Sets the fixed cost of one vehicle route."""
        return _pywrapcp.RoutingModel_SetFixedCostOfVehicle(self, cost, vehicle)

    def GetFixedCostOfVehicle(self, vehicle: "int") -> "int64":
        r""" Returns the route fixed cost taken into account if the route of the vehicle is not empty, aka there's at least one node on the route other than the first and last nodes."""
        return _pywrapcp.RoutingModel_GetFixedCostOfVehicle(self, vehicle)

    def SetAmortizedCostFactorsOfAllVehicles(self, linear_cost_factor: "int64", quadratic_cost_factor: "int64") -> "void":
        r""" The following methods set the linear and quadratic cost factors of vehicles (must be positive values). The default value of these parameters is zero for all vehicles. When set, the cost_ of the model will contain terms aiming at reducing the number of vehicles used in the model, by adding the following to the objective for every vehicle v: INDICATOR(v used in the model) *   [linear_cost_factor_of_vehicle_[v]    - quadratic_cost_factor_of_vehicle_[v]*(square of length of route v)] i.e. for every used vehicle, we add the linear factor as fixed cost, and subtract the square of the route length multiplied by the quadratic factor. This second term aims at making the routes as dense as possible. Sets the linear and quadratic cost factor of all vehicles."""
        return _pywrapcp.RoutingModel_SetAmortizedCostFactorsOfAllVehicles(self, linear_cost_factor, quadratic_cost_factor)

    def SetAmortizedCostFactorsOfVehicle(self, linear_cost_factor: "int64", quadratic_cost_factor: "int64", vehicle: "int") -> "void":
        r""" Sets the linear and quadratic cost factor of the given vehicle."""
        return _pywrapcp.RoutingModel_SetAmortizedCostFactorsOfVehicle(self, linear_cost_factor, quadratic_cost_factor, vehicle)

    def GetAmortizedLinearCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
        return _pywrapcp.RoutingModel_GetAmortizedLinearCostFactorOfVehicles(self)

    def GetAmortizedQuadraticCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
        return _pywrapcp.RoutingModel_GetAmortizedQuadraticCostFactorOfVehicles(self)

    def ConsiderEmptyRouteCostsForVehicle(self, consider_costs: "bool", vehicle: "int") -> "void":
        return _pywrapcp.RoutingModel_ConsiderEmptyRouteCostsForVehicle(self, consider_costs, vehicle)

    def AreEmptyRouteCostsConsideredForVehicle(self, vehicle: "int") -> "bool":
        return _pywrapcp.RoutingModel_AreEmptyRouteCostsConsideredForVehicle(self, vehicle)

    def SetFirstSolutionEvaluator(self, evaluator: "operations_research::Solver::IndexEvaluator2") -> "void":
        r""" Gets/sets the evaluator used during the search. Only relevant when RoutingSearchParameters.first_solution_strategy = EVALUATOR_STRATEGY. Takes ownership of evaluator."""
        return _pywrapcp.RoutingModel_SetFirstSolutionEvaluator(self, evaluator)

    def AddLocalSearchOperator(self, ls_operator: "LocalSearchOperator") -> "void":
        r""" Adds a local search operator to the set of operators used to solve the vehicle routing problem."""
        return _pywrapcp.RoutingModel_AddLocalSearchOperator(self, ls_operator)

    def AddSearchMonitor(self, monitor: "SearchMonitor") -> "void":
        r""" Adds a search monitor to the search used to solve the routing model."""
        return _pywrapcp.RoutingModel_AddSearchMonitor(self, monitor)

    def AddAtSolutionCallback(self, callback: "std::function< void () >") -> "void":
        r""" Adds a callback called each time a solution is found during the search. This is a shortcut to creating a monitor to call the callback on AtSolution() and adding it with AddSearchMonitor."""
        return _pywrapcp.RoutingModel_AddAtSolutionCallback(self, callback)

    def AddVariableMinimizedByFinalizer(self, var: "IntVar") -> "void":
        r""" Adds a variable to minimize in the solution finalizer. The solution finalizer is called each time a solution is found during the search and allows to instantiate secondary variables (such as dimension cumul variables)."""
        return _pywrapcp.RoutingModel_AddVariableMinimizedByFinalizer(self, var)

    def AddVariableMaximizedByFinalizer(self, var: "IntVar") -> "void":
        r""" Adds a variable to maximize in the solution finalizer (see above for information on the solution finalizer)."""
        return _pywrapcp.RoutingModel_AddVariableMaximizedByFinalizer(self, var)

    def AddWeightedVariableMinimizedByFinalizer(self, var: "IntVar", cost: "int64") -> "void":
        r""" Adds a variable to minimize in the solution finalizer, with a weighted priority: the higher the more priority it has."""
        return _pywrapcp.RoutingModel_AddWeightedVariableMinimizedByFinalizer(self, var, cost)

    def AddVariableTargetToFinalizer(self, var: "IntVar", target: "int64") -> "void":
        r""" Add a variable to set the closest possible to the target value in the solution finalizer."""
        return _pywrapcp.RoutingModel_AddVariableTargetToFinalizer(self, var, target)

    def CloseModel(self) -> "void":
        r""" Closes the current routing model; after this method is called, no modification to the model can be done, but RoutesToAssignment becomes available. Note that CloseModel() is automatically called by Solve() and other methods that produce solution. This is equivalent to calling CloseModelWithParameters(DefaultRoutingSearchParameters())."""
        return _pywrapcp.RoutingModel_CloseModel(self)

    def CloseModelWithParameters(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "void":
        r""" Same as above taking search parameters (as of 10/2015 some the parameters have to be set when closing the model)."""
        return _pywrapcp.RoutingModel_CloseModelWithParameters(self, search_parameters)

    def Solve(self, assignment: "Assignment"=None) -> "operations_research::Assignment const *":
        r""" Solves the current routing model; closes the current model. This is equivalent to calling SolveWithParameters(DefaultRoutingSearchParameters()) or SolveFromAssignmentWithParameters(assignment,                                   DefaultRoutingSearchParameters())."""
        return _pywrapcp.RoutingModel_Solve(self, assignment)

    def SolveWithParameters(self, search_parameters: "operations_research::RoutingSearchParameters const &", solutions: "std::vector< operations_research::Assignment const * > *"=None) -> "operations_research::Assignment const *":
        r""" Solves the current routing model with the given parameters. If 'solutions' is specified, it will contain the k best solutions found during the search (from worst to best, including the one returned by this method), where k corresponds to the 'number_of_solutions_to_collect' in 'search_parameters'. Note that the Assignment returned by the method and the ones in solutions are owned by the underlying solver and should not be deleted."""
        return _pywrapcp.RoutingModel_SolveWithParameters(self, search_parameters, solutions)

    def SolveFromAssignmentWithParameters(self, assignment: "Assignment", search_parameters: "operations_research::RoutingSearchParameters const &", solutions: "std::vector< operations_research::Assignment const * > *"=None) -> "operations_research::Assignment const *":
        return _pywrapcp.RoutingModel_SolveFromAssignmentWithParameters(self, assignment, search_parameters, solutions)

    def SetAssignmentFromOtherModelAssignment(self, target_assignment: "Assignment", source_model: "RoutingModel", source_assignment: "Assignment") -> "void":
        r""" Given a "source_model" and its "source_assignment", resets "target_assignment" with the IntVar variables (nexts_, and vehicle_vars_ if costs aren't homogeneous across vehicles) of "this" model, with the values set according to those in "other_assignment". The objective_element of target_assignment is set to this->cost_."""
        return _pywrapcp.RoutingModel_SetAssignmentFromOtherModelAssignment(self, target_assignment, source_model, source_assignment)

    def ComputeLowerBound(self) -> "int64":
        r""" Computes a lower bound to the routing problem solving a linear assignment problem. The routing model must be closed before calling this method. Note that problems with node disjunction constraints (including optional nodes) and non-homogenous costs are not supported (the method returns 0 in these cases)."""
        return _pywrapcp.RoutingModel_ComputeLowerBound(self)

    def status(self) -> "operations_research::RoutingModel::Status":
        r""" Returns the current status of the routing model."""
        return _pywrapcp.RoutingModel_status(self)

    def ApplyLocks(self, locks: "std::vector< int64 > const &") -> "operations_research::IntVar *":
        r""" Applies a lock chain to the next search. 'locks' represents an ordered vector of nodes representing a partial route which will be fixed during the next search; it will constrain next variables such that: next[locks[i]] == locks[i+1]. Returns the next variable at the end of the locked chain; this variable is not locked. An assignment containing the locks can be obtained by calling PreAssignment()."""
        return _pywrapcp.RoutingModel_ApplyLocks(self, locks)

    def ApplyLocksToAllVehicles(self, locks: "std::vector< std::vector< int64 > > const &", close_routes: "bool") -> "bool":
        r""" Applies lock chains to all vehicles to the next search, such that locks[p] is the lock chain for route p. Returns false if the locks do not contain valid routes; expects that the routes do not contain the depots, i.e. there are empty vectors in place of empty routes. If close_routes is set to true, adds the end nodes to the route of each vehicle and deactivates other nodes. An assignment containing the locks can be obtained by calling PreAssignment()."""
        return _pywrapcp.RoutingModel_ApplyLocksToAllVehicles(self, locks, close_routes)

    def PreAssignment(self) -> "operations_research::Assignment const *const":
        r""" Returns an assignment used to fix some of the variables of the problem. In practice, this assignment locks partial routes of the problem. This can be used in the context of locking the parts of the routes which have already been driven in online routing problems."""
        return _pywrapcp.RoutingModel_PreAssignment(self)

    def MutablePreAssignment(self) -> "operations_research::Assignment *":
        return _pywrapcp.RoutingModel_MutablePreAssignment(self)

    def WriteAssignment(self, file_name: "std::string const &") -> "bool":
        r""" Writes the current solution to a file containing an AssignmentProto. Returns false if the file cannot be opened or if there is no current solution."""
        return _pywrapcp.RoutingModel_WriteAssignment(self, file_name)

    def ReadAssignment(self, file_name: "std::string const &") -> "operations_research::Assignment *":
        r""" Reads an assignment from a file and returns the current solution. Returns nullptr if the file cannot be opened or if the assignment is not valid."""
        return _pywrapcp.RoutingModel_ReadAssignment(self, file_name)

    def RestoreAssignment(self, solution: "Assignment") -> "operations_research::Assignment *":
        r""" Restores an assignment as a solution in the routing model and returns the new solution. Returns nullptr if the assignment is not valid."""
        return _pywrapcp.RoutingModel_RestoreAssignment(self, solution)

    def ReadAssignmentFromRoutes(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool") -> "operations_research::Assignment *":
        r""" Restores the routes as the current solution. Returns nullptr if the solution cannot be restored (routes do not contain a valid solution). Note that calling this method will run the solver to assign values to the dimension variables; this may take considerable amount of time, especially when using dimensions with slack."""
        return _pywrapcp.RoutingModel_ReadAssignmentFromRoutes(self, routes, ignore_inactive_indices)

    def RoutesToAssignment(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool", close_routes: "bool", assignment: "Assignment") -> "bool":
        r""" Fills an assignment from a specification of the routes of the vehicles. The routes are specified as lists of variable indices that appear on the routes of the vehicles. The indices of the outer vector in 'routes' correspond to vehicles IDs, the inner vector contains the variable indices on the routes for the given vehicle. The inner vectors must not contain the start and end indices, as these are determined by the routing model.  Sets the value of NextVars in the assignment, adding the variables to the assignment if necessary. The method does not touch other variables in the assignment. The method can only be called after the model is closed.  With ignore_inactive_indices set to false, this method will fail (return nullptr) in case some of the route contain indices that are deactivated in the model; when set to true, these indices will be skipped.  Returns true if routes were successfully loaded. However, such assignment still might not be a valid solution to the routing problem due to more complex constraints; it is advisible to call solver()->CheckSolution() afterwards."""
        return _pywrapcp.RoutingModel_RoutesToAssignment(self, routes, ignore_inactive_indices, close_routes, assignment)

    def AssignmentToRoutes(self, assignment: "Assignment", routes: "std::vector< std::vector< int64 > > *const") -> "void":
        r""" Converts the solution in the given assignment to routes for all vehicles. Expects that assignment contains a valid solution (i.e. routes for all vehicles end with an end index for that vehicle)."""
        return _pywrapcp.RoutingModel_AssignmentToRoutes(self, assignment, routes)

    def CompactAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
        r""" Returns a compacted version of the given assignment, in which all vehicles with id lower or equal to some N have non-empty routes, and all vehicles with id greater than N have empty routes. Does not take ownership of the returned object. If found, the cost of the compact assignment is the same as in the original assignment and it preserves the values of 'active' variables. Returns nullptr if a compact assignment was not found. This method only works in homogenous mode, and it only swaps equivalent vehicles (vehicles with the same start and end nodes). When creating the compact assignment, the empty plan is replaced by the route assigned to the compatible vehicle with the highest id. Note that with more complex constraints on vehicle variables, this method might fail even if a compact solution exists. This method changes the vehicle and dimension variables as necessary. While compacting the solution, only basic checks on vehicle variables are performed; if one of these checks fails no attempts to repair it are made (instead, the method returns nullptr)."""
        return _pywrapcp.RoutingModel_CompactAssignment(self, assignment)

    def CompactAndCheckAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
        r""" Same as CompactAssignment() but also checks the validity of the final compact solution; if it is not valid, no attempts to repair it are made (instead, the method returns nullptr)."""
        return _pywrapcp.RoutingModel_CompactAndCheckAssignment(self, assignment)

    def AddToAssignment(self, var: "IntVar") -> "void":
        r""" Adds an extra variable to the vehicle routing assignment."""
        return _pywrapcp.RoutingModel_AddToAssignment(self, var)

    def AddIntervalToAssignment(self, interval: "IntervalVar") -> "void":
        return _pywrapcp.RoutingModel_AddIntervalToAssignment(self, interval)

    def PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment: "Assignment", duration_limit: "absl::Duration") -> "operations_research::Assignment const *":
        r""" For every dimension in the model with an optimizer in local/global_dimension_optimizers_, this method tries to pack the cumul values of the dimension, such that: - The cumul costs (span costs, soft lower and upper bound costs, etc) are   minimized. - The cumuls of the ends of the routes are minimized for this given   minimal cumul cost. - Given these minimal end cumuls, the route start cumuls are maximized. Returns the assignment resulting from allocating these packed cumuls with the solver, and nullptr if these cumuls could not be set by the solver."""
        return _pywrapcp.RoutingModel_PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment, duration_limit)

    def AddLocalSearchFilter(self, filter: "LocalSearchFilter") -> "void":
        r""" Adds a custom local search filter to the list of filters used to speed up local search by pruning unfeasible variable assignments. Calling this method after the routing model has been closed (CloseModel() or Solve() has been called) has no effect. The routing model does not take ownership of the filter."""
        return _pywrapcp.RoutingModel_AddLocalSearchFilter(self, filter)

    def Start(self, vehicle: "int") -> "int64":
        r""" Model inspection. Returns the variable index of the starting node of a vehicle route."""
        return _pywrapcp.RoutingModel_Start(self, vehicle)

    def End(self, vehicle: "int") -> "int64":
        r""" Returns the variable index of the ending node of a vehicle route."""
        return _pywrapcp.RoutingModel_End(self, vehicle)

    def IsStart(self, index: "int64") -> "bool":
        r""" Returns true if 'index' represents the first node of a route."""
        return _pywrapcp.RoutingModel_IsStart(self, index)

    def IsEnd(self, index: "int64") -> "bool":
        r""" Returns true if 'index' represents the last node of a route."""
        return _pywrapcp.RoutingModel_IsEnd(self, index)

    def VehicleIndex(self, index: "int") -> "int":
        r""" Returns the vehicle of the given start/end index, and -1 if the given index is not a vehicle start/end."""
        return _pywrapcp.RoutingModel_VehicleIndex(self, index)

    def Next(self, assignment: "Assignment", index: "int64") -> "int64":
        r""" Assignment inspection Returns the variable index of the node directly after the node corresponding to 'index' in 'assignment'."""
        return _pywrapcp.RoutingModel_Next(self, assignment, index)

    def IsVehicleUsed(self, assignment: "Assignment", vehicle: "int") -> "bool":
        r""" Returns true if the route of 'vehicle' is non empty in 'assignment'."""
        return _pywrapcp.RoutingModel_IsVehicleUsed(self, assignment, vehicle)

    def NextVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the next variable of the node corresponding to index. Note that NextVar(index) == index is equivalent to ActiveVar(index) == 0."""
        return _pywrapcp.RoutingModel_NextVar(self, index)

    def ActiveVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the active variable of the node corresponding to index."""
        return _pywrapcp.RoutingModel_ActiveVar(self, index)

    def VehicleCostsConsideredVar(self, vehicle: "int") -> "operations_research::IntVar *":
        r""" Returns the variable specifying whether or not costs are considered for vehicle."""
        return _pywrapcp.RoutingModel_VehicleCostsConsideredVar(self, vehicle)

    def VehicleVar(self, index: "int64") -> "operations_research::IntVar *":
        r""" Returns the vehicle variable of the node corresponding to index. Note that VehicleVar(index) == -1 is equivalent to ActiveVar(index) == 0."""
        return _pywrapcp.RoutingModel_VehicleVar(self, index)

    def CostVar(self) -> "operations_research::IntVar *":
        r""" Returns the global cost variable which is being minimized."""
        return _pywrapcp.RoutingModel_CostVar(self)

    def GetArcCostForVehicle(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
        r""" Returns the cost of the transit arc between two nodes for a given vehicle. Input are variable indices of node. This returns 0 if vehicle < 0."""
        return _pywrapcp.RoutingModel_GetArcCostForVehicle(self, from_index, to_index, vehicle)

    def CostsAreHomogeneousAcrossVehicles(self) -> "bool":
        r""" Whether costs are homogeneous across all vehicles."""
        return _pywrapcp.RoutingModel_CostsAreHomogeneousAcrossVehicles(self)

    def GetHomogeneousCost(self, from_index: "int64", to_index: "int64") -> "int64":
        r""" Returns the cost of the segment between two nodes supposing all vehicle costs are the same (returns the cost for the first vehicle otherwise)."""
        return _pywrapcp.RoutingModel_GetHomogeneousCost(self, from_index, to_index)

    def GetArcCostForFirstSolution(self, from_index: "int64", to_index: "int64") -> "int64":
        r""" Returns the cost of the arc in the context of the first solution strategy. This is typically a simplification of the actual cost; see the .cc."""
        return _pywrapcp.RoutingModel_GetArcCostForFirstSolution(self, from_index, to_index)

    def GetArcCostForClass(self, from_index: "int64", to_index: "int64", cost_class_index: "int64") -> "int64":
        r""" Returns the cost of the segment between two nodes for a given cost class. Input are variable indices of nodes and the cost class. Unlike GetArcCostForVehicle(), if cost_class is kNoCost, then the returned cost won't necessarily be zero: only some of the components of the cost that depend on the cost class will be omited. See the code for details."""
        return _pywrapcp.RoutingModel_GetArcCostForClass(self, from_index, to_index, cost_class_index)

    def GetCostClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::CostClassIndex":
        r""" Get the cost class index of the given vehicle."""
        return _pywrapcp.RoutingModel_GetCostClassIndexOfVehicle(self, vehicle)

    def HasVehicleWithCostClassIndex(self, cost_class_index: "operations_research::RoutingModel::CostClassIndex") -> "bool":
        r""" Returns true iff the model contains a vehicle with the given cost_class_index."""
        return _pywrapcp.RoutingModel_HasVehicleWithCostClassIndex(self, cost_class_index)

    def GetCostClassesCount(self) -> "int":
        r""" Returns the number of different cost classes in the model."""
        return _pywrapcp.RoutingModel_GetCostClassesCount(self)

    def GetNonZeroCostClassesCount(self) -> "int":
        r""" Ditto, minus the 'always zero', built-in cost class."""
        return _pywrapcp.RoutingModel_GetNonZeroCostClassesCount(self)

    def GetVehicleClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::VehicleClassIndex":
        return _pywrapcp.RoutingModel_GetVehicleClassIndexOfVehicle(self, vehicle)

    def GetVehicleClassesCount(self) -> "int":
        r""" Returns the number of different vehicle classes in the model."""
        return _pywrapcp.RoutingModel_GetVehicleClassesCount(self)

    def GetSameVehicleIndicesOfIndex(self, node: "int") -> "std::vector< int > const &":
        r""" Returns variable indices of nodes constrained to be on the same route."""
        return _pywrapcp.RoutingModel_GetSameVehicleIndicesOfIndex(self, node)

    def ArcIsMoreConstrainedThanArc(self, _from: "int64", to1: "int64", to2: "int64") -> "bool":
        r""" Returns whether the arc from->to1 is more constrained than from->to2, taking into account, in order: - whether the destination node isn't an end node - whether the destination node is mandatory - whether the destination node is bound to the same vehicle as the source - the "primary constrained" dimension (see SetPrimaryConstrainedDimension) It then breaks ties using, in order: - the arc cost (taking unperformed penalties into account) - the size of the vehicle vars of "to1" and "to2" (lowest size wins) - the value: the lowest value of the indices to1 and to2 wins. See the .cc for details. The more constrained arc is typically preferable when building a first solution. This method is intended to be used as a callback for the BestValueByComparisonSelector value selector. Args:   from: the variable index of the source node   to1: the variable index of the first candidate destination node.   to2: the variable index of the second candidate destination node."""
        return _pywrapcp.RoutingModel_ArcIsMoreConstrainedThanArc(self, _from, to1, to2)

    def DebugOutputAssignment(self, solution_assignment: "Assignment", dimension_to_print: "std::string const &") -> "std::string":
        r""" Print some debugging information about an assignment, including the feasible intervals of the CumulVar for dimension "dimension_to_print" at each step of the routes. If "dimension_to_print" is omitted, all dimensions will be printed."""
        return _pywrapcp.RoutingModel_DebugOutputAssignment(self, solution_assignment, dimension_to_print)

    def solver(self) -> "operations_research::Solver *":
        r""" Returns the underlying constraint solver. Can be used to add extra constraints and/or modify search algoithms."""
        return _pywrapcp.RoutingModel_solver(self)

    def CheckLimit(self) -> "bool":
        r""" Returns true if the search limit has been crossed."""
        return _pywrapcp.RoutingModel_CheckLimit(self)

    def RemainingTime(self) -> "absl::Duration":
        r""" Returns the time left in the search limit."""
        return _pywrapcp.RoutingModel_RemainingTime(self)

    def nodes(self) -> "int":
        r""" Sizes and indices Returns the number of nodes in the model."""
        return _pywrapcp.RoutingModel_nodes(self)

    def vehicles(self) -> "int":
        r""" Returns the number of vehicle routes in the model."""
        return _pywrapcp.RoutingModel_vehicles(self)

    def Size(self) -> "int64":
        r""" Returns the number of next variables in the model."""
        return _pywrapcp.RoutingModel_Size(self)

    def GetNumberOfDecisionsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
        r""" Returns statistics on first solution search, number of decisions sent to filters, number of decisions rejected by filters."""
        return _pywrapcp.RoutingModel_GetNumberOfDecisionsInFirstSolution(self, search_parameters)

    def GetNumberOfRejectsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
        return _pywrapcp.RoutingModel_GetNumberOfRejectsInFirstSolution(self, search_parameters)

    def IsMatchingModel(self) -> "bool":
        r""" Returns true if a vehicle/node matching problem is detected."""
        return _pywrapcp.RoutingModel_IsMatchingModel(self)

    def MakeGuidedSlackFinalizer(self, dimension: "RoutingDimension", initializer: "std::function< int64 (int64) >") -> "operations_research::DecisionBuilder *":
        r""" The next few members are in the public section only for testing purposes. MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a dimension using a callback to choose which values to start with. The finalizer works only when all next variables in the model have been fixed. It has the following two characteristics: 1. It follows the routes defined by the nexts variables when choosing a    variable to make a decision on. 2. When it comes to choose a value for the slack of node i, the decision    builder first calls the callback with argument i, and supposingly the    returned value is x it creates decisions slack[i] = x, slack[i] = x +    1, slack[i] = x - 1, slack[i] = x + 2, etc."""
        return _pywrapcp.RoutingModel_MakeGuidedSlackFinalizer(self, dimension, initializer)

    def MakeSelfDependentDimensionFinalizer(self, dimension: "RoutingDimension") -> "operations_research::DecisionBuilder *":
        r""" MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a self-dependent dimension. It makes an extensive use of the caches of the state dependent transits. In detail, MakeSelfDependentDimensionFinalizer returns a composition of a local search decision builder with a greedy descent operator for the cumul of the start of each route and a guided slack finalizer. Provided there are no time windows and the maximum slacks are large enough, once the cumul of the start of route is fixed, the guided finalizer can find optimal values of the slacks for the rest of the route in time proportional to the length of the route. Therefore the composed finalizer generally works in time O(log(t)*n*m), where t is the latest possible departute time, n is the number of nodes in the network and m is the number of vehicles."""
        return _pywrapcp.RoutingModel_MakeSelfDependentDimensionFinalizer(self, dimension)

    def AddMatrixDimension(self, *args) -> "void":
        return _pywrapcp.RoutingModel_AddMatrixDimension(self, *args)
Class variables

PICKUP_AND_DELIVERY_FIFO

var PICKUP_AND_DELIVERY_FIFO

Deliveries must be performed in the same order as pickups.

PICKUP_AND_DELIVERY_LIFO

var PICKUP_AND_DELIVERY_LIFO

Deliveries must be performed in reverse order of pickups.

PICKUP_AND_DELIVERY_NO_ORDER

var PICKUP_AND_DELIVERY_NO_ORDER

Any precedence is accepted.

ROUTING_FAIL

var ROUTING_FAIL

No solution found to the problem after calling RoutingModel::Solve().

ROUTING_FAIL_TIMEOUT

var ROUTING_FAIL_TIMEOUT

Time limit reached before finding a solution with RoutingModel::Solve().

ROUTING_INVALID

var ROUTING_INVALID

Model, model parameters or flags are not valid.

ROUTING_NOT_SOLVED

var ROUTING_NOT_SOLVED

Problem not solved yet (before calling RoutingModel::Solve()).

ROUTING_SUCCESS

var ROUTING_SUCCESS

Problem solved successfully after calling RoutingModel::Solve().

kNoDimension

var kNoDimension

Swig object carries a C/C++ instance pointer

kNoDisjunction

var kNoDisjunction

Swig object carries a C/C++ instance pointer

kNoPenalty

var kNoPenalty

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

>>> int('0b100', base=0)
4
Instance variables

thisown

var thisown

The membership flag

Expand source code
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
Methods

ActiveVar

def ActiveVar(self, index)

Returns the active variable of the node corresponding to index.

Expand source code
def ActiveVar(self, index: "int64") -> "operations_research::IntVar *":
    r""" Returns the active variable of the node corresponding to index."""
    return _pywrapcp.RoutingModel_ActiveVar(self, index)

AddAtSolutionCallback

def AddAtSolutionCallback(self, callback)

Adds a callback called each time a solution is found during the search. This is a shortcut to creating a monitor to call the callback on AtSolution() and adding it with AddSearchMonitor.

Expand source code
def AddAtSolutionCallback(self, callback: "std::function< void () >") -> "void":
    r""" Adds a callback called each time a solution is found during the search. This is a shortcut to creating a monitor to call the callback on AtSolution() and adding it with AddSearchMonitor."""
    return _pywrapcp.RoutingModel_AddAtSolutionCallback(self, callback)

AddConstantDimension

def AddConstantDimension(self, value, capacity, fix_start_cumul_to_zero, name)
Expand source code
def AddConstantDimension(self, value: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    return _pywrapcp.RoutingModel_AddConstantDimension(self, value, capacity, fix_start_cumul_to_zero, name)

AddConstantDimensionWithSlack

def AddConstantDimensionWithSlack(self, value, capacity, slack_max, fix_start_cumul_to_zero, name)

Creates a dimension where the transit variable is constrained to be equal to 'value'; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension).

Expand source code
def AddConstantDimensionWithSlack(self, value: "int64", capacity: "int64", slack_max: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    r""" Creates a dimension where the transit variable is constrained to be equal to 'value'; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
    return _pywrapcp.RoutingModel_AddConstantDimensionWithSlack(self, value, capacity, slack_max, fix_start_cumul_to_zero, name)

AddDimension

def AddDimension(self, evaluator_index, slack_max, capacity, fix_start_cumul_to_zero, name)

Model creation Methods to add dimensions to routes; dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumul(j) = cumul(i) + transit(i) + slack(i) where slack is a positive slack variable (can represent waiting times for a time dimension). Setting the value of fix_start_cumul_to_zero to true will force the "cumul" variable of the start node of all vehicles to be equal to 0. Creates a dimension where the transit variable is constrained to be equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the slack variable and 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension). Takes ownership of the callback 'evaluator'.

Expand source code
def AddDimension(self, evaluator_index: "int", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    r""" Model creation Methods to add dimensions to routes; dimensions represent quantities accumulated at nodes along the routes. They represent quantities such as weights or volumes carried along the route, or distance or times. Quantities at a node are represented by "cumul" variables and the increase or decrease of quantities between nodes are represented by "transit" variables. These variables are linked as follows: if j == next(i), cumul(j) = cumul(i) + transit(i) + slack(i) where slack is a positive slack variable (can represent waiting times for a time dimension). Setting the value of fix_start_cumul_to_zero to true will force the "cumul" variable of the start node of all vehicles to be equal to 0. Creates a dimension where the transit variable is constrained to be equal to evaluator(i, next(i)); 'slack_max' is the upper bound of the slack variable and 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension). Takes ownership of the callback 'evaluator'."""
    return _pywrapcp.RoutingModel_AddDimension(self, evaluator_index, slack_max, capacity, fix_start_cumul_to_zero, name)

AddDimensionWithVehicleCapacity

def AddDimensionWithVehicleCapacity(self, evaluator_index, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)
Expand source code
def AddDimensionWithVehicleCapacity(self, evaluator_index: "int", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    return _pywrapcp.RoutingModel_AddDimensionWithVehicleCapacity(self, evaluator_index, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

AddDimensionWithVehicleTransitAndCapacity

def AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)
Expand source code
def AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", vehicle_capacities: "std::vector< int64 >", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransitAndCapacity(self, evaluator_indices, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name)

AddDimensionWithVehicleTransits

def AddDimensionWithVehicleTransits(self, evaluator_indices, slack_max, capacity, fix_start_cumul_to_zero, name)
Expand source code
def AddDimensionWithVehicleTransits(self, evaluator_indices: "std::vector< int > const &", slack_max: "int64", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    return _pywrapcp.RoutingModel_AddDimensionWithVehicleTransits(self, evaluator_indices, slack_max, capacity, fix_start_cumul_to_zero, name)

AddDisjunction

def AddDisjunction(self, *args)

Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active. Start and end indices of any vehicle cannot be part of a disjunction. If a penalty is given, at most 'max_cardinality' of the indices can be active, and if less are active, 'penalty' is payed per inactive index. This is equivalent to adding the constraint: p + Sum(i)active[i] == max_cardinality where p is an integer variable, and the following cost to the cost function: p * penalty. 'penalty' must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited.

Expand source code
def AddDisjunction(self, *args) -> "operations_research::RoutingModel::DisjunctionIndex":
    r""" Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active. Start and end indices of any vehicle cannot be part of a disjunction. If a penalty is given, at most 'max_cardinality' of the indices can be active, and if less are active, 'penalty' is payed per inactive index. This is equivalent to adding the constraint:     p + Sum(i)active[i] == max_cardinality where p is an integer variable, and the following cost to the cost function:     p * penalty. 'penalty' must be positive to make the disjunction optional; a negative penalty will force 'max_cardinality' indices of the disjunction to be performed, and therefore p == 0. Note: passing a vector with a single index will model an optional index with a penalty cost if it is not visited."""
    return _pywrapcp.RoutingModel_AddDisjunction(self, *args)

AddHardTypeIncompatibility

def AddHardTypeIncompatibility(self, type1, type2)

Incompatibilities: Two nodes with "hard" incompatible types cannot share the same route at all, while with a "temporal" incompatibility they can't be on the same route at the same time.

Expand source code
def AddHardTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
    r""" Incompatibilities: Two nodes with "hard" incompatible types cannot share the same route at all, while with a "temporal" incompatibility they can't be on the same route at the same time."""
    return _pywrapcp.RoutingModel_AddHardTypeIncompatibility(self, type1, type2)

AddIntervalToAssignment

def AddIntervalToAssignment(self, interval)
Expand source code
def AddIntervalToAssignment(self, interval: "IntervalVar") -> "void":
    return _pywrapcp.RoutingModel_AddIntervalToAssignment(self, interval)

AddLocalSearchFilter

def AddLocalSearchFilter(self, filter)

Adds a custom local search filter to the list of filters used to speed up local search by pruning unfeasible variable assignments. Calling this method after the routing model has been closed (CloseModel() or Solve() has been called) has no effect. The routing model does not take ownership of the filter.

Expand source code
def AddLocalSearchFilter(self, filter: "LocalSearchFilter") -> "void":
    r""" Adds a custom local search filter to the list of filters used to speed up local search by pruning unfeasible variable assignments. Calling this method after the routing model has been closed (CloseModel() or Solve() has been called) has no effect. The routing model does not take ownership of the filter."""
    return _pywrapcp.RoutingModel_AddLocalSearchFilter(self, filter)

AddLocalSearchOperator

def AddLocalSearchOperator(self, ls_operator)

Adds a local search operator to the set of operators used to solve the vehicle routing problem.

Expand source code
def AddLocalSearchOperator(self, ls_operator: "LocalSearchOperator") -> "void":
    r""" Adds a local search operator to the set of operators used to solve the vehicle routing problem."""
    return _pywrapcp.RoutingModel_AddLocalSearchOperator(self, ls_operator)

AddMatrixDimension

def AddMatrixDimension(self, *args)
Expand source code
def AddMatrixDimension(self, *args) -> "void":
    return _pywrapcp.RoutingModel_AddMatrixDimension(self, *args)

AddPickupAndDelivery

def AddPickupAndDelivery(self, pickup, delivery)

Notifies that index1 and index2 form a pair of nodes which should belong to the same route. This methods helps the search find better solutions, especially in the local search phase. It should be called each time you have an equality constraint linking the vehicle variables of two node (including for instance pickup and delivery problems): Solver* const solver = routing.solver(); int64 index1 = manager.NodeToIndex(node1); int64 index2 = manager.NodeToIndex(node2); solver->AddConstraint(solver->MakeEquality( routing.VehicleVar(index1), routing.VehicleVar(index2))); routing.AddPickupAndDelivery(index1, index2);

Expand source code
def AddPickupAndDelivery(self, pickup: "int64", delivery: "int64") -> "void":
    r""" Notifies that index1 and index2 form a pair of nodes which should belong to the same route. This methods helps the search find better solutions, especially in the local search phase. It should be called each time you have an equality constraint linking the vehicle variables of two node (including for instance pickup and delivery problems):     Solver* const solver = routing.solver();     int64 index1 = manager.NodeToIndex(node1);     int64 index2 = manager.NodeToIndex(node2);     solver->AddConstraint(solver->MakeEquality(         routing.VehicleVar(index1),         routing.VehicleVar(index2)));     routing.AddPickupAndDelivery(index1, index2);"""
    return _pywrapcp.RoutingModel_AddPickupAndDelivery(self, pickup, delivery)

AddPickupAndDeliverySets

def AddPickupAndDeliverySets(self, pickup_disjunction, delivery_disjunction)

Same as AddPickupAndDelivery but notifying that the performed node from the disjunction of index 'pickup_disjunction' is on the same route as the performed node from the disjunction of index 'delivery_disjunction'.

Expand source code
def AddPickupAndDeliverySets(self, pickup_disjunction: "operations_research::RoutingModel::DisjunctionIndex", delivery_disjunction: "operations_research::RoutingModel::DisjunctionIndex") -> "void":
    r""" Same as AddPickupAndDelivery but notifying that the performed node from the disjunction of index 'pickup_disjunction' is on the same route as the performed node from the disjunction of index 'delivery_disjunction'."""
    return _pywrapcp.RoutingModel_AddPickupAndDeliverySets(self, pickup_disjunction, delivery_disjunction)

AddSameVehicleRequiredTypeAlternatives

def AddSameVehicleRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

Requirements: NOTE: As of 2019-04, cycles in the requirement graph are not supported, and lead to the dependent nodes being skipped if possible (otherwise the model is considered infeasible). The following functions specify that "dependent_type" requires at least one of the types in "required_type_alternatives". For same-vehicle requirements, a node of dependent type type_D requires at least one node of type type_R among the required alternatives on the same route.

Expand source code
def AddSameVehicleRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
    r""" Requirements: NOTE: As of 2019-04, cycles in the requirement graph are not supported, and lead to the dependent nodes being skipped if possible (otherwise the model is considered infeasible). The following functions specify that "dependent_type" requires at least one of the types in "required_type_alternatives". For same-vehicle requirements, a node of dependent type type_D requires at least one node of type type_R among the required alternatives on the same route."""
    return _pywrapcp.RoutingModel_AddSameVehicleRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

AddSearchMonitor

def AddSearchMonitor(self, monitor)

Adds a search monitor to the search used to solve the routing model.

Expand source code
def AddSearchMonitor(self, monitor: "SearchMonitor") -> "void":
    r""" Adds a search monitor to the search used to solve the routing model."""
    return _pywrapcp.RoutingModel_AddSearchMonitor(self, monitor)

AddSoftSameVehicleConstraint

def AddSoftSameVehicleConstraint(self, indices, cost)

Adds a soft contraint to force a set of variable indices to be on the same vehicle. If all nodes are not on the same vehicle, each extra vehicle used adds 'cost' to the cost function.

Expand source code
def AddSoftSameVehicleConstraint(self, indices: "std::vector< int64 > const &", cost: "int64") -> "void":
    r""" Adds a soft contraint to force a set of variable indices to be on the same vehicle. If all nodes are not on the same vehicle, each extra vehicle used adds 'cost' to the cost function."""
    return _pywrapcp.RoutingModel_AddSoftSameVehicleConstraint(self, indices, cost)

AddTemporalRequiredTypeAlternatives

def AddTemporalRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

If type_D temporally depends on type_R, any non-delivery node_D of type_D requires at least one non-delivered node of type_R on its vehicle at the time node_D is visited.

Expand source code
def AddTemporalRequiredTypeAlternatives(self, dependent_type: "int", required_type_alternatives: "absl::flat_hash_set< int >") -> "void":
    r""" If type_D temporally depends on type_R, any non-delivery node_D of type_D requires at least one non-delivered node of type_R on its vehicle at the time node_D is visited."""
    return _pywrapcp.RoutingModel_AddTemporalRequiredTypeAlternatives(self, dependent_type, required_type_alternatives)

AddTemporalTypeIncompatibility

def AddTemporalTypeIncompatibility(self, type1, type2)
Expand source code
def AddTemporalTypeIncompatibility(self, type1: "int", type2: "int") -> "void":
    return _pywrapcp.RoutingModel_AddTemporalTypeIncompatibility(self, type1, type2)

AddToAssignment

def AddToAssignment(self, var)

Adds an extra variable to the vehicle routing assignment.

Expand source code
def AddToAssignment(self, var: "IntVar") -> "void":
    r""" Adds an extra variable to the vehicle routing assignment."""
    return _pywrapcp.RoutingModel_AddToAssignment(self, var)

AddVariableMaximizedByFinalizer

def AddVariableMaximizedByFinalizer(self, var)

Adds a variable to maximize in the solution finalizer (see above for information on the solution finalizer).

Expand source code
def AddVariableMaximizedByFinalizer(self, var: "IntVar") -> "void":
    r""" Adds a variable to maximize in the solution finalizer (see above for information on the solution finalizer)."""
    return _pywrapcp.RoutingModel_AddVariableMaximizedByFinalizer(self, var)

AddVariableMinimizedByFinalizer

def AddVariableMinimizedByFinalizer(self, var)

Adds a variable to minimize in the solution finalizer. The solution finalizer is called each time a solution is found during the search and allows to instantiate secondary variables (such as dimension cumul variables).

Expand source code
def AddVariableMinimizedByFinalizer(self, var: "IntVar") -> "void":
    r""" Adds a variable to minimize in the solution finalizer. The solution finalizer is called each time a solution is found during the search and allows to instantiate secondary variables (such as dimension cumul variables)."""
    return _pywrapcp.RoutingModel_AddVariableMinimizedByFinalizer(self, var)

AddVariableTargetToFinalizer

def AddVariableTargetToFinalizer(self, var, target)

Add a variable to set the closest possible to the target value in the solution finalizer.

Expand source code
def AddVariableTargetToFinalizer(self, var: "IntVar", target: "int64") -> "void":
    r""" Add a variable to set the closest possible to the target value in the solution finalizer."""
    return _pywrapcp.RoutingModel_AddVariableTargetToFinalizer(self, var, target)

AddVectorDimension

def AddVectorDimension(self, values, capacity, fix_start_cumul_to_zero, name)

Creates a dimension where the transit variable is constrained to be equal to 'values[i]' for node i; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension).

Expand source code
def AddVectorDimension(self, values: "std::vector< int64 >", capacity: "int64", fix_start_cumul_to_zero: "bool", name: "std::string const &") -> "bool":
    r""" Creates a dimension where the transit variable is constrained to be equal to 'values[i]' for node i; 'capacity' is the upper bound of the cumul variables. 'name' is the name used to reference the dimension; this name is used to get cumul and transit variables from the routing model. Returns false if a dimension with the same name has already been created (and doesn't create the new dimension)."""
    return _pywrapcp.RoutingModel_AddVectorDimension(self, values, capacity, fix_start_cumul_to_zero, name)

AddWeightedVariableMinimizedByFinalizer

def AddWeightedVariableMinimizedByFinalizer(self, var, cost)

Adds a variable to minimize in the solution finalizer, with a weighted priority: the higher the more priority it has.

Expand source code
def AddWeightedVariableMinimizedByFinalizer(self, var: "IntVar", cost: "int64") -> "void":
    r""" Adds a variable to minimize in the solution finalizer, with a weighted priority: the higher the more priority it has."""
    return _pywrapcp.RoutingModel_AddWeightedVariableMinimizedByFinalizer(self, var, cost)

ApplyLocks

def ApplyLocks(self, locks)

Applies a lock chain to the next search. 'locks' represents an ordered vector of nodes representing a partial route which will be fixed during the next search; it will constrain next variables such that: next[locks[i]] == locks[i+1]. Returns the next variable at the end of the locked chain; this variable is not locked. An assignment containing the locks can be obtained by calling PreAssignment().

Expand source code
def ApplyLocks(self, locks: "std::vector< int64 > const &") -> "operations_research::IntVar *":
    r""" Applies a lock chain to the next search. 'locks' represents an ordered vector of nodes representing a partial route which will be fixed during the next search; it will constrain next variables such that: next[locks[i]] == locks[i+1]. Returns the next variable at the end of the locked chain; this variable is not locked. An assignment containing the locks can be obtained by calling PreAssignment()."""
    return _pywrapcp.RoutingModel_ApplyLocks(self, locks)

ApplyLocksToAllVehicles

def ApplyLocksToAllVehicles(self, locks, close_routes)

Applies lock chains to all vehicles to the next search, such that locks[p] is the lock chain for route p. Returns false if the locks do not contain valid routes; expects that the routes do not contain the depots, i.e. there are empty vectors in place of empty routes. If close_routes is set to true, adds the end nodes to the route of each vehicle and deactivates other nodes. An assignment containing the locks can be obtained by calling PreAssignment().

Expand source code
def ApplyLocksToAllVehicles(self, locks: "std::vector< std::vector< int64 > > const &", close_routes: "bool") -> "bool":
    r""" Applies lock chains to all vehicles to the next search, such that locks[p] is the lock chain for route p. Returns false if the locks do not contain valid routes; expects that the routes do not contain the depots, i.e. there are empty vectors in place of empty routes. If close_routes is set to true, adds the end nodes to the route of each vehicle and deactivates other nodes. An assignment containing the locks can be obtained by calling PreAssignment()."""
    return _pywrapcp.RoutingModel_ApplyLocksToAllVehicles(self, locks, close_routes)

ArcIsMoreConstrainedThanArc

def ArcIsMoreConstrainedThanArc(self, _from, to1, to2)

Returns whether the arc from->to1 is more constrained than from->to2, taking into account, in order: - whether the destination node isn't an end node - whether the destination node is mandatory - whether the destination node is bound to the same vehicle as the source - the "primary constrained" dimension (see SetPrimaryConstrainedDimension) It then breaks ties using, in order: - the arc cost (taking unperformed penalties into account) - the size of the vehicle vars of "to1" and "to2" (lowest size wins) - the value: the lowest value of the indices to1 and to2 wins. See the .cc for details. The more constrained arc is typically preferable when building a first solution. This method is intended to be used as a callback for the BestValueByComparisonSelector value selector. Args: from: the variable index of the source node to1: the variable index of the first candidate destination node. to2: the variable index of the second candidate destination node.

Expand source code
def ArcIsMoreConstrainedThanArc(self, _from: "int64", to1: "int64", to2: "int64") -> "bool":
    r""" Returns whether the arc from->to1 is more constrained than from->to2, taking into account, in order: - whether the destination node isn't an end node - whether the destination node is mandatory - whether the destination node is bound to the same vehicle as the source - the "primary constrained" dimension (see SetPrimaryConstrainedDimension) It then breaks ties using, in order: - the arc cost (taking unperformed penalties into account) - the size of the vehicle vars of "to1" and "to2" (lowest size wins) - the value: the lowest value of the indices to1 and to2 wins. See the .cc for details. The more constrained arc is typically preferable when building a first solution. This method is intended to be used as a callback for the BestValueByComparisonSelector value selector. Args:   from: the variable index of the source node   to1: the variable index of the first candidate destination node.   to2: the variable index of the second candidate destination node."""
    return _pywrapcp.RoutingModel_ArcIsMoreConstrainedThanArc(self, _from, to1, to2)

AreEmptyRouteCostsConsideredForVehicle

def AreEmptyRouteCostsConsideredForVehicle(self, vehicle)
Expand source code
def AreEmptyRouteCostsConsideredForVehicle(self, vehicle: "int") -> "bool":
    return _pywrapcp.RoutingModel_AreEmptyRouteCostsConsideredForVehicle(self, vehicle)

AssignmentToRoutes

def AssignmentToRoutes(self, assignment, routes)

Converts the solution in the given assignment to routes for all vehicles. Expects that assignment contains a valid solution (i.e. routes for all vehicles end with an end index for that vehicle).

Expand source code
def AssignmentToRoutes(self, assignment: "Assignment", routes: "std::vector< std::vector< int64 > > *const") -> "void":
    r""" Converts the solution in the given assignment to routes for all vehicles. Expects that assignment contains a valid solution (i.e. routes for all vehicles end with an end index for that vehicle)."""
    return _pywrapcp.RoutingModel_AssignmentToRoutes(self, assignment, routes)

CheckLimit

def CheckLimit(self)

Returns true if the search limit has been crossed.

Expand source code
def CheckLimit(self) -> "bool":
    r""" Returns true if the search limit has been crossed."""
    return _pywrapcp.RoutingModel_CheckLimit(self)

CloseModel

def CloseModel(self)

Closes the current routing model; after this method is called, no modification to the model can be done, but RoutesToAssignment becomes available. Note that CloseModel() is automatically called by Solve() and other methods that produce solution. This is equivalent to calling CloseModelWithParameters(DefaultRoutingSearchParameters()).

Expand source code
def CloseModel(self) -> "void":
    r""" Closes the current routing model; after this method is called, no modification to the model can be done, but RoutesToAssignment becomes available. Note that CloseModel() is automatically called by Solve() and other methods that produce solution. This is equivalent to calling CloseModelWithParameters(DefaultRoutingSearchParameters())."""
    return _pywrapcp.RoutingModel_CloseModel(self)

CloseModelWithParameters

def CloseModelWithParameters(self, search_parameters)

Same as above taking search parameters (as of 10/2015 some the parameters have to be set when closing the model).

Expand source code
def CloseModelWithParameters(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "void":
    r""" Same as above taking search parameters (as of 10/2015 some the parameters have to be set when closing the model)."""
    return _pywrapcp.RoutingModel_CloseModelWithParameters(self, search_parameters)

CloseVisitTypes

def CloseVisitTypes(self)

This function should be called once all node visit types have been set and prior to adding any incompatibilities/requirements. "close" types.

Expand source code
def CloseVisitTypes(self) -> "void":
    r""" This function should be called once all node visit types have been set and prior to adding any incompatibilities/requirements. "close" types."""
    return _pywrapcp.RoutingModel_CloseVisitTypes(self)

CompactAndCheckAssignment

def CompactAndCheckAssignment(self, assignment)

Same as CompactAssignment() but also checks the validity of the final compact solution; if it is not valid, no attempts to repair it are made (instead, the method returns nullptr).

Expand source code
def CompactAndCheckAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
    r""" Same as CompactAssignment() but also checks the validity of the final compact solution; if it is not valid, no attempts to repair it are made (instead, the method returns nullptr)."""
    return _pywrapcp.RoutingModel_CompactAndCheckAssignment(self, assignment)

CompactAssignment

def CompactAssignment(self, assignment)

Returns a compacted version of the given assignment, in which all vehicles with id lower or equal to some N have non-empty routes, and all vehicles with id greater than N have empty routes. Does not take ownership of the returned object. If found, the cost of the compact assignment is the same as in the original assignment and it preserves the values of 'active' variables. Returns nullptr if a compact assignment was not found. This method only works in homogenous mode, and it only swaps equivalent vehicles (vehicles with the same start and end nodes). When creating the compact assignment, the empty plan is replaced by the route assigned to the compatible vehicle with the highest id. Note that with more complex constraints on vehicle variables, this method might fail even if a compact solution exists. This method changes the vehicle and dimension variables as necessary. While compacting the solution, only basic checks on vehicle variables are performed; if one of these checks fails no attempts to repair it are made (instead, the method returns nullptr).

Expand source code
def CompactAssignment(self, assignment: "Assignment") -> "operations_research::Assignment *":
    r""" Returns a compacted version of the given assignment, in which all vehicles with id lower or equal to some N have non-empty routes, and all vehicles with id greater than N have empty routes. Does not take ownership of the returned object. If found, the cost of the compact assignment is the same as in the original assignment and it preserves the values of 'active' variables. Returns nullptr if a compact assignment was not found. This method only works in homogenous mode, and it only swaps equivalent vehicles (vehicles with the same start and end nodes). When creating the compact assignment, the empty plan is replaced by the route assigned to the compatible vehicle with the highest id. Note that with more complex constraints on vehicle variables, this method might fail even if a compact solution exists. This method changes the vehicle and dimension variables as necessary. While compacting the solution, only basic checks on vehicle variables are performed; if one of these checks fails no attempts to repair it are made (instead, the method returns nullptr)."""
    return _pywrapcp.RoutingModel_CompactAssignment(self, assignment)

ComputeLowerBound

def ComputeLowerBound(self)

Computes a lower bound to the routing problem solving a linear assignment problem. The routing model must be closed before calling this method. Note that problems with node disjunction constraints (including optional nodes) and non-homogenous costs are not supported (the method returns 0 in these cases).

Expand source code
def ComputeLowerBound(self) -> "int64":
    r""" Computes a lower bound to the routing problem solving a linear assignment problem. The routing model must be closed before calling this method. Note that problems with node disjunction constraints (including optional nodes) and non-homogenous costs are not supported (the method returns 0 in these cases)."""
    return _pywrapcp.RoutingModel_ComputeLowerBound(self)

ConsiderEmptyRouteCostsForVehicle

def ConsiderEmptyRouteCostsForVehicle(self, consider_costs, vehicle)
Expand source code
def ConsiderEmptyRouteCostsForVehicle(self, consider_costs: "bool", vehicle: "int") -> "void":
    return _pywrapcp.RoutingModel_ConsiderEmptyRouteCostsForVehicle(self, consider_costs, vehicle)

CostVar

def CostVar(self)

Returns the global cost variable which is being minimized.

Expand source code
def CostVar(self) -> "operations_research::IntVar *":
    r""" Returns the global cost variable which is being minimized."""
    return _pywrapcp.RoutingModel_CostVar(self)

CostsAreHomogeneousAcrossVehicles

def CostsAreHomogeneousAcrossVehicles(self)

Whether costs are homogeneous across all vehicles.

Expand source code
def CostsAreHomogeneousAcrossVehicles(self) -> "bool":
    r""" Whether costs are homogeneous across all vehicles."""
    return _pywrapcp.RoutingModel_CostsAreHomogeneousAcrossVehicles(self)

DebugOutputAssignment

def DebugOutputAssignment(self, solution_assignment, dimension_to_print)

Print some debugging information about an assignment, including the feasible intervals of the CumulVar for dimension "dimension_to_print" at each step of the routes. If "dimension_to_print" is omitted, all dimensions will be printed.

Expand source code
def DebugOutputAssignment(self, solution_assignment: "Assignment", dimension_to_print: "std::string const &") -> "std::string":
    r""" Print some debugging information about an assignment, including the feasible intervals of the CumulVar for dimension "dimension_to_print" at each step of the routes. If "dimension_to_print" is omitted, all dimensions will be printed."""
    return _pywrapcp.RoutingModel_DebugOutputAssignment(self, solution_assignment, dimension_to_print)

End

def End(self, vehicle)

Returns the variable index of the ending node of a vehicle route.

Expand source code
def End(self, vehicle: "int") -> "int64":
    r""" Returns the variable index of the ending node of a vehicle route."""
    return _pywrapcp.RoutingModel_End(self, vehicle)

GetAllDimensionNames

def GetAllDimensionNames(self)

Outputs the names of all dimensions added to the routing engine.

Expand source code
def GetAllDimensionNames(self) -> "std::vector< ::std::string >":
    r""" Outputs the names of all dimensions added to the routing engine."""
    return _pywrapcp.RoutingModel_GetAllDimensionNames(self)

GetAmortizedLinearCostFactorOfVehicles

def GetAmortizedLinearCostFactorOfVehicles(self)
Expand source code
def GetAmortizedLinearCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
    return _pywrapcp.RoutingModel_GetAmortizedLinearCostFactorOfVehicles(self)

GetAmortizedQuadraticCostFactorOfVehicles

def GetAmortizedQuadraticCostFactorOfVehicles(self)
Expand source code
def GetAmortizedQuadraticCostFactorOfVehicles(self) -> "std::vector< int64 > const &":
    return _pywrapcp.RoutingModel_GetAmortizedQuadraticCostFactorOfVehicles(self)

GetArcCostForClass

def GetArcCostForClass(self, from_index, to_index, cost_class_index)

Returns the cost of the segment between two nodes for a given cost class. Input are variable indices of nodes and the cost class. Unlike GetArcCostForVehicle(), if cost_class is kNoCost, then the returned cost won't necessarily be zero: only some of the components of the cost that depend on the cost class will be omited. See the code for details.

Expand source code
def GetArcCostForClass(self, from_index: "int64", to_index: "int64", cost_class_index: "int64") -> "int64":
    r""" Returns the cost of the segment between two nodes for a given cost class. Input are variable indices of nodes and the cost class. Unlike GetArcCostForVehicle(), if cost_class is kNoCost, then the returned cost won't necessarily be zero: only some of the components of the cost that depend on the cost class will be omited. See the code for details."""
    return _pywrapcp.RoutingModel_GetArcCostForClass(self, from_index, to_index, cost_class_index)

GetArcCostForFirstSolution

def GetArcCostForFirstSolution(self, from_index, to_index)

Returns the cost of the arc in the context of the first solution strategy. This is typically a simplification of the actual cost; see the .cc.

Expand source code
def GetArcCostForFirstSolution(self, from_index: "int64", to_index: "int64") -> "int64":
    r""" Returns the cost of the arc in the context of the first solution strategy. This is typically a simplification of the actual cost; see the .cc."""
    return _pywrapcp.RoutingModel_GetArcCostForFirstSolution(self, from_index, to_index)

GetArcCostForVehicle

def GetArcCostForVehicle(self, from_index, to_index, vehicle)

Returns the cost of the transit arc between two nodes for a given vehicle. Input are variable indices of node. This returns 0 if vehicle < 0.

Expand source code
def GetArcCostForVehicle(self, from_index: "int64", to_index: "int64", vehicle: "int64") -> "int64":
    r""" Returns the cost of the transit arc between two nodes for a given vehicle. Input are variable indices of node. This returns 0 if vehicle < 0."""
    return _pywrapcp.RoutingModel_GetArcCostForVehicle(self, from_index, to_index, vehicle)

GetCostClassIndexOfVehicle

def GetCostClassIndexOfVehicle(self, vehicle)

Get the cost class index of the given vehicle.

Expand source code
def GetCostClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::CostClassIndex":
    r""" Get the cost class index of the given vehicle."""
    return _pywrapcp.RoutingModel_GetCostClassIndexOfVehicle(self, vehicle)

GetCostClassesCount

def GetCostClassesCount(self)

Returns the number of different cost classes in the model.

Expand source code
def GetCostClassesCount(self) -> "int":
    r""" Returns the number of different cost classes in the model."""
    return _pywrapcp.RoutingModel_GetCostClassesCount(self)

GetDeliveryIndexPairs

def GetDeliveryIndexPairs(self, node_index)

Same as above for deliveries.

Expand source code
def GetDeliveryIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
    r""" Same as above for deliveries."""
    return _pywrapcp.RoutingModel_GetDeliveryIndexPairs(self, node_index)

GetDepot

def GetDepot(self)

Returns the variable index of the first starting or ending node of all routes. If all routes start and end at the same node (single depot), this is the node returned.

Expand source code
def GetDepot(self) -> "int64":
    r""" Returns the variable index of the first starting or ending node of all routes. If all routes start  and end at the same node (single depot), this is the node returned."""
    return _pywrapcp.RoutingModel_GetDepot(self)

GetDimensionOrDie

def GetDimensionOrDie(self, dimension_name)

Returns a dimension from its name. Dies if the dimension does not exist.

Expand source code
def GetDimensionOrDie(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension const &":
    r""" Returns a dimension from its name. Dies if the dimension does not exist."""
    return _pywrapcp.RoutingModel_GetDimensionOrDie(self, dimension_name)

GetDimensions

def GetDimensions(self)

Returns all dimensions of the model.

Expand source code
def GetDimensions(self) -> "std::vector< operations_research::RoutingDimension * > const &":
    r""" Returns all dimensions of the model."""
    return _pywrapcp.RoutingModel_GetDimensions(self)

GetDimensionsWithSoftOrSpanCosts

def GetDimensionsWithSoftOrSpanCosts(self)

Returns dimensions with soft or vehicle span costs.

Expand source code
def GetDimensionsWithSoftOrSpanCosts(self) -> "std::vector< operations_research::RoutingDimension * >":
    r""" Returns dimensions with soft or vehicle span costs."""
    return _pywrapcp.RoutingModel_GetDimensionsWithSoftOrSpanCosts(self)

GetDisjunctionIndices

def GetDisjunctionIndices(self, index)

Returns the indices of the disjunctions to which an index belongs.

Expand source code
def GetDisjunctionIndices(self, index: "int64") -> "std::vector< operations_research::RoutingModel::DisjunctionIndex > const &":
    r""" Returns the indices of the disjunctions to which an index belongs."""
    return _pywrapcp.RoutingModel_GetDisjunctionIndices(self, index)

GetDisjunctionMaxCardinality

def GetDisjunctionMaxCardinality(self, index)

Returns the maximum number of possible active nodes of the node disjunction of index 'index'.

Expand source code
def GetDisjunctionMaxCardinality(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
    r""" Returns the maximum number of possible active nodes of the node disjunction of index 'index'."""
    return _pywrapcp.RoutingModel_GetDisjunctionMaxCardinality(self, index)

GetDisjunctionPenalty

def GetDisjunctionPenalty(self, index)

Returns the penalty of the node disjunction of index 'index'.

Expand source code
def GetDisjunctionPenalty(self, index: "operations_research::RoutingModel::DisjunctionIndex") -> "int64":
    r""" Returns the penalty of the node disjunction of index 'index'."""
    return _pywrapcp.RoutingModel_GetDisjunctionPenalty(self, index)

GetFixedCostOfVehicle

def GetFixedCostOfVehicle(self, vehicle)

Returns the route fixed cost taken into account if the route of the vehicle is not empty, aka there's at least one node on the route other than the first and last nodes.

Expand source code
def GetFixedCostOfVehicle(self, vehicle: "int") -> "int64":
    r""" Returns the route fixed cost taken into account if the route of the vehicle is not empty, aka there's at least one node on the route other than the first and last nodes."""
    return _pywrapcp.RoutingModel_GetFixedCostOfVehicle(self, vehicle)

GetGlobalDimensionCumulOptimizers

def GetGlobalDimensionCumulOptimizers(self)

Returns [global|local]dimension_optimizers, which are empty if the model has not been closed.

Expand source code
def GetGlobalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::GlobalDimensionCumulOptimizer > > const &":
    r""" Returns [global|local]_dimension_optimizers_, which are empty if the model has not been closed."""
    return _pywrapcp.RoutingModel_GetGlobalDimensionCumulOptimizers(self)

GetHardTypeIncompatibilitiesOfType

def GetHardTypeIncompatibilitiesOfType(self, type)

Returns visit types incompatible with a given type.

Expand source code
def GetHardTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
    r""" Returns visit types incompatible with a given type."""
    return _pywrapcp.RoutingModel_GetHardTypeIncompatibilitiesOfType(self, type)

GetHomogeneousCost

def GetHomogeneousCost(self, from_index, to_index)

Returns the cost of the segment between two nodes supposing all vehicle costs are the same (returns the cost for the first vehicle otherwise).

Expand source code
def GetHomogeneousCost(self, from_index: "int64", to_index: "int64") -> "int64":
    r""" Returns the cost of the segment between two nodes supposing all vehicle costs are the same (returns the cost for the first vehicle otherwise)."""
    return _pywrapcp.RoutingModel_GetHomogeneousCost(self, from_index, to_index)

GetLocalDimensionCumulOptimizers

def GetLocalDimensionCumulOptimizers(self)
Expand source code
def GetLocalDimensionCumulOptimizers(self) -> "std::vector< std::unique_ptr< operations_research::LocalDimensionCumulOptimizer > > const &":
    return _pywrapcp.RoutingModel_GetLocalDimensionCumulOptimizers(self)

GetMutableDimension

def GetMutableDimension(self, dimension_name)

Returns a dimension from its name. Returns nullptr if the dimension does not exist.

Expand source code
def GetMutableDimension(self, dimension_name: "std::string const &") -> "operations_research::RoutingDimension *":
    r""" Returns a dimension from its name. Returns nullptr if the dimension does not exist."""
    return _pywrapcp.RoutingModel_GetMutableDimension(self, dimension_name)

GetMutableGlobalCumulOptimizer

def GetMutableGlobalCumulOptimizer(self, dimension)

Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none.

Expand source code
def GetMutableGlobalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::GlobalDimensionCumulOptimizer *":
    r""" Returns the global/local dimension cumul optimizer for a given dimension, or nullptr if there is none."""
    return _pywrapcp.RoutingModel_GetMutableGlobalCumulOptimizer(self, dimension)

GetMutableLocalCumulOptimizer

def GetMutableLocalCumulOptimizer(self, dimension)
Expand source code
def GetMutableLocalCumulOptimizer(self, dimension: "RoutingDimension") -> "operations_research::LocalDimensionCumulOptimizer *":
    return _pywrapcp.RoutingModel_GetMutableLocalCumulOptimizer(self, dimension)

GetNonZeroCostClassesCount

def GetNonZeroCostClassesCount(self)

Ditto, minus the 'always zero', built-in cost class.

Expand source code
def GetNonZeroCostClassesCount(self) -> "int":
    r""" Ditto, minus the 'always zero', built-in cost class."""
    return _pywrapcp.RoutingModel_GetNonZeroCostClassesCount(self)

GetNumOfSingletonNodes

def GetNumOfSingletonNodes(self)

Returns the number of non-start/end nodes which do not appear in a pickup/delivery pair.

Expand source code
def GetNumOfSingletonNodes(self) -> "int":
    r""" Returns the number of non-start/end nodes which do not appear in a pickup/delivery pair."""
    return _pywrapcp.RoutingModel_GetNumOfSingletonNodes(self)

GetNumberOfDecisionsInFirstSolution

def GetNumberOfDecisionsInFirstSolution(self, search_parameters)

Returns statistics on first solution search, number of decisions sent to filters, number of decisions rejected by filters.

Expand source code
def GetNumberOfDecisionsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
    r""" Returns statistics on first solution search, number of decisions sent to filters, number of decisions rejected by filters."""
    return _pywrapcp.RoutingModel_GetNumberOfDecisionsInFirstSolution(self, search_parameters)

GetNumberOfDisjunctions

def GetNumberOfDisjunctions(self)

Returns the number of node disjunctions in the model.

Expand source code
def GetNumberOfDisjunctions(self) -> "int":
    r""" Returns the number of node disjunctions in the model."""
    return _pywrapcp.RoutingModel_GetNumberOfDisjunctions(self)

GetNumberOfRejectsInFirstSolution

def GetNumberOfRejectsInFirstSolution(self, search_parameters)
Expand source code
def GetNumberOfRejectsInFirstSolution(self, search_parameters: "operations_research::RoutingSearchParameters const &") -> "int64":
    return _pywrapcp.RoutingModel_GetNumberOfRejectsInFirstSolution(self, search_parameters)

GetNumberOfVisitTypes

def GetNumberOfVisitTypes(self)
Expand source code
def GetNumberOfVisitTypes(self) -> "int":
    return _pywrapcp.RoutingModel_GetNumberOfVisitTypes(self)

GetPerfectBinaryDisjunctions

def GetPerfectBinaryDisjunctions(self)

Returns the list of all perfect binary disjunctions, as pairs of variable indices: a disjunction is "perfect" when its variables do not appear in any other disjunction. Each pair is sorted (lowest variable index first), and the output vector is also sorted (lowest pairs first).

Expand source code
def GetPerfectBinaryDisjunctions(self) -> "std::vector< std::pair< int64,int64 > >":
    r""" Returns the list of all perfect binary disjunctions, as pairs of variable indices: a disjunction is "perfect" when its variables do not appear in any other disjunction. Each pair is sorted (lowest variable index first), and the output vector is also sorted (lowest pairs first)."""
    return _pywrapcp.RoutingModel_GetPerfectBinaryDisjunctions(self)

GetPickupAndDeliveryPolicyOfVehicle

def GetPickupAndDeliveryPolicyOfVehicle(self, vehicle)
Expand source code
def GetPickupAndDeliveryPolicyOfVehicle(self, vehicle: "int") -> "operations_research::RoutingModel::PickupAndDeliveryPolicy":
    return _pywrapcp.RoutingModel_GetPickupAndDeliveryPolicyOfVehicle(self, vehicle)

GetPickupIndexPairs

def GetPickupIndexPairs(self, node_index)

Returns pairs for which the node is a pickup; the first element of each pair is the index in the pickup and delivery pairs list in which the pickup appears, the second element is its index in the pickups list.

Expand source code
def GetPickupIndexPairs(self, node_index: "int64") -> "std::vector< std::pair< int,int > > const &":
    r""" Returns pairs for which the node is a pickup; the first element of each pair is the index in the pickup and delivery pairs list in which the pickup appears, the second element is its index in the pickups list."""
    return _pywrapcp.RoutingModel_GetPickupIndexPairs(self, node_index)

GetPrimaryConstrainedDimension

def GetPrimaryConstrainedDimension(self)

Get the primary constrained dimension, or an empty std::string if it is unset.

Expand source code
def GetPrimaryConstrainedDimension(self) -> "std::string const &":
    r""" Get the primary constrained dimension, or an empty std::string if it is unset."""
    return _pywrapcp.RoutingModel_GetPrimaryConstrainedDimension(self)

GetSameVehicleIndicesOfIndex

def GetSameVehicleIndicesOfIndex(self, node)

Returns variable indices of nodes constrained to be on the same route.

Expand source code
def GetSameVehicleIndicesOfIndex(self, node: "int") -> "std::vector< int > const &":
    r""" Returns variable indices of nodes constrained to be on the same route."""
    return _pywrapcp.RoutingModel_GetSameVehicleIndicesOfIndex(self, node)

GetSameVehicleRequiredTypeAlternativesOfType

def GetSameVehicleRequiredTypeAlternativesOfType(self, type)

Returns the sets of same-vehicle/temporal requirement alternatives for the given type.

Expand source code
def GetSameVehicleRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
    r""" Returns the sets of same-vehicle/temporal requirement alternatives for the given type."""
    return _pywrapcp.RoutingModel_GetSameVehicleRequiredTypeAlternativesOfType(self, type)

GetTemporalRequiredTypeAlternativesOfType

def GetTemporalRequiredTypeAlternativesOfType(self, type)
Expand source code
def GetTemporalRequiredTypeAlternativesOfType(self, type: "int") -> "std::vector< absl::flat_hash_set< int > > const &":
    return _pywrapcp.RoutingModel_GetTemporalRequiredTypeAlternativesOfType(self, type)

GetTemporalTypeIncompatibilitiesOfType

def GetTemporalTypeIncompatibilitiesOfType(self, type)
Expand source code
def GetTemporalTypeIncompatibilitiesOfType(self, type: "int") -> "absl::flat_hash_set< int > const &":
    return _pywrapcp.RoutingModel_GetTemporalTypeIncompatibilitiesOfType(self, type)

GetVehicleClassIndexOfVehicle

def GetVehicleClassIndexOfVehicle(self, vehicle)
Expand source code
def GetVehicleClassIndexOfVehicle(self, vehicle: "int64") -> "operations_research::RoutingModel::VehicleClassIndex":
    return _pywrapcp.RoutingModel_GetVehicleClassIndexOfVehicle(self, vehicle)

GetVehicleClassesCount

def GetVehicleClassesCount(self)

Returns the number of different vehicle classes in the model.

Expand source code
def GetVehicleClassesCount(self) -> "int":
    r""" Returns the number of different vehicle classes in the model."""
    return _pywrapcp.RoutingModel_GetVehicleClassesCount(self)

GetVisitType

def GetVisitType(self, index)
Expand source code
def GetVisitType(self, index: "int64") -> "int":
    return _pywrapcp.RoutingModel_GetVisitType(self, index)

HasDimension

def HasDimension(self, dimension_name)

Returns true if a dimension exists for a given dimension name.

Expand source code
def HasDimension(self, dimension_name: "std::string const &") -> "bool":
    r""" Returns true if a dimension exists for a given dimension name."""
    return _pywrapcp.RoutingModel_HasDimension(self, dimension_name)

HasHardTypeIncompatibilities

def HasHardTypeIncompatibilities(self)

Returns true iff any hard (resp. temporal) type incompatibilities have been added to the model.

Expand source code
def HasHardTypeIncompatibilities(self) -> "bool":
    r""" Returns true iff any hard (resp. temporal) type incompatibilities have been added to the model."""
    return _pywrapcp.RoutingModel_HasHardTypeIncompatibilities(self)

HasSameVehicleTypeRequirements

def HasSameVehicleTypeRequirements(self)

Returns true iff any same-route (resp. temporal) type requirements have been added to the model.

Expand source code
def HasSameVehicleTypeRequirements(self) -> "bool":
    r""" Returns true iff any same-route (resp. temporal) type requirements have been added to the model."""
    return _pywrapcp.RoutingModel_HasSameVehicleTypeRequirements(self)

HasTemporalTypeIncompatibilities

def HasTemporalTypeIncompatibilities(self)
Expand source code
def HasTemporalTypeIncompatibilities(self) -> "bool":
    return _pywrapcp.RoutingModel_HasTemporalTypeIncompatibilities(self)

HasTemporalTypeRequirements

def HasTemporalTypeRequirements(self)
Expand source code
def HasTemporalTypeRequirements(self) -> "bool":
    return _pywrapcp.RoutingModel_HasTemporalTypeRequirements(self)

HasTypeRegulations

def HasTypeRegulations(self)

Returns true iff the model has any incompatibilities or requirements set on node types.

Expand source code
def HasTypeRegulations(self) -> "bool":
    r""" Returns true iff the model has any incompatibilities or requirements set on node types."""
    return _pywrapcp.RoutingModel_HasTypeRegulations(self)

HasVehicleWithCostClassIndex

def HasVehicleWithCostClassIndex(self, cost_class_index)

Returns true iff the model contains a vehicle with the given cost_class_index.

Expand source code
def HasVehicleWithCostClassIndex(self, cost_class_index: "operations_research::RoutingModel::CostClassIndex") -> "bool":
    r""" Returns true iff the model contains a vehicle with the given cost_class_index."""
    return _pywrapcp.RoutingModel_HasVehicleWithCostClassIndex(self, cost_class_index)

IgnoreDisjunctionsAlreadyForcedToZero

def IgnoreDisjunctionsAlreadyForcedToZero(self)

SPECIAL: Makes the solver ignore all the disjunctions whose active variables are all trivially zero (i.e. Max() == 0), by setting their max_cardinality to 0. This can be useful when using the BaseBinaryDisjunctionNeighborhood operators, in the context of arc-based routing.

Expand source code
def IgnoreDisjunctionsAlreadyForcedToZero(self) -> "void":
    r""" SPECIAL: Makes the solver ignore all the disjunctions whose active variables are all trivially zero (i.e. Max() == 0), by setting their max_cardinality to 0. This can be useful when using the BaseBinaryDisjunctionNeighborhood operators, in the context of arc-based routing."""
    return _pywrapcp.RoutingModel_IgnoreDisjunctionsAlreadyForcedToZero(self)

IsEnd

def IsEnd(self, index)

Returns true if 'index' represents the last node of a route.

Expand source code
def IsEnd(self, index: "int64") -> "bool":
    r""" Returns true if 'index' represents the last node of a route."""
    return _pywrapcp.RoutingModel_IsEnd(self, index)

IsMatchingModel

def IsMatchingModel(self)

Returns true if a vehicle/node matching problem is detected.

Expand source code
def IsMatchingModel(self) -> "bool":
    r""" Returns true if a vehicle/node matching problem is detected."""
    return _pywrapcp.RoutingModel_IsMatchingModel(self)

IsStart

def IsStart(self, index)

Returns true if 'index' represents the first node of a route.

Expand source code
def IsStart(self, index: "int64") -> "bool":
    r""" Returns true if 'index' represents the first node of a route."""
    return _pywrapcp.RoutingModel_IsStart(self, index)

IsVehicleAllowedForIndex

def IsVehicleAllowedForIndex(self, vehicle, index)

Returns true if a vehicle is allowed to visit a given node.

Expand source code
def IsVehicleAllowedForIndex(self, vehicle: "int", index: "int64") -> "bool":
    r""" Returns true if a vehicle is allowed to visit a given node."""
    return _pywrapcp.RoutingModel_IsVehicleAllowedForIndex(self, vehicle, index)

IsVehicleUsed

def IsVehicleUsed(self, assignment, vehicle)

Returns true if the route of 'vehicle' is non empty in 'assignment'.

Expand source code
def IsVehicleUsed(self, assignment: "Assignment", vehicle: "int") -> "bool":
    r""" Returns true if the route of 'vehicle' is non empty in 'assignment'."""
    return _pywrapcp.RoutingModel_IsVehicleUsed(self, assignment, vehicle)

MakeGuidedSlackFinalizer

def MakeGuidedSlackFinalizer(self, dimension, initializer)

The next few members are in the public section only for testing purposes. MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a dimension using a callback to choose which values to start with. The finalizer works only when all next variables in the model have been fixed. It has the following two characteristics: 1. It follows the routes defined by the nexts variables when choosing a variable to make a decision on. 2. When it comes to choose a value for the slack of node i, the decision builder first calls the callback with argument i, and supposingly the returned value is x it creates decisions slack[i] = x, slack[i] = x + 1, slack[i] = x - 1, slack[i] = x + 2, etc.

Expand source code
def MakeGuidedSlackFinalizer(self, dimension: "RoutingDimension", initializer: "std::function< int64 (int64) >") -> "operations_research::DecisionBuilder *":
    r""" The next few members are in the public section only for testing purposes. MakeGuidedSlackFinalizer creates a DecisionBuilder for the slacks of a dimension using a callback to choose which values to start with. The finalizer works only when all next variables in the model have been fixed. It has the following two characteristics: 1. It follows the routes defined by the nexts variables when choosing a    variable to make a decision on. 2. When it comes to choose a value for the slack of node i, the decision    builder first calls the callback with argument i, and supposingly the    returned value is x it creates decisions slack[i] = x, slack[i] = x +    1, slack[i] = x - 1, slack[i] = x + 2, etc."""
    return _pywrapcp.RoutingModel_MakeGuidedSlackFinalizer(self, dimension, initializer)

MakePathSpansAndTotalSlacks

def MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks)

For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of slacks on that vehicle, that is, dimension->CumulVar(end) - dimension->CumulVar(start) - sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account.

Expand source code
def MakePathSpansAndTotalSlacks(self, dimension: "RoutingDimension", spans: "std::vector< operations_research::IntVar * >", total_slacks: "std::vector< operations_research::IntVar * >") -> "operations_research::Constraint *":
    r""" For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr, constrains it to be the sum of   slacks on that vehicle, that is,   dimension->CumulVar(end) - dimension->CumulVar(start) -   sum_{node in path of vehicle} dimension->FixedTransitVar(node). - if spans[vehicle] is not nullptr, constrains it to be   dimension->CumulVar(end) - dimension->CumulVar(start) This does stronger propagation than a decomposition, and takes breaks into account."""
    return _pywrapcp.RoutingModel_MakePathSpansAndTotalSlacks(self, dimension, spans, total_slacks)

MakeSelfDependentDimensionFinalizer

def MakeSelfDependentDimensionFinalizer(self, dimension)

MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a self-dependent dimension. It makes an extensive use of the caches of the state dependent transits. In detail, MakeSelfDependentDimensionFinalizer returns a composition of a local search decision builder with a greedy descent operator for the cumul of the start of each route and a guided slack finalizer. Provided there are no time windows and the maximum slacks are large enough, once the cumul of the start of route is fixed, the guided finalizer can find optimal values of the slacks for the rest of the route in time proportional to the length of the route. Therefore the composed finalizer generally works in time O(log(t)nm), where t is the latest possible departute time, n is the number of nodes in the network and m is the number of vehicles.

Expand source code
def MakeSelfDependentDimensionFinalizer(self, dimension: "RoutingDimension") -> "operations_research::DecisionBuilder *":
    r""" MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a self-dependent dimension. It makes an extensive use of the caches of the state dependent transits. In detail, MakeSelfDependentDimensionFinalizer returns a composition of a local search decision builder with a greedy descent operator for the cumul of the start of each route and a guided slack finalizer. Provided there are no time windows and the maximum slacks are large enough, once the cumul of the start of route is fixed, the guided finalizer can find optimal values of the slacks for the rest of the route in time proportional to the length of the route. Therefore the composed finalizer generally works in time O(log(t)*n*m), where t is the latest possible departute time, n is the number of nodes in the network and m is the number of vehicles."""
    return _pywrapcp.RoutingModel_MakeSelfDependentDimensionFinalizer(self, dimension)

MutablePreAssignment

def MutablePreAssignment(self)
Expand source code
def MutablePreAssignment(self) -> "operations_research::Assignment *":
    return _pywrapcp.RoutingModel_MutablePreAssignment(self)

Next

def Next(self, assignment, index)

Assignment inspection Returns the variable index of the node directly after the node corresponding to 'index' in 'assignment'.

Expand source code
def Next(self, assignment: "Assignment", index: "int64") -> "int64":
    r""" Assignment inspection Returns the variable index of the node directly after the node corresponding to 'index' in 'assignment'."""
    return _pywrapcp.RoutingModel_Next(self, assignment, index)

NextVar

def NextVar(self, index)

Returns the next variable of the node corresponding to index. Note that NextVar(index) == index is equivalent to ActiveVar(index) == 0.

Expand source code
def NextVar(self, index: "int64") -> "operations_research::IntVar *":
    r""" Returns the next variable of the node corresponding to index. Note that NextVar(index) == index is equivalent to ActiveVar(index) == 0."""
    return _pywrapcp.RoutingModel_NextVar(self, index)

PackCumulsOfOptimizerDimensionsFromAssignment

def PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment, duration_limit)

For every dimension in the model with an optimizer in local/global_dimension_optimizers_, this method tries to pack the cumul values of the dimension, such that: - The cumul costs (span costs, soft lower and upper bound costs, etc) are minimized. - The cumuls of the ends of the routes are minimized for this given minimal cumul cost. - Given these minimal end cumuls, the route start cumuls are maximized. Returns the assignment resulting from allocating these packed cumuls with the solver, and nullptr if these cumuls could not be set by the solver.

Expand source code
def PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment: "Assignment", duration_limit: "absl::Duration") -> "operations_research::Assignment const *":
    r""" For every dimension in the model with an optimizer in local/global_dimension_optimizers_, this method tries to pack the cumul values of the dimension, such that: - The cumul costs (span costs, soft lower and upper bound costs, etc) are   minimized. - The cumuls of the ends of the routes are minimized for this given   minimal cumul cost. - Given these minimal end cumuls, the route start cumuls are maximized. Returns the assignment resulting from allocating these packed cumuls with the solver, and nullptr if these cumuls could not be set by the solver."""
    return _pywrapcp.RoutingModel_PackCumulsOfOptimizerDimensionsFromAssignment(self, original_assignment, duration_limit)

PreAssignment

def PreAssignment(self)

Returns an assignment used to fix some of the variables of the problem. In practice, this assignment locks partial routes of the problem. This can be used in the context of locking the parts of the routes which have already been driven in online routing problems.

Expand source code
def PreAssignment(self) -> "operations_research::Assignment const *const":
    r""" Returns an assignment used to fix some of the variables of the problem. In practice, this assignment locks partial routes of the problem. This can be used in the context of locking the parts of the routes which have already been driven in online routing problems."""
    return _pywrapcp.RoutingModel_PreAssignment(self)

ReadAssignment

def ReadAssignment(self, file_name)

Reads an assignment from a file and returns the current solution. Returns nullptr if the file cannot be opened or if the assignment is not valid.

Expand source code
def ReadAssignment(self, file_name: "std::string const &") -> "operations_research::Assignment *":
    r""" Reads an assignment from a file and returns the current solution. Returns nullptr if the file cannot be opened or if the assignment is not valid."""
    return _pywrapcp.RoutingModel_ReadAssignment(self, file_name)

ReadAssignmentFromRoutes

def ReadAssignmentFromRoutes(self, routes, ignore_inactive_indices)

Restores the routes as the current solution. Returns nullptr if the solution cannot be restored (routes do not contain a valid solution). Note that calling this method will run the solver to assign values to the dimension variables; this may take considerable amount of time, especially when using dimensions with slack.

Expand source code
def ReadAssignmentFromRoutes(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool") -> "operations_research::Assignment *":
    r""" Restores the routes as the current solution. Returns nullptr if the solution cannot be restored (routes do not contain a valid solution). Note that calling this method will run the solver to assign values to the dimension variables; this may take considerable amount of time, especially when using dimensions with slack."""
    return _pywrapcp.RoutingModel_ReadAssignmentFromRoutes(self, routes, ignore_inactive_indices)

RegisterPositiveTransitCallback

def RegisterPositiveTransitCallback(self, callback)
Expand source code
def RegisterPositiveTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
    return _pywrapcp.RoutingModel_RegisterPositiveTransitCallback(self, callback)

RegisterPositiveUnaryTransitCallback

def RegisterPositiveUnaryTransitCallback(self, callback)
Expand source code
def RegisterPositiveUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
    return _pywrapcp.RoutingModel_RegisterPositiveUnaryTransitCallback(self, callback)

RegisterTransitCallback

def RegisterTransitCallback(self, callback)
Expand source code
def RegisterTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback2") -> "int":
    return _pywrapcp.RoutingModel_RegisterTransitCallback(self, callback)

RegisterUnaryTransitCallback

def RegisterUnaryTransitCallback(self, callback)

Registers 'callback' and returns its index.

Expand source code
def RegisterUnaryTransitCallback(self, callback: "operations_research::RoutingModel::TransitCallback1") -> "int":
    r""" Registers 'callback' and returns its index."""
    return _pywrapcp.RoutingModel_RegisterUnaryTransitCallback(self, callback)

RemainingTime

def RemainingTime(self)

Returns the time left in the search limit.

Expand source code
def RemainingTime(self) -> "absl::Duration":
    r""" Returns the time left in the search limit."""
    return _pywrapcp.RoutingModel_RemainingTime(self)

RestoreAssignment

def RestoreAssignment(self, solution)

Restores an assignment as a solution in the routing model and returns the new solution. Returns nullptr if the assignment is not valid.

Expand source code
def RestoreAssignment(self, solution: "Assignment") -> "operations_research::Assignment *":
    r""" Restores an assignment as a solution in the routing model and returns the new solution. Returns nullptr if the assignment is not valid."""
    return _pywrapcp.RoutingModel_RestoreAssignment(self, solution)

RoutesToAssignment

def RoutesToAssignment(self, routes, ignore_inactive_indices, close_routes, assignment)

Fills an assignment from a specification of the routes of the vehicles. The routes are specified as lists of variable indices that appear on the routes of the vehicles. The indices of the outer vector in 'routes' correspond to vehicles IDs, the inner vector contains the variable indices on the routes for the given vehicle. The inner vectors must not contain the start and end indices, as these are determined by the routing model. Sets the value of NextVars in the assignment, adding the variables to the assignment if necessary. The method does not touch other variables in the assignment. The method can only be called after the model is closed. With ignore_inactive_indices set to false, this method will fail (return nullptr) in case some of the route contain indices that are deactivated in the model; when set to true, these indices will be skipped. Returns true if routes were successfully loaded. However, such assignment still might not be a valid solution to the routing problem due to more complex constraints; it is advisible to call solver()->CheckSolution() afterwards.

Expand source code
def RoutesToAssignment(self, routes: "std::vector< std::vector< int64 > > const &", ignore_inactive_indices: "bool", close_routes: "bool", assignment: &#