String constraints

Describes the use of string constraints in OPL.

String constraints cannot be used on decision variables or added to the model to be solved. They can only be used on indexers to filter aggregates (see Filtering with constraints). For example:


{string} s = {"a", "b"};
dvar int x[s] in 0..10; 
minimize sum(i in s) x[i];
subject to {
   forall(i in s : i != "a")
   x[i] >= 5;
}