git-subtree-dir: software/mza git-subtree-split: f970a59b177c13ca3dd8aaef8cc6681d83b7e813
29 lines
1.0 KiB
MiniZinc
29 lines
1.0 KiB
MiniZinc
predicate fzn_geost_bb(
|
|
int : k ,
|
|
array[int,int] of int : rect_size ,
|
|
array[int,int] of int : rect_offset ,
|
|
array[int ] of set of int : shape ,
|
|
array[int,int] of var int : x ,
|
|
array[int ] of var int : kind ,
|
|
array[int ] of var int : l ,
|
|
array[int ] of var int : u
|
|
) =
|
|
% Two useful definitions
|
|
let {
|
|
set of int: DIMS = 1..k;
|
|
set of int: OBJECTS = index_set(kind);
|
|
} in
|
|
% Posting the geost constraint
|
|
fzn_geost(k, rect_size, rect_offset, shape, x, kind)
|
|
/\ % Posting the bounding box constraints
|
|
forall(o in OBJECTS)(
|
|
forall(s in dom(kind[o]))(
|
|
(kind[o] = s ->
|
|
forall(r in shape[s], j in DIMS)(
|
|
x[o,j] + rect_offset[r,j] >= l[j]
|
|
/\ x[o,j] + rect_offset[r,j] + rect_size[r,j] <= u[j]
|
|
)
|
|
)
|
|
)
|
|
);
|