Hi, suppose we have a type of resource , the number of it changes over time t, this can be expressed by an array n[t in 0..T]. For example, in time 0-1, n[0] =10 (we have 10 units of resource); time 1-2, n[1] = 9; time 2-3, n[2] = 11,...

Activities (interval variables) a[i in 1..N] in 0..T+1 will consume this resource.

I want that:

at any time t , the number of resources consumed by activities should not exceed n[t].

How to express this constraint? I tried cumulative function, but failed.

Any help is appreciated.