-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise2.lst
287 lines (198 loc) · 11 KB
/
exercise2.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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:44 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 2
Realizado por:
Juan Andrés Romero C - 202013449
Juan Sebastián Alegría - 202011282
9
10 Sets t 'ML Techniques' /S, NS, DL, RL/
11 c 'Scientists' /c1, c2, c3, c4, c5, c6/;
12
13 Table scores(t,c)
14
15 c1 c2 c3 c4 c5 c6
16 S 85 88 87 82 91 86
17 NS 78 77 77 76 79 78
18 DL 82 81 82 80 86 81
19 RL 84 84 88 83 84 85;
20
21 Variables x(t,c) 'Scientist/Technique selected'
22 z 'Target function';
23
24 Binary Variable x;
25
26 Equations targetFunc 'Target Function'
27 uniqueConstraintT(t) 'Every technique must be done by a scientist'
28 uniqueConstraintC(c) 'Selected scientist must perform maximum a single technique'
29 maxScientists 'Required number of scientists for the study';
30
31 targetFunc.. z =e= sum((t,c), scores(t,c)*x(t,c));
32 uniqueConstraintT(t).. sum((c), x(t,c)) =e= 1;
33 uniqueConstraintC(c).. sum((t), x(t,c)) =l= 1;
34 maxScientists.. sum((t,c), x(t,c)) =e= 4;
35
36 Model Exercise2 /all/;
37 option MIP=CPLEX;
38 Solve Exercise2 using mip maximizing z;
39 Display x.l;
40 Display z.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:44 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 Exercise2 Using MIP From line 38
---- targetFunc =E= Target Function
targetFunc.. - 85*x(S,c1) - 88*x(S,c2) - 87*x(S,c3) - 82*x(S,c4) - 91*x(S,c5) - 86*x(S,c6) - 78*x(NS,c1) - 77*x(NS,c2) - 77*x(NS,c3) - 76*x(NS,c4) - 79*x(NS,c5) - 78*x(NS,c6) - 82*x(DL,c1) - 81*x(DL,c2) - 82*x(DL,c3) - 80*x(DL,c4) - 86*x(DL,c5) - 81*x(DL,c6) - 84*x(RL,c1) - 84*x(RL,c2) - 88*x(RL,c3) - 83*x(RL,c4) - 84*x(RL,c5) - 85*x(RL,c6) + z =E= 0 ; (LHS = 0)
---- uniqueConstraintT =E= Every technique must be done by a scientist
uniqueConstraintT(S).. x(S,c1) + x(S,c2) + x(S,c3) + x(S,c4) + x(S,c5) + x(S,c6) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintT(NS).. x(NS,c1) + x(NS,c2) + x(NS,c3) + x(NS,c4) + x(NS,c5) + x(NS,c6) =E= 1 ; (LHS = 0, INFES = 1 ****)
uniqueConstraintT(DL).. x(DL,c1) + x(DL,c2) + x(DL,c3) + x(DL,c4) + x(DL,c5) + x(DL,c6) =E= 1 ; (LHS = 0, INFES = 1 ****)
REMAINING ENTRY SKIPPED
---- uniqueConstraintC =L= Selected scientist must perform maximum a single technique
uniqueConstraintC(c1).. x(S,c1) + x(NS,c1) + x(DL,c1) + x(RL,c1) =L= 1 ; (LHS = 0)
uniqueConstraintC(c2).. x(S,c2) + x(NS,c2) + x(DL,c2) + x(RL,c2) =L= 1 ; (LHS = 0)
uniqueConstraintC(c3).. x(S,c3) + x(NS,c3) + x(DL,c3) + x(RL,c3) =L= 1 ; (LHS = 0)
REMAINING 3 ENTRIES SKIPPED
---- maxScientists =E= Required number of scientists for the study
maxScientists.. x(S,c1) + x(S,c2) + x(S,c3) + x(S,c4) + x(S,c5) + x(S,c6) + x(NS,c1) + x(NS,c2) + x(NS,c3) + x(NS,c4) + x(NS,c5) + x(NS,c6) + x(DL,c1) + x(DL,c2) + x(DL,c3) + x(DL,c4) + x(DL,c5) + x(DL,c6) + x(RL,c1) + x(RL,c2) + x(RL,c3) + x(RL,c4) + x(RL,c5) + x(RL,c6) =E= 4 ; (LHS = 0, INFES = 4 ****)
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:44 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 Exercise2 Using MIP From line 38
---- x Scientist/Technique selected
x(S,c1)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-85 targetFunc
1 uniqueConstraintT(S)
1 uniqueConstraintC(c1)
1 maxScientists
x(S,c2)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-88 targetFunc
1 uniqueConstraintT(S)
1 uniqueConstraintC(c2)
1 maxScientists
x(S,c3)
(.LO, .L, .UP, .M = 0, 0, 1, 0)
-87 targetFunc
1 uniqueConstraintT(S)
1 uniqueConstraintC(c3)
1 maxScientists
REMAINING 21 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:44 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 Exercise2 Using MIP From line 38
RANGE STATISTICS (ABSOLUTE NON-ZERO FINITE VALUES)
RHS [min, max] : [ 1.000E+00, 4.000E+00] - Zero values observed as well
Bound [min, max] : [ 1.000E+00, 1.000E+00] - Zero values observed as well
Matrix [min, max] : [ 1.000E+00, 9.100E+01]
GAMS 40.1.0 93c2a77b Aug 1, 2022 DEX-DEG x86 64bit/Mac OS X - 09/14/22 14:10:44 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 Exercise2 Using MIP From line 38
MODEL STATISTICS
BLOCKS OF EQUATIONS 4 SINGLE EQUATIONS 12
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 25
NON ZERO ELEMENTS 97 DISCRETE VARIABLES 24
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 - 09/14/22 14:10:44 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 Exercise2 Using MIP From line 38
S O L V E S U M M A R Y
MODEL Exercise2 OBJECTIVE z
TYPE MIP DIRECTION MAXIMIZE
SOLVER CPLEX FROM LINE 38
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
**** OBJECTIVE VALUE 340.0000
RESOURCE USAGE, LIMIT 0.029 10000000000.000
ITERATION COUNT, LIMIT 2 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
--- MIP status (101): integer optimal solution.
--- Cplex Time: 0.01sec (det. 0.20 ticks)
--- Fixing integer variables and solving final LP...
--- Fixed MIP status (1): optimal.
--- Cplex Time: 0.00sec (det. 0.01 ticks)
Proven optimal solution
MIP Solution: 340.000000 (2 iterations, 0 nodes)
Final Solve: 340.000000 (0 iterations)
Best possible: 340.000000
Absolute gap: 0.000000
Relative gap: 0.000000
LOWER LEVEL UPPER MARGINAL
---- EQU targetFunc . . . 1.0000
targetFunc Target Function
---- EQU uniqueConstraintT Every technique must be done by a scientist
LOWER LEVEL UPPER MARGINAL
S 1.0000 1.0000 1.0000 .
NS 1.0000 1.0000 1.0000 .
DL 1.0000 1.0000 1.0000 .
RL 1.0000 1.0000 1.0000 .
---- EQU uniqueConstraintC Selected scientist must perform maximum a single technique
LOWER LEVEL UPPER MARGINAL
c1 -INF 1.0000 1.0000 .
c2 -INF 1.0000 1.0000 .
c3 -INF 1.0000 1.0000 .
c4 -INF . 1.0000 .
c5 -INF 1.0000 1.0000 .
c6 -INF . 1.0000 .
LOWER LEVEL UPPER MARGINAL
---- EQU maxScient~ 4.0000 4.0000 4.0000 .
maxScientists Required number of scientists for the study
---- VAR x Scientist/Technique selected
LOWER LEVEL UPPER MARGINAL
S .c1 . . 1.0000 85.0000
S .c2 . 1.0000 1.0000 88.0000
S .c3 . . 1.0000 87.0000
S .c4 . . 1.0000 82.0000
S .c5 . . 1.0000 91.0000
S .c6 . . 1.0000 86.0000
NS.c1 . 1.0000 1.0000 78.0000
NS.c2 . . 1.0000 77.0000
NS.c3 . . 1.0000 77.0000
NS.c4 . . 1.0000 76.0000
NS.c5 . . 1.0000 79.0000
NS.c6 . . 1.0000 78.0000
DL.c1 . . 1.0000 82.0000
DL.c2 . . 1.0000 81.0000
DL.c3 . . 1.0000 82.0000
DL.c4 . . 1.0000 80.0000
DL.c5 . 1.0000 1.0000 86.0000
DL.c6 . . 1.0000 81.0000
RL.c1 . . 1.0000 84.0000
RL.c2 . . 1.0000 84.0000
RL.c3 . 1.0000 1.0000 88.0000
RL.c4 . . 1.0000 83.0000
RL.c5 . . 1.0000 84.0000
RL.c6 . . 1.0000 85.0000
LOWER LEVEL UPPER MARGINAL
---- VAR z -INF 340.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:44 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 Scientist/Technique selected
c1 c2 c3 c5
S 1.000
NS 1.000
DL 1.000
RL 1.000
---- 40 VARIABLE z.L = 340.000 Target function
EXECUTION TIME = 0.062 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/exercise2.gms
Output /Users/zejiran/hack/uniandes/MSO/laboratory-02/exercise2.lst