From 0928ace77be8a03174b61703c982a45bd12a31d0 Mon Sep 17 00:00:00 2001 From: wujian Date: Thu, 12 Oct 2023 15:49:57 +0800 Subject: [PATCH] Fix update of appsi_copt --- pyomo/contrib/appsi/solvers/copt.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyomo/contrib/appsi/solvers/copt.py b/pyomo/contrib/appsi/solvers/copt.py index fbeed45e8ff..1572815bad6 100644 --- a/pyomo/contrib/appsi/solvers/copt.py +++ b/pyomo/contrib/appsi/solvers/copt.py @@ -342,11 +342,10 @@ def _solve(self, timer: HierarchicalTimer): config = self.config options = self.copt_options - if config.stream_solver: - self._solver_model.setParam('LogToConsole', 1) - else: - self._solver_model.setParam('LogToConsole', 0) - self._solver_model.setLogFile(config.logfile) + if not config.stream_solver: + self._solver_model.setParam("LogToConsole", 0) + if config.logfile: + self._solver_model.setLogFile(config.logfile) if config.time_limit is not None: self._solver_model.setParam('TimeLimit', config.time_limit) @@ -1068,7 +1067,7 @@ def get_slacks(self, cons_to_load=None): return slack def update(self, timer: HierarchicalTimer = None): - pass + super(Copt, self).update(timer=timer) def get_model_attr(self, attr): """