ࡱ> Root EntryRoot Entry*0_^P^ContentsD {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Courier New;}} {\colortbl ;\red0\green175\blue0;\red0\green0\blue0;\red0\green0\blue255;} \viewkind4\uc1\pard\cf1\f0\fs20 ! Good Products Plant and Product selection in LINGO;\cf2 \par \cf3 SETS\cf2 : \par Plant: Open, Cap; \par Product: Profit, Sales, Y; \par Combo(Plant,Product): X, Hours; \par \cf3 ENDSETS\cf2 \par \cf3 DATA\cf2 : \par MaxPlnt= 1; \cf1 ! Max plants allowed to be used;\cf2 \par MaxPrd = 2; \cf1 ! Max products allowed;\cf2 \par Plant= Plant1 Plant2; \par Cap = 30 40; \cf1 ! Capacity of each plant;\cf2 \par Product= Prod1 Prod2 Prod3; \par Profit= 5 7 3; \cf1 ! Profit/unit, each product;\cf2 \par Sales= 7 5 9; \cf1 ! Max sales possible, each prod;\cf2 \par Hours= 3 4 2 \cf1 ! Hours/unit needed;\cf2 \par 4 6 2; \cf1 ! by plant;\cf2 \par \cf3 ENDDATA\cf2 \par \par \cf3 Max\cf2 = \cf3 @SUM\cf2 ( Combo(i,j): Profit(j)*X(i,j)); \par \par \cf3 @FOR\cf2 ( Combo(i,j): \par \cf1 ! If we produce any product j, turn on its indicator variable, \par note, we can produce at most Sales(j) of product j;\cf2 \par X(i,j) <= Sales(j)*Y(j); \par ); \par \par \cf3 @FOR\cf2 ( Product(j): \par \cf1 ! Make Y(j) binary;\cf2 \par \cf3 @BIN\cf2 ( Y(j)); \par ); \par \par \cf1 ! Limit on number products produced;\cf2 \par \cf3 @SUM\cf2 (Product(j): Y(j)) <= MaxPrd; \par \par \cf1 ! Plant capacities;\cf2 \par \cf3 @FOR\cf2 ( Plant(i): \par \cf3 @SUM\cf2 ( Product(j): Hours(i,j)*X(i,j)) <= Cap(i)*Open(i); \par \cf3 @BIN\cf2 ( Open(i)); \par ); \par \par \cf1 ! Limit on number of plants used;\cf2 \par \cf3 @SUM\cf2 ( Plant(i): Open(i)) <= MaxPlnt; \par \par \par }