Skip to content

Commit 5409b65

Browse files
authored
Merge branch 'main' into fix-572
2 parents 541770a + 64f61f2 commit 5409b65

File tree

15 files changed

+55
-56
lines changed

15 files changed

+55
-56
lines changed

examples/farmer/agnostic/farmer_ampl_agnostic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
286286
#gs.export_data(f"{fname}.dat")
287287

288288
if gs.solve_result != "solved":
289-
s._mpisppy_data.scenario_feasible = False
289+
s._mpisppy_data.solution_available = False
290290
if gripe:
291291
print (f"Solve failed for scenario {s.name} on rank {global_rank}")
292292
print(f"{gs.solve_result =}")
@@ -295,7 +295,7 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
295295
raise solver_exception
296296

297297

298-
s._mpisppy_data.scenario_feasible = True
298+
s._mpisppy_data.solution_available = True
299299
# For AMPL mips, we need to use the gap option to compute bounds
300300
# https://amplmp.readthedocs.io/rst/features-guide.html
301301
objobj = gs.get_current_objective() # different for xhatters

examples/farmer/agnostic/farmer_gurobipy_agnostic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,18 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
253253
gs.optimize()
254254
except gp.GurobiError as e:
255255
print(f"Error occurred: {str(e)}")
256-
s._mpisppy_data.scenario_feasible = False
256+
s._mpisppy_data.solution_available = False
257257
if gripe:
258258
print(f"Solve failed for scenario {s.name}")
259259
return
260260

261261
if gs.status != gp.GRB.Status.OPTIMAL:
262-
s._mpisppy_data.scenario_feasible = False
262+
s._mpisppy_data.solution_available = False
263263
if gripe:
264264
print(f"Solve failed for scenario {s.name}")
265265
return
266266

267-
s._mpisppy_data.scenario_feasible = True
267+
s._mpisppy_data.solution_available = True
268268

269269
# Objective value extraction
270270
objval = gs.getObjective().getValue()

examples/farmer/agnostic/farmer_pyomo_agnostic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee=False, need_solution=True):
206206
(results.solver.termination_condition == TerminationCondition.infeasibleOrUnbounded) or \
207207
(results.solver.termination_condition == TerminationCondition.unbounded):
208208

209-
s._mpisppy_data.scenario_feasible = False
209+
s._mpisppy_data.solution_available = False
210210

211211
if gripe:
212212
print (f"Solve failed for scenario {s.name} on rank {global_rank}")
@@ -219,7 +219,7 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee=False, need_solution=True):
219219
raise solver_exception
220220

221221
else:
222-
s._mpisppy_data.scenario_feasible = True
222+
s._mpisppy_data.solution_available = True
223223
if gd["sense"] == pyo.minimize:
224224
s._mpisppy_data.outer_bound = results.Problem[0].Lower_bound
225225
else:

mpisppy/agnostic/ampl_guest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ def solve_one(self, Ag, s, solve_keyword_args, gripe, tee=False, need_solution=T
273273
solver_exception = e
274274

275275
if gs.solve_result != "solved":
276-
s._mpisppy_data.scenario_feasible = False
276+
s._mpisppy_data.solution_available = False
277277
if gripe:
278278
print (f"Solve failed for scenario {s.name} on rank {global_rank}")
279279
print(f"{gs.solve_result =}")
280280
s._mpisppy_data.inner_bound = None
281281
return
282282

283283
else:
284-
s._mpisppy_data.scenario_feasible = True
284+
s._mpisppy_data.solution_available = True
285285

286286
if solver_exception is not None and need_solution:
287287
raise solver_exception

mpisppy/agnostic/examples/farmer_gurobipy_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
163163
try:
164164
gs.optimize()
165165
except gp.GurobiError as e:
166-
s._mpisppy_data.scenario_feasible = False
166+
s._mpisppy_data.solution_available = False
167167
solver_exception = e
168168
if gripe:
169169
print(f"Solve failed with error {str(e)} for scenario {s.name}")
@@ -174,12 +174,12 @@ def solve_one(Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
174174
raise solver_exception
175175

176176
if gs.status != gp.GRB.Status.OPTIMAL:
177-
s._mpisppy_data.scenario_feasible = False
177+
s._mpisppy_data.solution_available = False
178178
if gripe:
179179
print(f"Solve failed for scenario {s.name}")
180180
return
181181

182-
s._mpisppy_data.scenario_feasible = True
182+
s._mpisppy_data.solution_available = True
183183

184184
# Objective value extraction
185185
objval = gs.getObjective().getValue()

mpisppy/agnostic/gams_guest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def solve_one(self, Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
200200

201201
#print(f"{gs.model_status=}, {gs.solver_status=}")
202202
if gs.model_status not in solve_ok:
203-
s._mpisppy_data.scenario_feasible = False
203+
s._mpisppy_data.solution_available = False
204204
if gripe:
205205
print (f"Solve failed for scenario {s.name} on rank {global_rank}")
206206
print(f"{gs.model_status =}")
@@ -210,7 +210,7 @@ def solve_one(self, Ag, s, solve_keyword_args, gripe, tee, need_solution=True):
210210
if solver_exception is not None and need_solution:
211211
raise solver_exception
212212

213-
s._mpisppy_data.scenario_feasible = True
213+
s._mpisppy_data.solution_available = True
214214

215215
# For debugging, thisprints the weights of the PH model
216216
"""W_dict = {}

mpisppy/agnostic/pyomo_guest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def solve_one(self, Ag, s, solve_keyword_args, gripe, tee=False, need_solution=T
227227
(results.solver.termination_condition == TerminationCondition.infeasibleOrUnbounded) or \
228228
(results.solver.termination_condition == TerminationCondition.unbounded):
229229

230-
s._mpisppy_data.scenario_feasible = False
230+
s._mpisppy_data.solution_available = False
231231

232232
if gripe:
233233
print (f"Solve failed for scenario {s.name} on rank {global_rank}")
@@ -240,7 +240,7 @@ def solve_one(self, Ag, s, solve_keyword_args, gripe, tee=False, need_solution=T
240240
raise solver_exception
241241

242242
else:
243-
s._mpisppy_data.scenario_feasible = True
243+
s._mpisppy_data.solution_available = True
244244
if gd["sense"] == pyo.minimize:
245245
s._mpisppy_data.outer_bound = results.Problem[0].Lower_bound
246246
else:

mpisppy/cylinders/lshaped_bounder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def xhatlshaped_prep(self):
4141
print("Total probability of scenarios was ", self.opt.E1)
4242
print("E1_tolerance = ", self.opt.E1_tolerance)
4343
quit()
44-
infeasP = self.opt.infeas_prob()
44+
infeasP = self.opt.no_incumbent_prob()
4545
if infeasP != 0.:
4646
if self.opt.cylinder_rank == 0:
4747
print("ERROR")

mpisppy/extensions/xhatbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def _try_one(self, snamedict, solver_options=None, verbose=False,
225225
need_solution=False,
226226
)
227227

228-
infeasP = self.opt.infeas_prob()
228+
infeasP = self.opt.no_incumbent_prob()
229229
if infeasP != 0.:
230230
if restore_nonants:
231231
self.opt._restore_nonants()

mpisppy/extensions/xhatxbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _vb(msg):
9797
need_solution=False,
9898
)
9999

100-
infeasP = self.opt.infeas_prob()
100+
infeasP = self.opt.no_incumbent_prob()
101101
if infeasP != 0.:
102102
if restore_nonants:
103103
self.opt._restore_nonants()

0 commit comments

Comments
 (0)