Skip to content

Commit

Permalink
Merge pull request #355 from Pyomo/cross-scen-cut-cleanup
Browse files Browse the repository at this point in the history
Minor clean-up in cross scenario cut extension.
  • Loading branch information
bknueven authored Nov 28, 2023
2 parents 03a1afc + 44fa663 commit 34bd37c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mpisppy/extensions/cross_scen_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ def _enable_W_and_prox(self):
def _check_bound(self):
opt = self.opt

chached_ph_obj = dict()
cached_ph_obj = dict()

for k,s in opt.local_subproblems.items():
phobj = find_active_objective(s)
phobj.deactivate()
chached_ph_obj[k] = phobj
cached_ph_obj[k] = phobj
s._mpisppy_model.EF_Obj.activate()

teeme = (
Expand Down Expand Up @@ -114,7 +114,7 @@ def _check_bound(self):

for k,s in opt.local_subproblems.items():
s._mpisppy_model.EF_Obj.deactivate()
chached_ph_obj[k].activate()
cached_ph_obj[k].activate()

def pre_iter0(self):
if self.opt.multistage:
Expand Down Expand Up @@ -271,7 +271,6 @@ def miditer(self):
((self.iter_since_last_check%self.check_bound_iterations == 0) and self.opt.spcomm.new_cuts))
# if there hasn't been OB movement, check every so often if we have new cuts
if check:
global_toc(f"Attempting to update Best Bound with CrossScenarioExtension")
self._check_bound()
self.opt.spcomm.new_cuts = False
self.iter_since_last_check = 0
Expand Down

0 comments on commit 34bd37c

Please sign in to comment.