-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise3.lst
241 lines (164 loc) · 8.6 KB
/
exercise3.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
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:14 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
Laboratory 1 - MOS
Exercise 3
Made by:
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, j3, j4/;
12
13 Parameter a(i) 'Amount of processes supplied by origin' /i1 300, i2 500, i3 200/;
14 Parameter b(j) 'Amount of processes needed by destination' /j1 200, j2 300, j3 100, j4 400/;
15
16 Table t(i, j) 'Transmission costs between CPUs'
17
18 j1 j2 j3 j4
19 i1 8 6 10 9
20 i2 9 12 13 7
21 i3 14 9 16 5;
22
23 Variables x(i,j) 'Amount of sent process per path'
24 z 'Target Function';
25
26 Positive Variable x;
27
28 Equations targetFunc 'Target Function'
29 maxProcessesSent(i) 'Maximum amount of processes sent per origin CPU'
30 satisfiedCPUDemand(j) 'Satisfied destination CPU process demand';
31
32 targetFunc.. z =e= sum((i,j), t(i,j)*x(i,j));
33 maxProcessesSent(i).. sum((j), x(i,j)) =l= a(i);
34 satisfiedCPUDemand(j).. sum((i), x(i,j)) =e= b(j);
35
36 Model Exercise3 /all/;
37 option MIP=CPLEX;
38 Solve Exercise3 using mip minimizing z;
39 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 - 08/31/22 07:46:14 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 Exercise3 Using MIP From line 38
---- targetFunc =E= Target Function
targetFunc.. - 8*x(i1,j1) - 6*x(i1,j2) - 10*x(i1,j3) - 9*x(i1,j4) - 9*x(i2,j1) - 12*x(i2,j2) - 13*x(i2,j3) - 7*x(i2,j4) - 14*x(i3,j1) - 9*x(i3,j2) - 16*x(i3,j3) - 5*x(i3,j4) + z =E= 0 ; (LHS = 0)
---- maxProcessesSent =L= Maximum amount of processes sent per origin CPU
maxProcessesSent(i1).. x(i1,j1) + x(i1,j2) + x(i1,j3) + x(i1,j4) =L= 300 ; (LHS = 0)
maxProcessesSent(i2).. x(i2,j1) + x(i2,j2) + x(i2,j3) + x(i2,j4) =L= 500 ; (LHS = 0)
maxProcessesSent(i3).. x(i3,j1) + x(i3,j2) + x(i3,j3) + x(i3,j4) =L= 200 ; (LHS = 0)
---- satisfiedCPUDemand =E= Satisfied destination CPU process demand
satisfiedCPUDemand(j1).. x(i1,j1) + x(i2,j1) + x(i3,j1) =E= 200 ; (LHS = 0, INFES = 200 ****)
satisfiedCPUDemand(j2).. x(i1,j2) + x(i2,j2) + x(i3,j2) =E= 300 ; (LHS = 0, INFES = 300 ****)
satisfiedCPUDemand(j3).. x(i1,j3) + x(i2,j3) + x(i3,j3) =E= 100 ; (LHS = 0, INFES = 100 ****)
REMAINING ENTRY SKIPPED
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:14 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 Exercise3 Using MIP From line 38
---- x Amount of sent process per path
x(i1,j1)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-8 targetFunc
1 maxProcessesSent(i1)
1 satisfiedCPUDemand(j1)
x(i1,j2)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-6 targetFunc
1 maxProcessesSent(i1)
1 satisfiedCPUDemand(j2)
x(i1,j3)
(.LO, .L, .UP, .M = 0, 0, +INF, 0)
-10 targetFunc
1 maxProcessesSent(i1)
1 satisfiedCPUDemand(j3)
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 - 08/31/22 07:46:14 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 Exercise3 Using MIP From line 38
RANGE STATISTICS (ABSOLUTE NON-ZERO FINITE VALUES)
RHS [min, max] : [ 1.000E+02, 5.000E+02] - Zero values observed as well
Bound [min, max] : [ NA, NA] - Zero values observed as well
Matrix [min, max] : [ 1.000E+00, 1.600E+01]
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:14 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 Exercise3 Using MIP From line 38
MODEL STATISTICS
BLOCKS OF EQUATIONS 3 SINGLE EQUATIONS 8
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 13
NON ZERO ELEMENTS 37
GENERATION TIME = 0.006 SECONDS 4 MB 40.1.0 93c2a77b DEX-DEG
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 08/31/22 07:46:14 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 Exercise3 Using MIP From line 38
S O L V E S U M M A R Y
MODEL Exercise3 OBJECTIVE z
TYPE MIP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 38
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
**** OBJECTIVE VALUE 7300.0000
RESOURCE USAGE, LIMIT 0.012 10000000000.000
ITERATION COUNT, LIMIT 3 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: 7300.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 -INF 300.0000 300.0000 -3.0000
i2 -INF 500.0000 500.0000 .
i3 -INF 200.0000 200.0000 -2.0000
---- EQU satisfiedCPUDemand Satisfied destination CPU process demand
LOWER LEVEL UPPER MARGINAL
j1 200.0000 200.0000 200.0000 9.0000
j2 300.0000 300.0000 300.0000 9.0000
j3 100.0000 100.0000 100.0000 13.0000
j4 400.0000 400.0000 400.0000 7.0000
---- VAR x Amount of sent process per path
LOWER LEVEL UPPER MARGINAL
i1.j1 . . +INF 2.0000
i1.j2 . 300.0000 +INF .
i1.j3 . . +INF .
i1.j4 . . +INF 5.0000
i2.j1 . 200.0000 +INF .
i2.j2 . . +INF 3.0000
i2.j3 . 100.0000 +INF .
i2.j4 . 200.0000 +INF .
i3.j1 . . +INF 7.0000
i3.j2 . . +INF 2.0000
i3.j3 . . +INF 5.0000
i3.j4 . 200.0000 +INF .
LOWER LEVEL UPPER MARGINAL
---- VAR z -INF 7300.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 - 08/31/22 07:46:14 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
---- 39 VARIABLE x.L Amount of sent process per path
j1 j2 j3 j4
i1 300.000
i2 200.000 100.000 200.000
i3 200.000
EXECUTION TIME = 0.042 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-01/exercise3.gms
Output /Users/zejiran/hack/uniandes/MSO/laboratory-01/exercise3.lst