Está en la página 1de 3

/*CONJUNTOS*/

set V; /*Vegetales*/

set C; /*Carnes*/

set P; /*Postre*/

set N; /*Nutrientes*/

/*PARÁMETROS*/

param a{V,N}; /*Cantidad de nutriente n en el vegetal v*/

param b{C,N}; /*Cantidad de nutriente n en la carne c*/

param d{P,N}; /*Cantidad de nutriente n en el postre p*/

param e{V}; /*Costo por porción del vegetal v*/

param f{C}; /*Costo por porción de la carne c*/

param g{P}; /*Costo por porción del postre p*/

param h:=1; /*Minimo de porciones a servir por categoria*/

param j:=10; /*Máximo de porciones a servir por categoria*/

param i{N}; /*Cantidad de nutriente n en el menu*/

/*VARIABLES DECISIÓN*/

var x{V}>=0; /*Cantidad de porciones del vegetal v*/

var y{C}>=0; /*Cantidad de porciones de la carne c*/

var w{P}>=0; /*Cantidad de porciones del postre*/

var k{V} binary; /*1:Sirvo el vegetal v*/

var m{C} binary; /*1:Sirvo la carne c*/

var o{P} binary; /*1:Sirvo el postre p*/

/*FUNCIÓN OBJETIVO*/

minimize z:((sum{v in V}x[v]*e[v])+(sum{c in C} y[c]*f[c])+(sum{p in P}w[p]*g[p]));

/*RESTRICCIONES*/
s.t. porciones_v{v in V}: x[v]<= k[v]*j;

s.t. porciones_c{c in C}: y[c]<= m[c]*j;

s.t. porciones_p{p in P}: w[p]<= o[p]*j;

s.t. sirvo_v: sum{v in V} x[v]>= h;

s.t. sirvo_c: sum{c in C} y[c]>=h;

s.t. sirvo_p: sum{p in P} w[p]>=h;

data;

set V:= CH EJ QU MA MAC AR;

set C:= PO RE PE;

set P:= NA MAN BU GE;

set N:= C V P GR;

param a: C V P GR:=

CH 1 3 1 0

EJ 1 5 2 0

QU 1 5 1 0

MA 2 6 1 2

MAC 4 2 1 1

AR 5 1 1 1;

param b: C V P GR:=

PO 2 1 3 1

RE 3 8 5 2

PE 3 6 6 1;

param d: C V P GR:=

NA 1 3 1 0

MAN 1 2 0 0

BU 1 0 0 0

GE 1 0 0 0;

param e:= CH 0.10 EJ 0.12 QU 0.13 MA 0.09 MAC 0.1 AR 0.07;


param f:= PO 0.7 RE 1.2 PE 0.63;

param g:= NA 0.28 MAN 0.42 BU 0.15 GE 0.12;

param i:= C 5 V 10 P 10 GR 2;

end;

También podría gustarte