Advertisement
pmanriquez93

Problema propuesto pag. 73

Oct 24th, 2014
3,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MODEL:
  2.  
  3. SETS:
  4.  
  5. MESES/1..6/;
  6. SUSTANCIAS/1..5/:DUREZA,II;
  7.  
  8. MATRIZ(MESES,SUSTANCIAS): COSTO, PROD, IF, COMP;
  9.  
  10. ENDSETS
  11.  
  12. DATA:
  13.  
  14. COSTO, PVENTA, ARTIFICIALMAX, NATURALMAX, ALMACEN, COSTOALM, DUREZAMIN, DUREZAMAX, DUREZA, II =
  15. @OLE('C:\Users\indust\Desktop\DataEjemploPropuesto.xlsx');
  16.  
  17. @OLE('C:\Users\indust\Desktop\DataEjemploPropuesto.xlsx') = PROD, COMP, IF;
  18.  
  19. ENDDATA
  20.  
  21. MAX = @SUM(MATRIZ(I,J): PROD(I,J)*PVENTA) - @SUM(MATRIZ(I,J):COSTO(I,J)*COMP(I,J)) -
  22.     @SUM(MATRIZ(I,J)|I#LE#5:IF(I,J)*COSTOALM) - @SUM(SUSTANCIAS(J):II(J)*COSTOALM);
  23.  
  24. !Refinar a lo mas 320 de artificial y 350 de natural;
  25. @FOR(MESES(I):@SUM(SUSTANCIAS(J)|J#LE#2:PROD(I,J)) <= ARTIFICIALMAX);
  26. @FOR(MESES(I):@SUM(SUSTANCIAS(J)|J#GT#2:PROD(I,J)) <= NATURALMAX);
  27.  
  28. !No sobrepasar limite almacen;
  29. @FOR(MATRIZ(I,J):IF(I,J)<=ALMACEN);
  30.  
  31. !Cosas locas de inventarios;
  32. @FOR(MATRIZ(I,J)|I#EQ#1:IF(I,J) = II(I) + COMP(I,J) - PROD(I,J));
  33. @FOR(MATRIZ(I,J)|I#GT#1:IF(I,J) = IF(I-1,J) + COMP(I,J) - PROD(I,J));
  34. @FOR(MATRIZ(I,J)|I#EQ#6:IF(I,J) = 730);
  35.  
  36. !Dureza max y min;
  37. @FOR(MESES(I):@SUM(SUSTANCIAS(J):DUREZA(J)*PROD(I,J))>=DUREZAMIN*(@SUM(MATRIZ(I,J):PROD(I,J))));
  38. @FOR(MESES(I):@SUM(SUSTANCIAS(J):DUREZA(J)*PROD(I,J))<=DUREZAMAX*(@SUM(MATRIZ(I,J):PROD(I,J))));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement