From 6cf2e6b42413ec6eb8425e1a73cc550a3f937126 Mon Sep 17 00:00:00 2001 From: ZedongPeng Date: Mon, 5 Feb 2024 12:35:01 -0500 Subject: [PATCH] rename _solve_rnGDP_subproblem to _solve_GDP_subproblem --- pyomo/contrib/gdpopt/ldsda.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pyomo/contrib/gdpopt/ldsda.py b/pyomo/contrib/gdpopt/ldsda.py index e4466822dcf..340c46dae2e 100644 --- a/pyomo/contrib/gdpopt/ldsda.py +++ b/pyomo/contrib/gdpopt/ldsda.py @@ -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) @@ -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 @@ -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) @@ -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: @@ -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: