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

Public Member Functions

synchronized void delete ()
 
 Pack (Solver s, IntVar[] vars, int number_of_bins)
 
void addWeightedSumLessOrEqualConstantDimension (long[] weights, long[] bounds)
 
void addWeightedSumLessOrEqualConstantDimension (LongUnaryOperator weights, long[] bounds)
 
void addWeightedSumLessOrEqualConstantDimension (LongBinaryOperator weights, long[] bounds)
 
void addWeightedSumEqualVarDimension (long[] weights, IntVar[] loads)
 
void addWeightedSumEqualVarDimension (LongBinaryOperator weights, IntVar[] loads)
 
void addSumVariableWeightsLessOrEqualConstantDimension (IntVar[] usage, long[] capacity)
 
void addWeightedSumOfAssignedDimension (long[] weights, IntVar cost_var)
 
void addCountUsedBinDimension (IntVar count_var)
 
void addCountAssignedItemsDimension (IntVar count_var)
 
void post ()
 
void clearAll ()
 
void propagateDelayed ()
 
void initialPropagate ()
 
void propagate ()
 
void oneDomain (int var_index)
 
String toString ()
 
boolean isUndecided (int var_index, int bin_index)
 
void setImpossible (int var_index, int bin_index)
 
void assign (int var_index, int bin_index)
 
boolean isAssignedStatusKnown (int var_index)
 
boolean isPossible (int var_index, int bin_index)
 
IntVar assignVar (int var_index, int bin_index)
 
void setAssigned (int var_index)
 
void setUnassigned (int var_index)
 
void removeAllPossibleFromBin (int bin_index)
 
void assignAllPossibleToBin (int bin_index)
 
void assignFirstPossibleToBin (int bin_index)
 
void assignAllRemainingItems ()
 
void unassignAllRemainingItems ()
 
void accept (ModelVisitor visitor)
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.Constraint
void postAndPropagate ()
 
boolean isCastConstraint ()
 
IntVar var ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
 PropagationBaseObject (Solver s)
 
Solver solver ()
 
void freezeQueue ()
 
void unfreezeQueue ()
 
void enqueueDelayedDemon (Demon d)
 
void enqueueVar (Demon d)
 
void reset_action_on_fail ()
 
void set_variable_to_clean_on_fail (IntVar v)
 
String name ()
 
void setName (String name)
 
boolean hasName ()
 
String baseName ()
 
- Public Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject ()
 

Protected Member Functions

 Pack (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.Constraint
 Constraint (long cPtr, boolean cMemoryOwn)
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
 PropagationBaseObject (long cPtr, boolean cMemoryOwn)
 
- Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
 BaseObject (long cPtr, boolean cMemoryOwn)
 

Static Protected Member Functions

static long getCPtr (Pack obj)
 
static long swigRelease (Pack obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.Constraint
static long getCPtr (Constraint obj)
 
static long swigRelease (Constraint obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.PropagationBaseObject
static long getCPtr (PropagationBaseObject obj)
 
static long swigRelease (PropagationBaseObject obj)
 
- Static Protected Member Functions inherited from com.google.ortools.constraintsolver.BaseObject
static long getCPtr (BaseObject obj)
 
static long swigRelease (BaseObject obj)
 

Additional Inherited Members

- Protected Attributes inherited from com.google.ortools.constraintsolver.BaseObject
transient boolean swigCMemOwn
 

Detailed Description

Definition at line 18 of file Pack.java.

Constructor & Destructor Documentation

◆ Pack() [1/2]

com.google.ortools.constraintsolver.Pack.Pack ( long cPtr,
boolean cMemoryOwn )
protected

Definition at line 21 of file Pack.java.

◆ Pack() [2/2]

com.google.ortools.constraintsolver.Pack.Pack ( Solver s,
IntVar[] vars,
int number_of_bins )

Definition at line 58 of file Pack.java.

Member Function Documentation

◆ accept()

void com.google.ortools.constraintsolver.Pack.accept ( ModelVisitor visitor)

Accepts the given visitor.

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 232 of file Pack.java.

◆ addCountAssignedItemsDimension()

void com.google.ortools.constraintsolver.Pack.addCountAssignedItemsDimension ( IntVar count_var)

This dimension links 'count_var' to the actual number of items
assigned to a bin in the pack.

Definition at line 147 of file Pack.java.

◆ addCountUsedBinDimension()

void com.google.ortools.constraintsolver.Pack.addCountUsedBinDimension ( IntVar count_var)

This dimension links 'count_var' to the actual number of bins used in the
pack.

Definition at line 139 of file Pack.java.

◆ addSumVariableWeightsLessOrEqualConstantDimension()

void com.google.ortools.constraintsolver.Pack.addSumVariableWeightsLessOrEqualConstantDimension ( IntVar[] usage,
long[] 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 123 of file Pack.java.

◆ addWeightedSumEqualVarDimension() [1/2]

void com.google.ortools.constraintsolver.Pack.addWeightedSumEqualVarDimension ( long[] weights,
IntVar[] loads )

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].

Definition at line 99 of file Pack.java.

◆ addWeightedSumEqualVarDimension() [2/2]

void com.google.ortools.constraintsolver.Pack.addWeightedSumEqualVarDimension ( LongBinaryOperator weights,
IntVar[] loads )

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 108 of file Pack.java.

◆ addWeightedSumLessOrEqualConstantDimension() [1/3]

void com.google.ortools.constraintsolver.Pack.addWeightedSumLessOrEqualConstantDimension ( long[] weights,
long[] bounds )

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]'.

Definition at line 71 of file Pack.java.

◆ addWeightedSumLessOrEqualConstantDimension() [2/3]

void com.google.ortools.constraintsolver.Pack.addWeightedSumLessOrEqualConstantDimension ( LongBinaryOperator weights,
long[] bounds )

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 91 of file Pack.java.

◆ addWeightedSumLessOrEqualConstantDimension() [3/3]

void com.google.ortools.constraintsolver.Pack.addWeightedSumLessOrEqualConstantDimension ( LongUnaryOperator weights,
long[] bounds )

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.

Definition at line 81 of file Pack.java.

◆ addWeightedSumOfAssignedDimension()

void com.google.ortools.constraintsolver.Pack.addWeightedSumOfAssignedDimension ( long[] weights,
IntVar cost_var )

This dimension enforces that cost_var == sum of weights[i] for
all objects 'i' assigned to a bin.

Definition at line 131 of file Pack.java.

◆ assign()

void com.google.ortools.constraintsolver.Pack.assign ( int var_index,
int bin_index )

Definition at line 187 of file Pack.java.

◆ assignAllPossibleToBin()

void com.google.ortools.constraintsolver.Pack.assignAllPossibleToBin ( int bin_index)

Definition at line 216 of file Pack.java.

◆ assignAllRemainingItems()

void com.google.ortools.constraintsolver.Pack.assignAllRemainingItems ( )

Definition at line 224 of file Pack.java.

◆ assignFirstPossibleToBin()

void com.google.ortools.constraintsolver.Pack.assignFirstPossibleToBin ( int bin_index)

Definition at line 220 of file Pack.java.

◆ assignVar()

IntVar com.google.ortools.constraintsolver.Pack.assignVar ( int var_index,
int bin_index )

Definition at line 199 of file Pack.java.

◆ clearAll()

void com.google.ortools.constraintsolver.Pack.clearAll ( )

Definition at line 155 of file Pack.java.

◆ delete()

synchronized void com.google.ortools.constraintsolver.Pack.delete ( )

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 47 of file Pack.java.

◆ finalize()

void com.google.ortools.constraintsolver.Pack.finalize ( )
protected

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 43 of file Pack.java.

◆ getCPtr()

static long com.google.ortools.constraintsolver.Pack.getCPtr ( Pack obj)
staticprotected

Definition at line 26 of file Pack.java.

◆ initialPropagate()

void com.google.ortools.constraintsolver.Pack.initialPropagate ( )

This method performs the initial propagation of the
constraint. It is called just after the post.

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 163 of file Pack.java.

◆ isAssignedStatusKnown()

boolean com.google.ortools.constraintsolver.Pack.isAssignedStatusKnown ( int var_index)

Definition at line 191 of file Pack.java.

◆ isPossible()

boolean com.google.ortools.constraintsolver.Pack.isPossible ( int var_index,
int bin_index )

Definition at line 195 of file Pack.java.

◆ isUndecided()

boolean com.google.ortools.constraintsolver.Pack.isUndecided ( int var_index,
int bin_index )

Definition at line 179 of file Pack.java.

◆ oneDomain()

void com.google.ortools.constraintsolver.Pack.oneDomain ( int var_index)

Definition at line 171 of file Pack.java.

◆ post()

void com.google.ortools.constraintsolver.Pack.post ( )

This method is called when the constraint is processed by the
solver. Its main usage is to attach demons to variables.

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 151 of file Pack.java.

◆ propagate()

void com.google.ortools.constraintsolver.Pack.propagate ( )

Definition at line 167 of file Pack.java.

◆ propagateDelayed()

void com.google.ortools.constraintsolver.Pack.propagateDelayed ( )

Definition at line 159 of file Pack.java.

◆ removeAllPossibleFromBin()

void com.google.ortools.constraintsolver.Pack.removeAllPossibleFromBin ( int bin_index)

Definition at line 212 of file Pack.java.

◆ setAssigned()

void com.google.ortools.constraintsolver.Pack.setAssigned ( int var_index)

Definition at line 204 of file Pack.java.

◆ setImpossible()

void com.google.ortools.constraintsolver.Pack.setImpossible ( int var_index,
int bin_index )

Definition at line 183 of file Pack.java.

◆ setUnassigned()

void com.google.ortools.constraintsolver.Pack.setUnassigned ( int var_index)

Definition at line 208 of file Pack.java.

◆ swigRelease()

static long com.google.ortools.constraintsolver.Pack.swigRelease ( Pack obj)
staticprotected

Definition at line 30 of file Pack.java.

◆ toString()

String com.google.ortools.constraintsolver.Pack.toString ( )

Reimplemented from com.google.ortools.constraintsolver.Constraint.

Definition at line 175 of file Pack.java.

◆ unassignAllRemainingItems()

void com.google.ortools.constraintsolver.Pack.unassignAllRemainingItems ( )

Definition at line 228 of file Pack.java.


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