this repo has no description
1include "fzn_geost_bb.mzn";
2include "fzn_geost_bb_reif.mzn";
3
4predicate fzn_geost_smallest_bb_reif(
5 int : k ,
6 array[int,int] of int : rect_size ,
7 array[int,int] of int : rect_offset ,
8 array[int ] of set of int : shape ,
9 array[int,int] of var int : x ,
10 array[int ] of var int : kind ,
11 array[int ] of var int : l ,
12 array[int ] of var int : u ,
13 var bool: b
14) =
15 % Two useful definitions
16 let {
17 set of int: DIMS = 1..k;
18 set of int: OBJECTS = index_set(kind);
19 } in b <-> (
20 % Posting the geost constraint
21 fzn_geost_bb(k, rect_size, rect_offset, shape, x, kind, l, u)
22 /\ % Posting the smallest bounding box constraints
23 forall(j in DIMS)(
24 % Lower boundary
25 exists(o in OBJECTS, s in dom(kind[o]))(
26 kind[o] = s
27 /\ exists(r in shape[s])(
28 x[o,j] + rect_offset[r,j] == l[j]
29 )
30 )
31 /\ % Upper boundary
32 exists(o in OBJECTS, s in dom(kind[o]))(
33 kind[o] = s
34 /\ exists(r in shape[s])(
35 x[o,j] + rect_offset[r,j] + rect_size[r,j] == u[j]
36 )
37 )
38 )
39 );