CutStock
OptiMax Sample of the CutStock Application
TITLE
CuttingStock;
INDEX
cuts := EXCELRANGE("CutStock.xls", "CutsTable", 1);
patterns := EXCELRANGE("PatternTable",1);
DATA
PriceSheet := EXCELRANGE("PriceSheet");
SheetsAvail := EXCELRANGE("SheetsAvail");
CutWidths[cuts] := EXCELSPARSE("CutsTable",2);
CutDemand[cuts] := EXCELSPARSE("CutsTable",3);
PatWaste[patterns] := EXCELRANGE("PatternTable");
CutsInPattern[patterns, cuts] := EXCELRANGE("Patterns");
VAR
PatternCount[patterns] -> "" EXPORT TO EXCELRANGE("CutStock.xls", "PatCount");
SheetsCut -> T1 EXPORT TO EXCELRANGE("SheetsToCut");
TotalCost -> TC EXPORT TO EXCELRANGE("TotalCost");
ExcessCuts[cuts] -> "X";
MODEL
MIN z = PriceSheet*SheetsCut;
SUBJECT TO
TotCost: TotalCost = PriceSheet * SheetsCut;
RawAvail: SheetsCut < SheetsAvail;
Sheets: SheetsCut = SUM(patterns: PatternCount[patterns]);
CutReq[cuts]:
SUM(patterns: CutsInPattern[patterns, cuts] * PatternCount[patterns])
= CutDemand[cuts] + ExcessCuts[cuts];
END