Skip to content

Commit 49ac26a

Browse files
committed
Rewrite fzn_disjunctive_strict to gecode_schedule_unary instead of cumulative. Previously the strict behaviour for 0-length tasks was not enforced.
1 parent 6b09bea commit 49ac26a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gecode/flatzinc/mznlib/fzn_disjunctive_strict.mzn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
include "fzn_cumulative.mzn";
1+
predicate gecode_schedule_unary(array[int] of var int: x, array[int] of int: p);
22

33
predicate fzn_disjunctive_strict(array[int] of var int: s,
44
array[int] of var int: d) =
55
assert(index_set(s) == index_set(d),
66
"disjunctive: the array arguments must have identical index sets",
77
forall (i in index_set(d)) (d[i] >= 0) /\
88
if forall (i in index_set(d)) (is_fixed(d[i])) then
9-
fzn_cumulative(s,d,array1d(index_set(d),[1 | i in index_set(d)]),1)
9+
gecode_schedule_unary(array1d(s),[fix(di) | di in d])
1010
else
1111
forall (i,j in index_set(d) where i<j) (
1212
s[i]+d[i] <= s[j] \/ s[j]+d[j] <= s[i]

0 commit comments

Comments
 (0)