mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Convert MIPSolveStats into dataclass
This commit is contained in:
@@ -136,16 +136,15 @@ class BasePyomoSolver(InternalSolver):
|
||||
self._has_mip_solution = True
|
||||
lb = results["Problem"][0]["Lower bound"]
|
||||
ub = results["Problem"][0]["Upper bound"]
|
||||
stats: MIPSolveStats = {
|
||||
"Lower bound": lb,
|
||||
"Upper bound": ub,
|
||||
"Wallclock time": total_wallclock_time,
|
||||
"Sense": self._obj_sense,
|
||||
"MIP log": log,
|
||||
"Nodes": node_count,
|
||||
"Warm start value": ws_value,
|
||||
}
|
||||
return stats
|
||||
return MIPSolveStats(
|
||||
mip_lower_bound=lb,
|
||||
mip_upper_bound=ub,
|
||||
mip_wallclock_time=total_wallclock_time,
|
||||
mip_sense=self._obj_sense,
|
||||
mip_log=log,
|
||||
mip_nodes=node_count,
|
||||
mip_warm_start_value=ws_value,
|
||||
)
|
||||
|
||||
@overrides
|
||||
def get_solution(self) -> Optional[Solution]:
|
||||
|
||||
Reference in New Issue
Block a user