So I have a simple question… I want to indicate the number of nurse requests that were granted – working in python.
In java I have:
maxRequestsMet = model.newIntVar(0, Integer.MAX_VALUE, "max requests");
model.maximize(linearExpressionTackingTotalRequestsMet);
model.addEquality(maxRequestsMet, linearExpressionTackingTotalRequestsMet);
and then I show this value of maxRequests.
But I’m struggling to do the same in python.
You’d think that
maxRequests = model.new_int_var(0, MAX_INT, "max requests")
model.maximize(linearExpressionTackingTotalRequestsMet);
model.add(maxRequests - linearExpressionTackingTotalRequestsMet == 0)
Would work but it doesn’t.
As soon as I add that extra constraint my model is no longer feasible – I remove the constraint, it goes back to feasible.
2