Advertisement
Guest User

tc3001-2014-10-30-kilroy

a guest
Oct 30th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. MODEL:
  2. SETS:
  3. !Definicion del conjunto de indices;
  4. CIUDADES / C1, C2, C3, C4, C5, C6/ :
  5. !Variables o constantes asociadas;
  6. x,c
  7. ;
  8. TIEMPOS( CIUDADES, CIUDADES) : t;
  9. ENDSETS
  10. DATA:
  11. c = 10 , 12, 14, 8, 10,12;
  12. t = 0,10,20,30,30,20,
  13. 10, 0,25,35,20,10,
  14. 20,25, 0,15,30,20,
  15. 30,35,15, 0,15,15,
  16. 30,20,30,15, 0,14,
  17. 20,10,20,25,14, 0;
  18. tiempoRequerido = 15;
  19. ENDDATA
  20. ! The objective: Minimizar el presupuesto total;
  21. [COSTO_TOTAL] MIN = @SUM(CIUDADES(i): c(i)*x(i));
  22.  
  23. ! Para cada ciudad garantizar que se tiene una estación de bomeberos POR LO MENOS
  24. a un tiempo no mayor de 15 minutos ;
  25. @FOR( CIUDADES( i) : [CUMPLIR] ! Para la ciudad i;
  26. @SUM( CIUDADES( j) | t(j,i) #LE# tiempoRequerido : x(j)) ! Contar las ciudades cuyo tiempo de acceso a la i sea NO MAYOR l requerido;
  27. >= !Que la cuenta seapor lo menos 1;
  28. 1
  29. );
  30. ! Make x binary(0/1);
  31. @FOR( CIUDADES(i): @BIN(x(i)));
  32. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement