this repo has no description
at develop 1.4 kB view raw
1include "fzn_bin_packing.mzn"; 2include "fzn_bin_packing_reif.mzn"; 3 4/** @group globals.packing 5 Requires that each item \p i with weight \a w[\p i], be put into \a bin[\p i] such 6 that the sum of the weights of the items in each bin does not exceed the 7 capacity \a c. 8 9 Assumptions: 10 - forall \p i, \a w[\p i] >=0 11 - \a c >=0 12*/ 13predicate bin_packing(int: c, 14 array[int] of var int: bin, 15 array[int] of int: w) = 16 assert(index_set(bin) == index_set(w), 17 "bin_packing: the bin and weight arrays must have identical index sets", 18 assert(lb_array(w) >= 0, 19 "bin_packing: the weights must be non-negative", 20 assert(c >= 0, "bin_packing: capacity must be non-negative", 21 fzn_bin_packing(c, bin, w) 22 ))); 23 24predicate bin_packing_reif(int: c, 25 array[int] of var int: bin, 26 array[int] of int: w, 27 var bool: b) = 28 assert(index_set(bin) == index_set(w), 29 "bin_packing: the bin and weight arrays must have identical index sets", 30 assert(lb_array(w) >= 0, 31 "bin_packing: the weights must be non-negative", 32 assert(c >= 0, "bin_packing: capacity must be non-negative", 33 fzn_bin_packing_reif(c, bin, w, b) 34 ))); 35 36%-----------------------------------------------------------------------------%