Parameters defined with more than 2 sets in MathProg

View: New views
1 Messages — Rating Filter:   Alert me  

Parameters defined with more than 2 sets in MathProg

by haroitman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I would like to know how to specify a parameter with more than 2 sets using XLI_MathProg view.

For example, in the diet problem below, how is writen the matrix amt if it is added to it a new set ORIGIN:= ORGANIC INDUSTRIAL;

That is,

amt {NUTR,FOOD,ORIGIN} >= 0;

but, how is defined the matrix with amt's values?

Thank you,


Hernan





Diet1.mod

set NUTR;
set FOOD;

param cost {FOOD} > 0;
param f_min {FOOD} >= 0;
param f_max {j in FOOD} >= f_min[j];

param n_min {NUTR} >= 0;
param n_max {i in NUTR} >= n_min[i];

param amt {NUTR,FOOD} >= 0;

var Buy {j in FOOD} >= f_min[j], <= f_max[j];

minimize total_cost:  sum {j in FOOD} cost[j] * Buy[j];

subject to diet {i in NUTR}:
   n_min[i] <= sum {j in FOOD} amt[i,j] * Buy[j] <= n_max[i];


data;

set NUTR := A B1 B2 C ;
set FOOD := BEEF CHK FISH HAM MCH MTL SPG TUR ;

param:   cost  f_min  f_max :=
  BEEF   3.19    0     100
  CHK    2.59    0     100
  FISH   2.29    0     100
  HAM    2.89    0     100
  MCH    1.89    0     100
  MTL    1.99    0     100
  SPG    1.99    0     100
  TUR    2.49    0     100 ;

param:   n_min  n_max :=
   A      700   10000
   C      700   10000
   B1     700   10000
   B2     700   10000 ;

param amt (tr):
           A    C   B1   B2 :=
   BEEF   60   20   10   15
   CHK     8    0   20   20
   FISH    8   10   15   10
   HAM    40   40   35   10
   MCH    15   35   15   15
   MTL    70   30   15   15
   SPG    25   50   25   15
   TUR    60   20   15   10 ;
end;