-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise1.lst
259 lines (181 loc) · 9.14 KB
/
exercise1.lst
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 1
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
C o m p i l a t i o n
Laboratorio 2 - MOS
Ejercicio 1
Realizado por:
Juan Andrés Romero C - 202013449
Juan Sebastián Alegría - 202011282
9
10 Sets i 'Origin CPUs' /i1, i2, i3/
11 j 'Destination CPUs' /j1, j2/
12 p 'Proccess Type' /pk, pu/;
13
14 Table oProcess(i,p) 'Amount of processes supplied by origin'
15
16 pk pu
17 i1 60 80
18 i2 80 50
19 i3 50 50;
20
21 Table dProcess(j,p) 'Amount of procceses needed by destination'
22
23 pk pu
24 j1 100 60
25 j2 90 120;
26
27 Table cost(i,j) 'Transmission costs between CPUs'
28
29 j1 j2
30 i1 300 500
31 i2 200 300
32 i3 600 300;
33
34 Variables x(i,j,p) 'Amount of processes sent per path and type'
35 z 'Target Function';
36
37 Positive Variable x;
38
39 Equations targetFunc 'Target Function'
40 maxProcessesSent(i,p) 'Maximum amount of processes sent per origin CPU'
41 satisfiedCPUDemand(j,p) 'Destination CPU process demand';
42
43 targetFunc.. z =e= sum((i,j,p), cost(i,j)*x(i,j,p));
44 maxProcessesSent(i,p).. sum((j), x(i,j,p)) =l= oProcess(i,p);
45 satisfiedCPUDemand(j,p).. sum((i), x(i,j,p)) =e= dProcess(j,p);
46
47 Model Exercise1 /all/;
48 option MIP=CPLEX;
49 Solve Exercise1 using LP minimizing z;
50 Display x.l;
COMPILATION TIME = 0.002 SECONDS 3 MB 40.1.0 93c2a77b DEX-DEG
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Equation Listing SOLVE Exercise1 Using LP From line 49
---- targetFunc =E= Target Function
targetFunc.. - 300*x(i1,j1,pk) - 300*x(i1,j1,pu) - 500*x(i1,j2,pk) - 500*x(i1,j2,pu) - 200*x(i2,j1,pk) - 200*x(i2,j1,pu) - 300*x(i2,j2,pk) - 300*x(i2,j2,pu) - 600*x(i3,j1,pk) - 600*x(i3,j1,pu) - 300*x(i3,j2,pk) - 300*x(i3,j2,pu) + z =E= 0 ; (LHS = 0)
---- maxProcessesSent =L= Maximum amount of processes sent per origin CPU
maxProcessesSent(i1,pk).. x(i1,j1,pk) + x(i1,j2,pk) =L= 60 ; (LHS = 0)
maxProcessesSent(i1,pu).. x(i1,j1,pu) + x(i1,j2,pu) =L= 80 ; (LHS = 0)
maxProcessesSent(i2,pk).. x(i2,j1,pk) + x(i2,j2,pk) =L= 80 ; (LHS = 0)
REMAINING 3 ENTRIES SKIPPED
---- satisfiedCPUDemand =E= Destination CPU process demand
satisfiedCPUDemand(j1,pk).. x(i1,j1,pk) + x(i2,j1,pk) + x(i3,j1,pk) =E= 100 ; (LHS = 0, INFES = 100 ****)
satisfiedCPUDemand(j1,pu).. x(i1,j1,pu) + x(i2,j1,pu) + x(i3,j1,pu) =E= 60 ; (LHS = 0, INFES = 60 ****)
satisfiedCPUDemand(j2,pk).. x(i1,j2,pk) + x(i2,j2,pk) + x(i3,j2,pk) =E= 90 ; (LHS = 0, INFES = 90 ****)
REMAINING ENTRY SKIPPED
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 3
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Column Listing SOLVE Exercise1 Using LP From line 49
---- x Amount of processes sent per path and type
x(i1,j1,pk)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-300 targetFunc
1 maxProcessesSent(i1,pk)
1 satisfiedCPUDemand(j1,pk)
x(i1,j1,pu)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-300 targetFunc
1 maxProcessesSent(i1,pu)
1 satisfiedCPUDemand(j1,pu)
x(i1,j2,pk)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-500 targetFunc
1 maxProcessesSent(i1,pk)
1 satisfiedCPUDemand(j2,pk)
REMAINING 9 ENTRIES SKIPPED
---- z Target Function
z
(.LO, .L, .UP, .M = -INF, 0, +INF, 0)
1 targetFunc
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 4
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Range Statistics SOLVE Exercise1 Using LP From line 49
RANGE STATISTICS (ABSOLUTE NON-ZERO FINITE VALUES)
RHS [min, max] : [ 5.000E+01, 1.200E+02] - Zero values observed as well
Bound [min, max] : [ NA, NA] - Zero values observed as well
Matrix [min, max] : [ 1.000E+00, 6.000E+02]
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 5
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Model Statistics SOLVE Exercise1 Using LP From line 49
MODEL STATISTICS
BLOCKS OF EQUATIONS 3 SINGLE EQUATIONS 11
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 13
NON ZERO ELEMENTS 37
GENERATION TIME = 0.005 SECONDS 4 MB 40.1.0 93c2a77b DEX-DEG
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 6
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Solution Report SOLVE Exercise1 Using LP From line 49
S O L V E S U M M A R Y
MODEL Exercise1 OBJECTIVE z
TYPE LP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 49
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
**** OBJECTIVE VALUE 111000.0000
RESOURCE USAGE, LIMIT 0.012 10000000000.000
ITERATION COUNT, LIMIT 5 2147483647
--- *** This solver runs with a community license. No commercial use.
--- GMO setup time: 0.00s
--- GMO memory 0.50 Mb (peak 0.50 Mb)
--- Dictionary memory 0.00 Mb
--- Cplex 22.1.0.0 link memory 0.00 Mb (peak 0.00 Mb)
--- Starting Cplex
--- LP status (1): optimal.
--- Cplex Time: 0.00sec (det. 0.02 ticks)
Optimal solution found
Objective: 111000.000000
LOWER LEVEL UPPER MARGINAL
---- EQU targetFunc . . . 1.0000
targetFunc Target Function
---- EQU maxProcessesSent Maximum amount of processes sent per origin CPU
LOWER LEVEL UPPER MARGINAL
i1.pk -INF 60.0000 60.0000 .
i1.pu -INF 80.0000 80.0000 .
i2.pk -INF 80.0000 80.0000 -100.0000
i2.pu -INF 50.0000 50.0000 -200.0000
i3.pk -INF 50.0000 50.0000 -100.0000
i3.pu -INF 50.0000 50.0000 -200.0000
---- EQU satisfiedCPUDemand Destination CPU process demand
LOWER LEVEL UPPER MARGINAL
j1.pk 100.0000 100.0000 100.0000 300.0000
j1.pu 60.0000 60.0000 60.0000 300.0000
j2.pk 90.0000 90.0000 90.0000 400.0000
j2.pu 120.0000 120.0000 120.0000 500.0000
---- VAR x Amount of processes sent per path and type
LOWER LEVEL UPPER MARGINAL
i1.j1.pk . 60.0000 +INF .
i1.j1.pu . 60.0000 +INF .
i1.j2.pk . . +INF 100.0000
i1.j2.pu . 20.0000 +INF .
i2.j1.pk . 40.0000 +INF .
i2.j1.pu . . +INF 100.0000
i2.j2.pk . 40.0000 +INF .
i2.j2.pu . 50.0000 +INF .
i3.j1.pk . . +INF 400.0000
i3.j1.pu . . +INF 500.0000
i3.j2.pk . 50.0000 +INF .
i3.j2.pu . 50.0000 +INF .
LOWER LEVEL UPPER MARGINAL
---- VAR z -INF 111000.0000 +INF .
z Target Function
**** REPORT SUMMARY : 0 NONOPT
0 INFEASIBLE
0 UNBOUNDED
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:33 Page 7
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
E x e c u t i o n
---- 50 VARIABLE x.L Amount of processes sent per path and type
pk pu
i1.j1 60.000 60.000
i1.j2 20.000
i2.j1 40.000
i2.j2 40.000 50.000
i3.j2 50.000 50.000
EXECUTION TIME = 0.040 SECONDS 4 MB 40.1.0 93c2a77b DEX-DEG
USER: GAMS Community License for Juan Alegria G220811|0002AO-GEN
Universidad de los Andes, CL3634
License for teaching and research at degree granting institutions
**** FILE SUMMARY
Input /Users/zejiran/hack/uniandes/MSO/laboratory-02/exercise1.gms
Output /Users/zejiran/hack/uniandes/MSO/laboratory-02/exercise1.lst