File: fzn_disjunctive_strict.mzn

package info (click to toggle)
gecode-snapshot 6.2.0%2Bgit20240207-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 35,308 kB
  • sloc: cpp: 475,516; perl: 2,077; makefile: 1,816; sh: 198
file content (15 lines) | stat: -rw-r--r-- 640 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
predicate gecode_schedule_unary(array[int] of var int: x, array[int] of int: p);

predicate fzn_disjunctive_strict(array[int] of var int: s,
                                 array[int] of var int: d) =
    assert(index_set(s) == index_set(d),
        "disjunctive: the array arguments must have identical index sets",
        forall (i in index_set(d)) (d[i] >= 0) /\
        if forall (i in index_set(d)) (is_fixed(d[i])) then
          gecode_schedule_unary(array1d(s),[fix(di) | di in d])
        else
          forall (i,j in index_set(d) where i<j) (
            s[i]+d[i] <= s[j] \/ s[j]+d[j] <= s[i]
          )
        endif
    );