Only include static features in after-load

This commit is contained in:
2021-04-13 16:08:30 -05:00
parent 8f41278713
commit ef7a50e871
11 changed files with 170 additions and 182 deletions

View File

@@ -55,37 +55,6 @@ class GurobiPyomoSolver(BasePyomoSolver):
gvar = self._pyomo_solver._pyomo_var_to_solver_var_map[var]
gvar.setAttr(GRB.Attr.BranchPriority, int(round(priority)))
@overrides
def get_variables(self) -> Dict[str, Variable]:
variables = super().get_variables()
if self._has_lp_solution:
for (varname, var) in variables.items():
pvar = self._varname_to_var[varname]
gvar = self._pyomo_solver._pyomo_var_to_solver_var_map[pvar]
GurobiSolver._parse_gurobi_var_lp(gvar, var)
return variables
@overrides
def get_variable_attrs(self) -> List[str]:
return [
"basis_status",
"category",
"lower_bound",
"obj_coeff",
"reduced_cost",
"sa_lb_down",
"sa_lb_up",
"sa_obj_down",
"sa_obj_up",
"sa_ub_down",
"sa_ub_up",
"type",
"upper_bound",
"user_features",
"value",
]
@overrides
def _extract_node_count(self, log: str) -> int:
return max(1, int(self._pyomo_solver._solver_model.getAttr("NodeCount")))