How to check in Choco if a complex variable satisfies the constraints? For example, if I have the following list of configurations:
int[][] configurations = new int[][] {
{20, 24, 10, 3, 4},
{20, 13, 1, 3, 4}};
where config1 = {20, 24, 10, 3, 4} and config2 = {20, 13, 1, 3, 4}
int[] constraints = new int[]{21, 15, 2, 10, 10};
is a list of constraints such that, for a given configuration each element in the configuration needs to be higher (or lower) than the coresponding constraint. For example: config1 = {20, 24, 10, 3, 4} constraints = {21, 15, 2, 10, 10}
check if config1[0] < constraints[0] AND config1[1] < constraints[1] AND ...
If all the constraints are satisfied then just mark it as a solution. This is what I have
// c = number of configurations
// q = number of elements in each configuration
// p = configurations matrix
for (int i = 0; i < c; i++) {
for (int j = 0; j < q; j++) {
model.arithm(model.intVar(p[i][j]), "<", model.intVar(k[j])).post();
}
}