this repo has no description
at develop 991 B view raw
1include "fzn_knapsack.mzn"; 2include "fzn_knapsack_reif.mzn"; 3 4/** @group globals.packing 5Requires that items are packed in a knapsack with certain weight and profit restrictions. 6 7Assumptions: 8 - Weights \a w and profits \a p must be non-negative 9 - \a w, \a p and \a x must have the same index sets 10 11@param w: weight of each type of item 12@param p: profit of each type of item 13@param x: number of items of each type that are packed 14@param W: sum of sizes of all items in the knapsack 15@param P: sum of profits of all items in the knapsack 16*/ 17predicate knapsack(array[int] of int: w, array[int] of int:p, 18 array[int] of var int:x, var int: W, var int: P) = 19 assert(index_set(w) = index_set(p) /\ index_set(w) = index_set(x), 20 "index set of weights must be equal to index set of profits and index set of items", 21 assert(lb_array(w) >= 0, 22 "weights must be non-negative", 23 assert(lb_array(p) >= 0, 24 "profits must be non-negative", 25 fzn_knapsack(w, p, x, W, P) 26 )));