C++ Reference: class Pack

This documentation is automatically generated.

Method
Accept

Return type: void

Arguments: ModelVisitor* const visitor

AddCountAssignedItemsDimension

Return type: void

Arguments: IntVar* const count_var

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

AddCountUsedBinDimension

Return type: void

Arguments: IntVar* const count_var

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

AddSumVariableWeightsLessOrEqualConstantDimension

Return type: void

Arguments: const std::vector<IntVar*>& usage, const std::vector<int64>& 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.

AddWeightedSumEqualVarDimension

Return type: void

Arguments: const std::vector<int64>& weights, const std::vector<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].

AddWeightedSumEqualVarDimension

Return type: void

Arguments: Solver::IndexEvaluator2 weights, const std::vector<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].

AddWeightedSumLessOrEqualConstantDimension

Return type: void

Arguments: const std::vector<int64>& weights, const std::vector<int64>& bounds

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

AddWeightedSumLessOrEqualConstantDimension

Return type: void

Arguments: Solver::IndexEvaluator1 weights, const std::vector<int64>& 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.

AddWeightedSumLessOrEqualConstantDimension

Return type: void

Arguments: Solver::IndexEvaluator2 weights, const std::vector<int64>& 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.

AddWeightedSumOfAssignedDimension

Return type: void

Arguments: const std::vector<int64>& weights, IntVar* const cost_var

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

Assign

Return type: void

Arguments: int var_index, int bin_index

AssignAllPossibleToBin

Return type: void

Arguments: int bin_index

AssignAllRemainingItems

Return type: void

AssignFirstPossibleToBin

Return type: void

Arguments: int bin_index

AssignVar

Return type: IntVar*

Arguments: int var_index, int bin_index

ClearAll

Return type: void

DebugString

Return type: std::string

InitialPropagate

Return type: void

IsAssignedStatusKnown

Return type: bool

Arguments: int var_index

IsPossible

Return type: bool

Arguments: int var_index, int bin_index

IsUndecided

Return type: bool

Arguments: int var_index, int bin_index

OneDomain

Return type: void

Arguments: int var_index

Pack

Arguments: Solver* const s, const std::vector<IntVar*>& vars, int number_of_bins

~Pack

Post

Return type: void

Propagate

Return type: void

PropagateDelayed

Return type: void

RemoveAllPossibleFromBin

Return type: void

Arguments: int bin_index

SetAssigned

Return type: void

Arguments: int var_index

SetImpossible

Return type: void

Arguments: int var_index, int bin_index

SetUnassigned

Return type: void

Arguments: int var_index

UnassignAllRemainingItems

Return type: void