Reputation: 11
I am trying to make a constraint in CPLEX which uses the ceil()
function, but keep getting the "cannot extract expression" error. This is the constraint:
forall(j in d, k in b, l in r){
ct14: sum(l in r)(ceil((sum(k in b)X1[j][k][l])/3)); <= 10;
}
If evaluated outside as a script, CPLEX can evaluate the left hand term but is unable to do so when used as a constraint. I cannot find any examples of constraints which use ceil()
, but I imagine it is possible to do and there is something wrong with my implementation.
Any help in correcting this error would be great!
Upvotes: 0
Views: 783
Reputation: 2072
No, I don't think that will work. You can only use a few limited expressions in constraints. You will have to restructure your model to use additional variables to capture the max of each subset of variables. Then write your constraint over those extra variables.
Upvotes: 1