Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ortools.constraint_solver.pywrapcp.Pack Class Reference
Inheritance diagram for ortools.constraint_solver.pywrapcp.Pack:
ortools.constraint_solver.pywrapcp.Constraint ortools.constraint_solver.pywrapcp.PropagationBaseObject ortools.constraint_solver.pywrapcp.BaseObject

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 AddWeightedSumLessOrEqualConstantDimension (self, *args)
 
 AddWeightedSumEqualVarDimension (self, *args)
 
 AddSumVariableWeightsLessOrEqualConstantDimension (self, usage, capacity)
 
 AddWeightedSumOfAssignedDimension (self, weights, cost_var)
 
 AddCountUsedBinDimension (self, count_var)
 
 AddCountAssignedItemsDimension (self, count_var)
 
 Post (self)
 
 InitialPropagateWrapper (self)
 
 DebugString (self)
 
- Public Member Functions inherited from ortools.constraint_solver.pywrapcp.Constraint
 Var (self)
 
 __repr__ (self)
 
 __str__ (self)
 
 __add__ (self, *args)
 
 __radd__ (self, v)
 
 __sub__ (self, *args)
 
 __rsub__ (self, v)
 
 __mul__ (self, *args)
 
 __rmul__ (self, v)
 
 __floordiv__ (self, v)
 
 __neg__ (self)
 
 __abs__ (self)
 
 Square (self)
 
 __eq__ (self, *args)
 
 __ne__ (self, *args)
 
 __ge__ (self, *args)
 
 __gt__ (self, *args)
 
 __le__ (self, *args)
 
 __lt__ (self, *args)
 
 MapTo (self, vars)
 
 IndexOf (self, *args)
 
 __disown__ (self)
 
- Public Member Functions inherited from ortools.constraint_solver.pywrapcp.PropagationBaseObject
 solver (self)
 
 Name (self)
 
- Public Member Functions inherited from ortools.constraint_solver.pywrapcp.BaseObject

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
- Properties inherited from ortools.constraint_solver.pywrapcp.Constraint
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
- Properties inherited from ortools.constraint_solver.pywrapcp.PropagationBaseObject
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 
- Properties inherited from ortools.constraint_solver.pywrapcp.BaseObject
 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Detailed Description

Definition at line 3654 of file pywrapcp.py.

Constructor & Destructor Documentation

◆ __init__()

ortools.constraint_solver.pywrapcp.Pack.__init__ ( self,
* args,
** kwargs )

Reimplemented from ortools.constraint_solver.pywrapcp.Constraint.

Definition at line 3657 of file pywrapcp.py.

Member Function Documentation

◆ AddCountAssignedItemsDimension()

ortools.constraint_solver.pywrapcp.Pack.AddCountAssignedItemsDimension ( self,
count_var )
    This dimension links 'count_var' to the actual number of items
    assigned to a bin in the pack.

Definition at line 3733 of file pywrapcp.py.

◆ AddCountUsedBinDimension()

ortools.constraint_solver.pywrapcp.Pack.AddCountUsedBinDimension ( self,
count_var )
    This dimension links 'count_var' to the actual number of bins used in the
    pack.

Definition at line 3726 of file pywrapcp.py.

◆ AddSumVariableWeightsLessOrEqualConstantDimension()

ortools.constraint_solver.pywrapcp.Pack.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.

Definition at line 3705 of file pywrapcp.py.

◆ AddWeightedSumEqualVarDimension()

ortools.constraint_solver.pywrapcp.Pack.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].

Definition at line 3690 of file pywrapcp.py.

◆ AddWeightedSumLessOrEqualConstantDimension()

ortools.constraint_solver.pywrapcp.Pack.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.

Definition at line 3661 of file pywrapcp.py.

◆ AddWeightedSumOfAssignedDimension()

ortools.constraint_solver.pywrapcp.Pack.AddWeightedSumOfAssignedDimension ( self,
weights,
cost_var )
    This dimension enforces that cost_var == sum of weights[i] for
    all objects 'i' assigned to a bin.

Definition at line 3719 of file pywrapcp.py.

◆ DebugString()

ortools.constraint_solver.pywrapcp.Pack.DebugString ( self)

Reimplemented from ortools.constraint_solver.pywrapcp.Constraint.

Definition at line 3746 of file pywrapcp.py.

◆ InitialPropagateWrapper()

ortools.constraint_solver.pywrapcp.Pack.InitialPropagateWrapper ( self)
    This method performs the initial propagation of the
    constraint. It is called just after the post.

Reimplemented from ortools.constraint_solver.pywrapcp.Constraint.

Definition at line 3743 of file pywrapcp.py.

◆ Post()

ortools.constraint_solver.pywrapcp.Pack.Post ( self)
    This method is called when the constraint is processed by the
    solver. Its main usage is to attach demons to variables.

Reimplemented from ortools.constraint_solver.pywrapcp.Constraint.

Definition at line 3740 of file pywrapcp.py.

Property Documentation

◆ thisown

ortools.constraint_solver.pywrapcp.Pack.thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static

Definition at line 3655 of file pywrapcp.py.


The documentation for this class was generated from the following file: