Constraint cumulative
Here, we have a collection of tasks, each one described by 4 attributes: origin, length, end and height. In XCSP3, the element ends is optional. The constraint cumulative [AB93] enforces that at each point in time, the cumulated height of tasks that overlap that point, respects a numerical condition $(\odot,k)$ composed of an operator in {lt,le,ge,gt,in,notin} and a right operand which is an integer value, a variable or an integer interval. When the operator `le’ is used, this corresponds to not exceeding a given limit.
If the element ends is present, for the semantics, we have additionally that: $\forall i : 1 \leq i \leq |X| , x_i + l_i = e_i$
Syntax
<cumulative>
<origins> (intVar wspace)2+ </origins>
<lengths> (intVal wspace)2+ | (intVar wspace)2+ </lengths>
[<ends> (intVar wspace)2+ </ends>]
<heights> (intVal wspace)2+ | (intVar wspace)2+ </heights>
<condition> "(" operator "," operand ")" </condition>
</cumulative>
Example
<cumulative>
<origins> s1 s2 s3 s4 </origins>
<lengths> l1 l2 l3 l4 </lengths>
<heights> h1 h2 h3 h4 </heights>
<condition> (le,4) </condition>
</cumulative>
A refined form of cumulative corresponds to the constraint sometimes called cumulatives [BC02] We have a set of available machines (resources), with their respective numerical conditions in conditions which replaces condition through a sequence of pairs composed of an operator and an operand. Each task is thus performed by a machine, which is given in an element machines. For each machine, the cumulated height of tasks that overlap a time point for this machine must respect the numerical (capacity) condition associated with the machine. The optional attribute startIndex gives the number used for indexing the first numerical condition (and so, the first machine) in this list (0, by default).
Syntax
<cumulative>
<origins> (intVar wspace)2+ </origins>
<lengths> (intVal wspace)2+ | (intVar wspace)2+ </lengths>
[ <ends> (intVar wspace)2+ </ends> ]
<heights> (intVal wspace)2+ | (intVar wspace)2+ </heights>
<machines> (intVar wspace)2+ </machines>
<conditions [ startIndex="integer" ]>
("(" operator "," operand ")")2+
</conditions>
</cumulative>