Originally posted by: mathygirl
Is there a way to name subconstraints in OPL?
By subconstraint, I mean a "forall" iteration nested inside an outer "forall".
In particular, the code below throws an error, though it demonstrates what I'm trying to do with "namedConstraint":
tuple Tsets {
{string} members;
}
{Tsets} mySet = {<{"s1", "s2"}>, <{"s3", "s4", "s5", "s6"}>, <{"s7", "s8", "s9"}>};
minimize myObjective;
subject to {
forall(s in mySet) {
forall(m in s.members) namedConstraint[m] {
doSomething;
}
}
}
#CPLEXOptimizers#DecisionOptimization