Items and Bins are L-dimensional, i.e. each Item/Bin has a size/load in each dimension. Thus,ItemMDSizes and BinMDLoads are 2-D collections, i.e. a 2-D matrix or a list of lists, such that each element is itself a collection of L sub-elements.
Each element of Items and its corresponding element in ItemMDSizes represents an item, such that the i'th element of ItemMDSizes is the size of the i'th item, and the i'th element of Item is the bin this item is packed into. BinMDLoads represent the loads of each bin, i.e. the sum of the sizes of items (in each dimension) assigned to that bin, with the j'th element representing the load for bin j. An (integer finite domain) variable for the load in each dimension allows a constraint on the load to be specified, such as a minimum and/or maximum load for the bin in that dimension.
Note that the Gecode implementation of this constraint has index starting from 0, i.e. the numbering for the bins starts from 0. These native indices are mapped to the ECLiPSe indices starting from 1 with an additional dummy zero'th bin that is assigned a dummy item 0.
This constraint is implemented using Gecode's multi-dimensional variant of binpacking() constraint, which requires both the maximum bin size (as in bin_packing_md/4) and all the bin loads to be specified. This gfd version of the constraint deduces the maximum bin size from BinMDLoads.
[eclipse 2]: bin_packing_md([3,1,3], [[4,2], [3,0], [1,3]], [[L11,L12],[L21,L22],[L31,L32]]). L11 = 3 L12 = 0 L21 = 0 L22 = 0 L31 = 5 L32 = 5