I am trying to place an addExactlyOne() constraint, only enforced upon another literal:
>> model.addExactlyOne(workers).onlyEnforceIf(timeIsAfterStepStart);
Including this line causes the following "INVALID MODEL" status:
>> Starting CP-SAT solver v9.3.10497
>> Parameters: log_search_progress: true
>> Setting number of workers to 4
>> Invalid model: Enforcement literal not supported in constraint: enforcement_literal: 24 exactly_one { literals: 0 }
It appears that the constraint addExactlyOne() - which was added in the most recent release (March '22) - does not support onlyEnforceIf(). Is this by design? Are there any workarounds? What I'm trying to do seems like a reasonable use of the API.
This is a crosspost for
this StackOverflow question, a minimum reproducible example is there. If resolved here I will update/answer that question.