forked from burakbayramli/books
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.food.smg
35 lines (33 loc) · 986 Bytes
/
1.food.smg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
MODEL Food
DATA
maxt = 6, maxi = 5;
SET
A = {1 .. 2}, B = {3 .. 5},
T = {1 .. maxt}, I = {1 .. maxi};
DATA
cost[T,I] << "cost.dat",
hard[I] << "hard.dat";
VARIABLES
b[I,T], u[I,T], s[I,T],
Prod[T];
OBJECTIVE
MAXIMIZE prof = sum{t in T} (150*Prod[t] - sum{i in I} (
cost[t,i]*b[i,t] + 5*s[i,t]));
CONSTRAINTS
loil{i in I, 1}: b[i,1] - u[i,1] - s[i,1] = -500,
loil{i in I, t in T, t > 1}:
s[i,t-1] + b[i,t] - u[i,t] - s[i, t] = 0,
vveg{t in T}: sum{i in A} u[i,t] <= 200,
voil{t in T}: sum{i in B} u[i,t] <= 250,
uhrd{t in T}: sum{i in I} hard[i]*u[i,t] - 6*Prod[t] <= 0,
lhrd{t in T}: sum{i in I} hard[i]*u[i,t] - 3*Prod[t] >= 0,
cont{t in T}: sum{i in I} u[i,t] - Prod[t] = 0,
/* Specify bounds for the variables */
for {i in I, t in T, t<maxt}
s[i,t] <= 1000,
for {i in I}
s[i,maxt] = 500;
END MODEL
solve Food;
print solution for Food >> "Food.sol";
quit;