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.

17 lines
701 B
MiniZinc

predicate fzn_cumulative_opt(array[int] of var opt int: s,
array[int] of var int: d,
array[int] of var int: r, var int: b) =
let {
set of int: tasks =
{i | i in index_set(s) where ub(r[i]) > 0 /\ ub(d[i]) > 0 },
set of int: times =
min([ lb(s[i]) | i in tasks ]) ..
max([ ub(s[i]) + ub(d[i]) | i in tasks ])
}
in
forall( t in times ) (
b >= sum( i in tasks ) (
bool2int( occurs(s[i]) /\ deopt(s[i]) <= t /\ t < deopt(s[i]) + d[i] ) * r[i]
)
);