$TITLE AIRPLANE PURCHASE PROBLEM (TRNSPORT,SEQ=1) $OFFUPPER * This problem finds an optimal buying strategy * SETS J airplane range types / long, medium, short/ I resources / price, maint / ; PARAMETER B(I) resource availability /price 150 maint 40/; PARAMETER C(J) annual profit in thousands of dollars per airplane /long 420 medium 300 short 230/; TABLE D(J,I) price and maintenance data price maint long 6.7 1.6667 medium 5.0 1.3334 short 3.5 1 ; VARIABLES X(J) number of planes bought of type J Y(J) indicator for plane types bought Z total profit in thousands of dollars ; INTEGER VARIABLE X ; BINARY VARIABLE Y ; EQUATIONS PROFIT define objective function RES(I) resource constraints PILOT satisfy pilot supply TYPES restrict to two types of airplanes bought TTYPES(J) force variable to 0; PROFIT .. Z =E= SUM(J, C(J)*X(J)) ; RES(I) .. SUM(J, D(J,I)*X(J)) =L= B(I) ; PILOT .. SUM(J, X(J)) =L= 30 ; TYPES .. SUM(J, Y(J)) =L= 2 ; TTYPES(J) .. X(J) =L= 30*Y(J) ; MODEL PURCHASE /ALL/ ; SOLVE PURCHASE USING MIP MAXIMIZING Z ; DISPLAY X.L, X.M ;