A cumulative scheduling constraint. StartTimes, Durations, Usages and Scheduled are collections (a la collection_to_list/2) of equal size N, representing N task. Durations must be non-negative, Usages and ResourceLimit must be strictly positive, and Scheduled are booleans (values of 0/1). The declarative meaning is:
The N tasks, each starting at a certain start time, having a certain duration and consuming a certain (constant) amount of resource, then the sum of resource usage of all the tasks does not exceed ResourceLimit at any time. A task would not be scheduled if its Scheduled boolean is 0, and must be scheduled if 1. /P>
A zero duration task both consume and release the resource it uses at the same time-point, so effectively it does not consume any resources at that time-point, but there must be sufficient resources available at that time-point to allow the task to be scheduled. <
Note that the constraint is implemented by different Gecode propagators, depending on if Durations contains domain variables or not. If Durations does have domain variables, the Gecode propagator requires an extra End domain variable specifying the end time, and a constraint
End #= Start + Durationfor each task. These are posted as part of the constraint (the End variables are not accessible by the user).
Any input variables which are not already domain variables are turned into domain variables with default domain.