I am using Choco to solve a CSP. I want to do something like this:
BoolVar[] badRow = getBadRow();
solver.findOptimalSolution(ResolutionPolicy.MINIMIZE, sum(badRow));
In other words, i want the system to find a solution where badRow has the fewest true values in it. I don't want this to be a "constraint" because then the system will just fail, and I want to avoid failures. But I cant find any way to create an IntVar as a sum of other variables.
How do I accomplish this?