$onUNDF Set k Customer Order /1*1000/ i Article /1*50/ j Warehouse /1,2/ ; Parameter c(j) capacity of warehouses j / 1 25, 2 43 /, a(i) articlesize of Article i e(i) dispatching of Article i p(i) plan quantity for Article i v(i) sale units per carton for Article i kap(i) Cartons per Palette for Article i ; Parameter Articleinformation(i,*) Datentabelle (Excel); $call "GDXXRW Articleinformation.xlsx se=0 set=i rng=Tabelle1!A2 rdim=1 cdim=0 par=Articleinformation rng=Tabelle1!A1:I51" $GDXIN "Articleinformation.gdx" $load Articleinformation $gdxin a(i) = Articleinformation(i,'articlesize'); e(i) = Articleinformation(i,'dispatching'); p(i) = Articleinformation(i,'plan quantity'); v(i) = Articleinformation(i,'sale units per carton'); kap(i) = Articleinformation(i,'Cartons per Palette'); Parameter customerorders(k,*) Datentabelle (Excel); $call "GDXXRW customerorders.xlsx se=0 set=k rng=Tabelle1!A2 rdim=1 cdim=0 par=customerorders rng=Tabelle1!A1:V1001" $GDXIN "customerorders.gdx" $load customerorders $gdxin Scalar TK Transportcost (€) /200/ SK Splitcost (€) /2/ WEC incoming goods department Costs Warehouse 2 (€) /4/ WAB sales department costs Warehouse 1 (€) /3/ binary variables x(i,j) Article-Warehouse-assignment (A-L-Z) S Split arise KA(k,j) customer order k serve from warehouse j; positive variables AP number of palette KO costs LKWS needed trucks free variables SQ Splitquote; Equations ZF aimfunction KR capacity-restriction ALZ Article-Warehouse-assignment (alle) SdK Splits of customer orders DEZK1 Article-Warehouse-assignment for DEZK-Article DEZK2 Article-Warehouse-assignment for DEZK-Article MC1 Article-Warehouse-assignment for Multi-Channel-Article MC2 Article-Warehouse-assignment for Multi-Channel-Article PB1 Palette-calculation for Article i which is placed on both warehouses PB2 Palette-calculation for Article i which is only placed on warehouse 2 LKW LKWs für Versorgung des Lagers Cheb Kos costs-calculation KAZ customer orders-assignment to warehouse j ; ZF.. SQ =E= Sum(k, S(k))/card(k); *aimfunction: Minimize Splitquote KR(j).. Sum(i, x(i,j) ) =E= c(j); *capacity-restriction ALZ(i).. Sum(j, x(i,j) ) =G= 1; *each Article have to be place at least on one warehouse SdK(k).. S(k) =e= ifthen(KA(k,"1")=1 AND KA(k,"2")=1,1,0); *if a customer order k serves from warehouse 1 and warehouse 2, then you have a split DEZK1(i)$(a(i) = 2).. x(i,"1") =E= 1; DEZK2(i)$(a(i) = 2).. x(i,"2") =E= 0; *if a Article have the size 2, place it only on warehouse 1 MC1(i)$(e(i) = 1).. x(i,"1") =E= 1; MC2(i)$(e(i) = 1).. x(i,"2") =E= 1; *if a Article have the size 1, place it only on warehouse 1 and warehouse 2 PB1(i).. AP(i) =e= ifthen((x(i,"1")=1 AND x(i,"2")=1),ceil((p(i)*0.8)/(v(i)*kap(i))),0); *calculation of the needed number of Palette for Article, which is place on both warehouses PB2(i).. AP(i) =e= ifthen((x(i,"2")=1 AND x(i,"1")=0),ceil((p(i)*0.9)/(v(i)*kap(i))),0); *calculation of the needed number of Palette for Article, which is place only on warehouse 2 LKW.. LKWs =e= ceil(sum(i, AP(i))/20); *calculation of the needed number of trucks Kos.. KO =e= LKWs * TK + sum(i, AP(i)) * (WEC + WAB) + SK * Sum(k,S(k)); *calucation of the total costs KAZ(k).. Sum(j, KA(k,j)) =G= 1 *each customer order have to serve at least from one warehouse model Model1 /all/; Solve Model1 minimizing SQ using rminlp;