optional
OPL keyword (CP, scheduling) used to declare an interval as optional.
Purpose
OPL keyword (CP, scheduling) used to declare an interval as optional.
context |
---|
Model files (.mod) |
Syntax
dvar interval a [optional[(IsOptional)]] Where: boolean IsOptional;
Description
Interval variables can be optional; that is, one can decide not to consider them in the solution schedule. This concept is crucial in many applications; for example when activities can execute on different resources with different characteristics and constraints, when operations can be processed in different temporal modes, or when activities can be left unperformed.
Although optional is a CP keyword it is still accepted as a CPLEX identifier.
Example
An optional interval variable with size 10, that when present must start after value 20 and end before value 1000:
dvar interval
a optional in 20..1000 size 10
;