cout << " Maximum profit = " << cplex.getObjValue() << endl;
for (IloInt i = 0; i < nbMonths; i++) {
IloInt p;
cout << " Month " << i << " " << endl;
cout << " . buy ";
for (p = 0; p < nbProducts; p++) {
cout << cplex.getValue(buy[i][p]) << "\t ";
}
cout << endl;
cout << " . use ";
for (p = 0; p < nbProducts; p++) {
cout << cplex.getValue(use[i][p]) << "\t ";
}
cout << endl;
cout << " . store ";
for (p = 0; p < nbProducts; p++) {
cout << cplex.getValue(store[i][p]) << "\t ";
}
cout << endl;
}
}
else {
cout << " No solution found" << endl;
|