stepAtEnd

Returns an elementary cumul function of constant value after the end of an interval.

Syntax


cumulAtom stepAtEnd(intervalVar interval, uint h)
cumulAtom stepAtEnd(intervalVar interval, uint heightMin, uint heightMax)

Parameters

  • interval: interval variable contributing to the cumul function.
  • h: non-negative integer representing the height of the contribution.
  • heightMin: non-negative integer representing the the minimum of the range of possible values for the height of the contribution.
  • heightMax: non-negative integer representing the maximum of the range of possible values for the height of the contribution.

Description

This function returns an elementary cumul function expression that, whenever interval variable interval is present, is equal to 0 before the end of interval and equal to h after the end of interval. When a range [heightMin, heightMax) is specified it means that the height value h of the function is part of the decisions of the problem and will be fixed by the engine within this specified range. When interval variable interval is absent, the function is the constant zero function.

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]);

Requirements

  • For the function specifying a range for height, heightMax should be greater than heightMin.