Skip to content

Commit

Permalink
rename _solve_rnGDP_subproblem to _solve_GDP_subproblem
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Feb 5, 2024
1 parent 5cc9a4b commit 6cf2e6b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pyomo/contrib/gdpopt/ldsda.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def _solve_gdp(self, model, config):
add_algebraic_variable_list(util_block)
add_boolean_variable_lists(util_block)

# We will use the working_model to clone the model and perform
# to transform the ordered boolean variables into external integer variables,
# fix the disjunctions.
self.working_model = model.clone()
# TODO: I don't like the name way, try something else?
self.working_model_util_block = self.working_model.component(util_block.name)
Expand Down Expand Up @@ -135,7 +138,7 @@ def _solve_gdp(self, model, config):
self.fix_disjunctions_with_external_var(
self.working_model_util_block, self.current_point
)
_ = self._solve_rnGDP_subproblem(self.working_model, config, 'Initial point')
_ = self._solve_GDP_subproblem(self.working_model, config, 'Initial point')

# Main loop
locally_optimal = False
Expand All @@ -152,7 +155,7 @@ def _solve_gdp(self, model, config):
def any_termination_criterion_met(self, config):
return self.reached_iteration_limit(config) or self.reached_time_limit(config)

def _solve_rnGDP_subproblem(self, model, config, search_type):
def _solve_GDP_subproblem(self, model, config, search_type):
subproblem = model.clone()
TransformationFactory('core.logical_to_linear').apply_to(subproblem)
TransformationFactory('gdp.bigm').apply_to(subproblem)
Expand Down Expand Up @@ -340,7 +343,7 @@ def neighbor_search(self, model, config):
self.fix_disjunctions_with_external_var(
self.working_model_util_block, neighbor
)
primal_improved = self._solve_rnGDP_subproblem(
primal_improved = self._solve_GDP_subproblem(
model, config, 'Neighbor search'
)
if primal_improved:
Expand Down Expand Up @@ -368,7 +371,7 @@ def line_search(self, model, config):
self.fix_disjunctions_with_external_var(
self.working_model_util_block, next_point
)
primal_improved = self._solve_rnGDP_subproblem(
primal_improved = self._solve_GDP_subproblem(
model, config, 'Line search'
)
if primal_improved:
Expand Down

0 comments on commit 6cf2e6b

Please sign in to comment.