SHARE
TWEET

Untitled

a guest Oct 15th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sets
  2.     i vectorb /fila0*fila50/
  3.     j costos /c1,c2/;
  4.  
  5. Variables
  6.          x(j) x(j)
  7.          z cosa a maximizar;
  8.  
  9. Positive variables x;
  10.  
  11. Table A(i,j) 'Matriz A'  
  12. $ondelim
  13. $include matrizA.csv
  14. $offdelim
  15. ;
  16.  
  17.  
  18. Table b(i,*) 'Vector b'
  19. $ondelim
  20. $include vectorb.csv
  21. $offdelim
  22. ;
  23.  
  24. Table c(j,*) 'Costos'
  25. $ondelim
  26. $include costos.csv
  27. $offdelim
  28. ;
  29.  
  30.  
  31. Equations
  32.      objetivo    define objective function
  33.      restri(i)   restriccion i;
  34.  
  35. objetivo .. z =e= sum(j, c(j,'col0')*x(j));
  36.  
  37. restri(i) .. sum(j, A(i,j)*x(j)) =l= b(i,'col0');
  38.  
  39. Model tarea2 /all/;
  40.  
  41. Solve tarea2 using lp minimizing z ;
  42.  
  43. Display x.l  ;
  44.  
  45. File results /results.dat/;
  46. put results;
  47. put 'Solucion ' / / ;
  48. loop(j, put @3, j.tl, @15, x.l(j)/);
  49. put @3 z @15 z.l;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top