forked from burakbayramli/books
-
Notifications
You must be signed in to change notification settings - Fork 0
/
9.economy.smg
48 lines (48 loc) · 1.63 KB
/
9.economy.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
36
37
38
39
40
41
42
43
44
45
46
47
48
MODEL Economy
SET
mi = {1 .. 3},
mip1 = {1 .. 4},
mt = {1 .. 5},
mtp1 = {1 .. 6},
mtp2 = {1 .. 7};
DATA
demand[mi] = [60,60,30],
istock[mi] = [150,80,100],
icap[mi] = [300,350,280],
findem[mi] = [166.4,105.7,92.3],
c[mip1,mi] = [0.1,0.5,0.4, ! = c
0.1,0.1,0.2,
0.2,0.1,0.2,
0.6,0.3,0.2],
d[mip1,mi] = [0.0,0.7,0.9, ! = d
0.1,0.1,0.2,
0.2,0.1,0.2,
0.4,0.2,0.1];
VARIABLES
out[mi,mtp1], ! = x
stk[mi,mtp1], ! = s
ecap[mi,mtp2]; ! = y
OBJECTIVE
MAXIMIZE tcap = sum{i in mi, t in {2 .. 5}} ecap[i,t];
! MAXIMIZE tprod = sum{i in mi, t in {4 .. 5}} out[i,t];
! MAXIMIZE tmen = sum{t in {2 .. 6}}
! ( sum{i in mi} c[4,i]*out[i,t] +
! sum{i in mi} d[4,i]*ecap[i,t+1] );
CONSTRAINTS
tina{i in mi} :
sum{j in mi} (c[i,j]*out[j,1]) +
sum{j in mi} (d[i,j]*ecap[j,2]) + stk[i,1] <= istock[i],
tinb{i in mi, t in mt} :
sum{j in mi} (c[i,j]*out[j,t+1]) +
sum{j in mi} (d[i,j]*ecap[j,t+2]) - out[i,t] -
stk[i,t] + stk[i,t+1] <= -demand[i],
men{t in mtp1} : sum{j in mi} c[4,j]*out[j,t] +
sum{j in mi} d[4,j]*ecap[j,t+1] <= 470,
cap{i in mi, t in mtp1} : out[i,t] -
sum{l in {2 .. t}} ecap[i,l] <= icap[i],
bounds{i in mi} : out[i,6] >= findem[i],
bounds{i in mi, t in {6 .. 7}} : ecap[i,t] = 0;
END MODEL
solve Economy;
print solution for Economy >> "Economy.sol";
quit;