lengthOf

OPL integer expression (scheduling) to access the length of an interval

context type
Model files (.mod)
dexpr int

Syntax

dexpr int lengthOf (a[,dval]);
 
Where:
dvar interval a;
int dval;

Description

This integer expression is used to access the length of an interval. Note that the expression sizeOf is also available. Interval size, length, and intensity are always related by the following formula: size multiplied by granularity is equal to the integral of the intensity over the length of the interval. Intensity cannot exceed 100%, so interval size can never exceed interval length.

Special care must be taken for optional intervals: in this case an integer value dval must be specified, to represent the value of the expression when the interval is absent. If this value is omitted, it is considered to be 0.