The Constraint Programming Solver
CUMULATIVE Predicate
CUMULATIVE(options)
The CUMULATIVE predicate specifies a cumulative (scheduling) constraint. A cumulative constraint conveys that a collection of tasks (activities) is to be executed on a resource that has limited capacity. Each task is defined by its start time, duration (processing time), end time (finish time), and demand (resource usage). A task i is said to overlap a time point t if and only if its start time is less than or equal to t and its end time is strictly greater than t. The cumulative constraint enforces that at each point in time, the accumulated demand (resource usage) of the tasks that overlap the time point does not exceed the specified capacity of the resource.
A cumulative constraint also enforces the following equation for all tasks i:
Each CUMULATIVE predicate specifies starting and ending times (one of which can be implied by specifying a duration), and optionally specifies demand and capacity. The CUMULATIVE predicate is specified using a sequence of options separated by commas. Each option uses a variable-list or variable-item, which are defined in the section Common Syntax Components. You can specify variables, linear expressions, and constant values in the same list. You can specify the following options in any order:
The CUMULATIVE predicate is subject to the following additional restrictions:
You must specify at least two of the START=, DURATION=, and END= options.
The variable-list of at least one of the START=, DURATION= , and END= options must contain a nonconstant value.
The variable-lists specified in the START=, DURATION=, END=, and DEMAND= options must have the same number of values after the lists are expanded.
For example, the following statements use the CUMULATIVE predicate to schedule tasks that use two resources with varying requirements for each resource:
proc optmodel;
set TASKS=1..5;
var start{TASKS} integer >= 0;
var end{TASKS} integer >= 0;
num dur{TASKS} = [1 1 2 3 1];
var z integer >= 0 <= 100;
con done{i in TASKS}: end[i] <= z;
min obj = z;
con c1: cumulative(start=start, end=end, dur=dur,
demand=4 3 3 2 1, limit=5);
con c2: cumulative(start=start, end=end, dur=dur,
demand=1 1 2 2 2, limit=3);
solve;
print start end;
quit;