1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.

18 lines
802 B
MiniZinc

include "fzn_diffn_k.mzn";
include "fzn_diffn_k_reif.mzn";
/** @group globals.packing
Constrains \p k-dimensional boxes to be non-overlapping. For each box \p i
and dimension \p j, \a box_posn[\p i, \p j] is the base position of the box
in dimension \p j, and \a box_size[\p i, \p j] is the size in that dimension.
Boxes whose size is 0 in any dimension still cannot overlap with any other box.
*/
predicate diffn_k(array[int,int] of var int: box_posn,
array[int,int] of var int: box_size) =
let { set of int: DIMS= index_set_2of2(box_posn) } in
assert(index_set_2of2(box_size) = DIMS /\
index_set_1of2(box_posn) = index_set_1of2(box_size),
"diffn: index sets of arguments are incorrect",
fzn_diffn_k(box_posn, box_size)
);