Skip to content

Commit

Permalink
fix bug for bundles in rc spoke
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Nov 22, 2024
1 parent 61d407d commit 6681326
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions mpisppy/cylinders/reduced_costs_spoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ def extract_and_store_reduced_costs(self):

self._scenario_rc_buffer.fill(0)
ci = 0 # buffer index
for s in self.opt.local_scenarios.values():
for ndn_i, xvar in s._mpisppy_data.nonant_indices.items():
# fixed by modeler
if ndn_i in self._modeler_fixed_nonants[s]:
self._scenario_rc_buffer[ci] = np.nan
else:
self._scenario_rc_buffer[ci] = s.rc[xvar]
ci += 1
for sub in self.opt.local_subproblems.values():
for sn in sub.scen_list:
s = self.opt.local_scenarios[sn]
for ndn_i, xvar in s._mpisppy_data.nonant_indices.items():
# fixed by modeler
if ndn_i in self._modeler_fixed_nonants[s]:
self._scenario_rc_buffer[ci] = np.nan
else:
self._scenario_rc_buffer[ci] = sub.rc[xvar]
ci += 1
self.rc_scenario = self._scenario_rc_buffer
# print(f"In ReducedCostsSpoke; {self.rc_scenario=}")

Expand Down

0 comments on commit 6681326

Please sign in to comment.