12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

●The fact that a limited amount of raw oil can be stored for later use is expressed likethis:if (i == 0) {for (IloInt p = 0; p < nbProducts; p++)model.add(500 + buy[i][p] == use[i][p] + store[i][p]);}else {for (IloInt p = 0; p < nbProducts; p++)model.add(store[i-1][p] + buy[i][p] ==use[i][p] + store[i][p]);}What Is the Objective?On a monthly basis, the profit can be represented as the sale price per ton (150) multipliedby the amount produced minus the cost of production and storage, like this, where profitis defined as IloExpr profit(env);:profit += 150 * produce[i] - IloScalProd(cost[i],buy[i]) - 5 * IloSum(store[i]);Developing the ModelFirst, create the model, like this:IloModel model(env);<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 363

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!