$TITLE  MINING ORE PROBLEM
$OFFUPPER
* This problem finds the minimum cost for mining ore while
*   meeting the demand.
*
*  References: 
*              J.E. Beasley notes on OR
*

  SETS
       MINES   mining companies   / MINE1,MINE2 /
       CLASS   classes of ore          / HIGH,MEDIUM,LOW/ ;



TABLE    PRODUCTION(MINES,CLASS) tons per day operating characteristics
                            HIGH       MEDIUM    LOW
              MINE1          6          3         4
              MINE2          1          1         6  ;

PARAMETER DEMAND(CLASS)  demand for ore
            / HIGH   12
              MEDIUM 8
              LOW    24 /;
                     

PARAMETER COST(MINES)  cost per day
            / MINE1   180
              MINE2   160  /;


  VARIABLES
       DAYS(MINES)  days to work for each mine
       Z       total return in revenue  ;

POSITIVE VARIABLE DAYS ;


EQUATIONS
       CONTRACT      meet demand 
       OBJ        define objective function;

OBJ ..        Z  =E=  SUM(MINES, COST(MINES)*DAYS(MINES) )  ;


CONTRACT(CLASS) ..      SUM((MINES),  PRODUCTION(MINES,CLASS)*DAYS(MINES) )
                    =G= DEMAND(CLASS);

MODEL MINEPROD /ALL/ ;

SOLVE MINEPROD USING LP MINIMIZING Z ;

  DISPLAY DAYS.L, DAYS.M ;
