Can't understand the constraint on page192, "Do not exceed capacity".
IntSetArgs c(n_warehouses);
for(int w = 0; w < n_warehouses; ++w){
c[w] = IntSet(0, capacity[w]);
//IntSet(0, 1) == {}, {0}, {1}, {0, 1}
}
count(*this, supplier, c, ICL_DOM);
The document say the count function build a constraint which equal to "Do not exceed capacity". But I don't know why?
1 : what is the different with and without ICL_DOM?
2 : According to 4.4.8(pg 63)
if c is not a set but an IntArrayArgs and without ICL_DOM, it is like posting the constraint as following?
int capacity[] = {1, 4, 2, 1, 3};
supplier[0] == 0 == c[0] == 1
supplier[0] == 1 == c[1] == 4
supplier[0] == 2 == c[2] == 2
supplier[0] == 3 == c[3] == 1
supplier[0] == 4 == c[4] == 3
supplier[1] == 0 == c[0] == 1 //and so on
What if the c is a set? is this mean that the constraint would become
supplier[0] == 0 == c[0] == 0, 1
supplier[0] == 1 == c[1] == 0, 1, 2, 3, 4
//....
supplier[1] == 0 == c[0] == 0, 1
supplier[1] == 1 == c[1] == 0, 1, 2, 3, 4 //and so on?
I don't get why this could make the "Do not exceed capacity" constraint hold.
for me, it should be(pseudo codes)
rel(*this, sum(supplier == 0) <= 1);
rel(*this, sum(supplier == 1) <= 4);
rel(*this, sum(supplier == 2) <= 2);
rel(*this, sum(supplier == 3) <= 1);
rel(*this, sum(supplier == 4) <= 3);