Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Inequal2_rule(model):
- temp=0
- for x in model.method:
- for y in model.crop:
- temp=temp+model.const1[x, y]*model.Amount[x, y]
- return temp >= 200
- model.Inequal2 = Constraint(rule=Inequal2_rule)
- def Inequal3_rule(model):
- temp=0
- for x in model.method:
- for y in model.crop:
- temp=temp+model.const2[x, y]*model.Amount[x, y]
- return temp >= 240
- model.Inequal3 = Constraint(rule=Inequal3_rule)
- param : const1 :=
- 1 1 2.5
- 1 2 0
- 1 3 0
- 1 4 0
- 2 1 -1
- 2 2 0
- 2 3 0
- 2 4 0
- 3 1 1
- 3 2 0
- 3 3 0
- 3 4 0
- ;
- param : const2 :=
- 1 1 0
- 1 2 3
- 1 3 0
- 1 4 0
- 2 1 0
- 2 2 -1
- 2 3 0
- 2 4 0
- 3 1 0
- 3 2 1
- 3 3 0
- 3 4 0
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement