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.

Notice that how much to use and buy is initially unknown, and thus has an infinite upperbound, whereas the amount of oil that can be stored is limited, as you know from thedescription of the problem. Consequently, one of the constraints is expressed here as theupper bound of 1000 on the amount of oil by type that can be stored per month.What Are the Constraints?As you know from Describing the Problem on page 360, there are a variety of constraints inthis problem.For each type of oil, there must be 500 tons in storage at the end of the plan. That idea can beexpressed like this:The constraints on production in each month can all be expressed as statements in a for-loop:●for (p = 0; p < nbProducts; p++) {store[nbMonths-1][p].setBounds(500, 500);}Not more than 200 tons of vegetable oil can be refined.model.add(use[i][v1] + use[i][v2] = 20) || (use[i][v2] >= 20),use[i][o3] >= 20));●The constraint that if an oil is used at all in a blend, at least 20 tons of it must be usedis expressed like this:for (p = 0; p < nbProducts; p++)model.add((use[i][p] == 0) || (use[i][p] >= 20));Note: Alternatively, you could use semi-continuous variables.362 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

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

Saved successfully!

Ooh no, something went wrong!