* Westerlund and coworkers * Note that the integer variables are considered continuous * and modeled through the introduction of binary variables * and appropriate constraints. OPTION ITERLIM=10000; * Sets SET i roll type /1*5/; SET j pattern number /1*5/; SET k /1*3/; SET p /1*4/; ALIAS(j,jj); * Parameters SCALAR nj / 4 /; PARAMETER n(i) number of orders for each roll type / '1' 12 '2' 6 '3' 15 '4' 6 '5' 9/; PARAMETER b(i) width of each roll / '1' 330 '2' 360 '3' 370 '4' 415 '5' 435/; PARAMETER mupp(j) upper bound on the number of repeats of pattern j / '1' 15 '2' 12 '3' 9 '4' 6 '5' 6/; PARAMETER rs starting point for r; TABLE rs(i,j) 1 2 3 4 5 1 1 0 0 0 0 2 1 0 0 0 0 3 1 0 0 0 0 4 1 0 0 0 0 5 1 0 0 0 0; VARIABLES r(i,j) number of rolls of type i in pattern j rr(i,j,k) binary variables representing r y(j) existence of pattern j m(j) repeats of pattern j mm(j,p) binary variables representing m objval objective function variable; FREE VARIABLES objval; BINARY VARIABLE y, rr, mm; POSITIVE VARIABLE r, m; EQUATIONS f Objective function numroll(i) order constraints ensuring sufficient production widthL(j) width lower bound constraint widthU(j) width upper bound constraint rL(j) logical constraint on r sumr(j) logical constraint on r mL(j) logical constraint on m mU(j) logical constraint on m sumbil lower bound on total number of patterns made yy(j) ordering of y variables to reduce degeneracy lmm(j) ordering of m variables to reduce degeneracy grr(i,j) representation of r through binary variables gmm(j) representation of r through binary variables; f .. objval =e=SUM(j,m(j)) + 0.1 * y('1') + 0.2 * y('2') + 0.3 * y('3') + 0.4 * y('4') + 0.5*y('5'); numroll(i) .. SUM(j,m(j) * r(i,j)) =g= n(i); widthL(j) .. SUM(i,-b(i) * r(i,j)) + 1800 * y(j) =l= 0; widthU(j) .. SUM(i,b(i) * r(i,j)) - 2000 * y(j) =l= 0; rL(j) .. y(j) - SUM(i,r(i,j)) =l= 0; sumr(j) .. SUM(i,r(i,j)) - 5 * y(j) =l= 0; mL(j) .. y(j) - m(j) =l= 0; mU(j) .. m(j) - mupp(j) * y(j) =l= 0; sumbil .. SUM(j,m(j)) =g= 10; yy(j)$(ORD(j) le nj) .. SUM(jj$(ORD(jj) eq ORD(j)+1),y(jj)) - y(j) =l= 0; lmm(j)$(ORD(j) le nj) .. SUM(jj$(ORD(jj) eq ORD(j)+1),m(jj)) - m(j) =l= 0; grr(i,j) .. r(i,j) =e= rr(i,j,'1') + 2*rr(i,j,'2') + 4*rr(i,j,'3'); gmm(j) .. m(j) =e= mm(j,'1') + 2*mm(j,'2') + 4*mm(j,'3') + 8*mm(j,'4'); * Bounds r.LO(i,j) = 0; r.UP(i,j) = 5; m.LO(j) = 0; m.UP(j) = mupp(j); * Starting point (global solution) * y.L('1') = 1; y.L('2') = 0; y.L('3') = 0; y.L('4') = 0; y.L('5') = 0; * m.L('1') = 15; m.L('2') = 0; m.L('3') = 0; m.L('4') = 0; m.L('5') = 0; * r.L(i,j) = rs(i,j); MODEL test /ALL/; SOLVE test USING MINLP MINIMIZING objval;