@@ -92,7 +92,7 @@ def plot_runtime_stats(suspect):
92
92
pct_data = pd .Series (pct_done , index = data .values )
93
93
fig = plt .figure (figsize = (8 , 4 ))
94
94
pct_data .plot (logx = True , fig = fig )
95
- plt .xlabel ('Time ($s$)' )
95
+ plt .xlabel ('Time ($\log s$)' )
96
96
plt .ylabel ('Instances Processed ($\%$)' )
97
97
plt .ylim ([0 , 1 ])
98
98
plt .xlim ([pct_data .index .min (), pct_data .index .max ()])
@@ -114,6 +114,19 @@ def compute_results_table(suspect, minlplib):
114
114
return results .pivot (index = 'expected' , columns = 'have' , values = 'count' ).fillna (0 )
115
115
116
116
117
+ def write_problem_list (filename , df , columns = 3 ):
118
+ with open (filename , 'w' ) as f :
119
+ count = 0
120
+ for name in df .index :
121
+ f .write (' ' + str (name .replace ('_' , '\\ _' )) + ' ' )
122
+ if count >= (columns - 1 ):
123
+ f .write ('\\ \\ \n ' )
124
+ count = 0
125
+ else :
126
+ f .write (' & ' )
127
+ count += 1
128
+
129
+
117
130
if __name__ == '__main__' :
118
131
args = argparse .ArgumentParser ()
119
132
args .add_argument ('suspect_input' )
@@ -132,6 +145,8 @@ def compute_results_table(suspect, minlplib):
132
145
133
146
print_error_statistics (suspect )
134
147
148
+ suspect_orig = suspect .set_index ('name' )
149
+
135
150
# filter out errors
136
151
suspect = suspect [suspect .status == 'ok' ]
137
152
@@ -153,8 +168,18 @@ def compute_results_table(suspect, minlplib):
153
168
suspect .drop ('gams03' , inplace = True )
154
169
minlplib .drop ('gams03' , inplace = True )
155
170
156
- minlplib .conscurvature .replace ({'unknown' : 'indefinite' }, inplace = True )
157
- minlplib .objcurvature .replace ({'unknown' : 'indefinite' }, inplace = True )
171
+ cvx_replace = {
172
+ 'unknown' : 'indefinite' ,
173
+ 'nonconcave' : 'indefinite' ,
174
+ 'nonconvex' : 'indefinite' ,
175
+ }
176
+ minlplib .conscurvature .replace (cvx_replace , inplace = True )
177
+ minlplib .objcurvature .replace (cvx_replace , inplace = True )
178
+
179
+ type_replace = {
180
+ 'signomial' : 'nonlinear'
181
+ }
182
+ minlplib .objtype .replace (type_replace , inplace = True )
158
183
159
184
diff = suspect == minlplib
160
185
all_good = diff .all (axis = 1 )
@@ -178,3 +203,15 @@ def compute_results_table(suspect, minlplib):
178
203
179
204
print (' * Objective Type' )
180
205
print (compute_results_table (suspect .objtype , minlplib .objtype ))
206
+
207
+ good_idx = all_good [all_good ].index
208
+ wrong_idx = all_good [~ all_good ].index
209
+ correct_result = suspect_orig .loc [good_idx ]
210
+ wrong_result = suspect_orig .loc [wrong_idx ]
211
+
212
+ correct_lt2 = correct_result [correct_result .runtime <= 2 ]
213
+ correct_lt10 = correct_result [(correct_result .runtime > 2 ) & (correct_result .runtime <= 10 )]
214
+ correct_gt10 = correct_result [correct_result .runtime > 10 ]
215
+
216
+ compare_wrong = wrong_result [STRUCTURE_COLUMNS ].join (minlplib [STRUCTURE_COLUMNS ], how = 'left' , lsuffix = '_have' , rsuffix = '_expected' )
217
+ compare_wrong ['runtime' ] = wrong_result ['runtime' ]
0 commit comments