Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. def Inequal2_rule(model):
  2. temp=0
  3. for x in model.method:
  4. for y in model.crop:
  5. temp=temp+model.const1[x, y]*model.Amount[x, y]
  6. return temp >= 200
  7. model.Inequal2 = Constraint(rule=Inequal2_rule)
  8.  
  9. def Inequal3_rule(model):
  10. temp=0
  11. for x in model.method:
  12. for y in model.crop:
  13. temp=temp+model.const2[x, y]*model.Amount[x, y]
  14. return temp >= 240
  15. model.Inequal3 = Constraint(rule=Inequal3_rule)
  16.  
  17. param : const1 :=
  18. 1 1 2.5
  19. 1 2 0
  20. 1 3 0
  21. 1 4 0
  22. 2 1 -1
  23. 2 2 0
  24. 2 3 0
  25. 2 4 0
  26. 3 1 1
  27. 3 2 0
  28. 3 3 0
  29. 3 4 0
  30. ;
  31.  
  32. param : const2 :=
  33. 1 1 0
  34. 1 2 3
  35. 1 3 0
  36. 1 4 0
  37. 2 1 0
  38. 2 2 -1
  39. 2 3 0
  40. 2 4 0
  41. 3 1 0
  42. 3 2 1
  43. 3 3 0
  44. 3 4 0
  45. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement