stepAt

Returns an elementary cumul function of constant value after a given point.

Syntax


cumulAtom stepAt(sint t, uint h)

Parameters

  • t: integer.
  • h: non-negative integer representing the height of the contribution after point t.

Description

This function returns an elementary cumul function expression that is equal to 0 before point t and equal to h after point t.

Example


p1 = intervalVar(size=5);
p2 = intervalVar(size=7);
c1 = intervalVar(size=1);
c2 = intervalVar(size=1);
c3 = intervalVar(size=1);
// Inventory with initial level 1. 
// Production activities p1 and p2 respectively produce 5 and 7 units at their end time. 
// Consumption activities c1,c2,c3 respectively consume 4,3 and 4 units at their start time.
inventoryLevel = stepAt(0,1) + stepAtEnd(p1,5) + stepAtEnd(p2,7) - stepAtStart(c1,4) - stepAtStart(c2, 3) - stepAtStart(c3, 4);
// Inventory level should at any moment belong to range [0,8].
cumulRange(inventoryLevel, 0, 8);
// Production and consumption activities do not overlap.
noOverlap([p1,p2,c1,c2,c3]);