(a)
steel.mod: set PROD; # products param rate {PROD} > 0; # tons produced per hour param avail >= 0; # hours available in week param profit {PROD}; # profit per ton param market {PROD}; # limit on tons sold in week var Make {p in PROD} >= 0, <= market[p]; #tons produced maximize Total_Profit: sum {p in PROD} profit[p] * Make[p]; # Objective: total profits from all products subject to Time: sum {p in PROD} (1/rate[p]) * Make[p] <= avail; # Constraint: total of hours used by all # products may not exceed available hours(b)
steel.dat: set PROD := bands coils; param: rate profit market := bands 200 25 6000 coils 140 30 4000 param avail := 40;
Example 1: Input files.