Ejercicio Para Opl

Embed Size (px)

Citation preview

M1 M2 M3 TOTALESP1 5 5 7 370P2 4 5 6 350P3 1 2 3 100P4 4 6 8 400

M1=$500M2=$550M3=$650

int numP = 4;int numM=3;range pro= 1 numP;range mez=1numM;int unidades[pro][mez]=[[5,5,7], [4,5,6], [1,2,3], [4,6,8]];int totales[pro]=[370,350,100,400];int ganancias[mez]=[500,550,650];dvar int+ mezclas[mez];maximize sum(i in mez) ganancias[i]*mezcla[i];

subject to{ forall(i in pro){

}Errores tipicos de excel1. Hay que cerrar Excel antes de ejecutar el opl2. Para poder importar desde Excel dentro del dat escribir: Sheet Connection sheet(Nombre Excel.xlsx); Nombre Excel= Nombre del archive from SheetRead(sheet,nombreHoja!B3:D7);