// Set up two solutions.
// sol: Holds only the 0-1 variables which defining the open warehouses
// whole: Holds the variables which assign a warehouse to each client
// NOTE: whole defines a solution, whereas sol only defines which
// warehouses will be used. The clients must be then be assigned
// a specific warehouse each for a complete solution.
// We perform local search over the openness of warehouses,
// and at each move assign the customers to warehouses.
IloSolution sol(env);
IloObjective obj = IloMinimize(env, cost);
sol.add(obj);
for (i = 0; i < nbWhouses; i++) {
char name[10];
sprintf(name, "O-%ld", i);
open[i].setName(name);
sol.add(open[i]);
}
IloSolution whole(env);
whole.add(obj);
whole.add(offer);
|