My fault. The constraint was defined inside a loop so it was local. Fixed. I guess once I remove the constraint, I have to call again the cp.solve or cp.StartewSearch, is that correct?
What if I try to modify the bounds of the constraint? It looks like with cplex is possible but with cp is not.
ct.add(IloBound(10, IloBound::Lower)); is fine with cplex but with cp it does not recognize the IloBound.
thanks so much
------------------------------
javier rodrigo
------------------------------
Original Message:
Sent: Wed November 17, 2021 11:58 AM
From: Renaud Dumeur
Subject: Removing constraints CP
Dear Javier,
You should be able to use the "remove" method of the "IloModel" class: https://www.ibm.com/docs/en/icos/20.1.0?topic=classes-ilomodel
Its signatures accept IloExtractable objects which can be anything added to the model.
Cheers,
------------------------------
Renaud Dumeur
Original Message:
Sent: Wed November 17, 2021 06:56 AM
From: javier rodrigo
Subject: Removing constraints CP
Hello,
Once I have the model written (CP with C++ API), if there's no solution, I would like to remove some constraints. I've see the model.remove(obj) but it seems is only valid for removing objectives but not constraints. Which is the right way to do it? The constraints are defined with IloConstraint in order to give them a name.
Cheers
------------------------------
javier rodrigo
------------------------------
#DecisionOptimization