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:
@@ -255,5 +255,5 @@ def test_usage() -> None:
|
||||
solver.solve(instance)
|
||||
solver.fit([instance])
|
||||
stats = solver.solve(instance)
|
||||
assert stats["Lower bound"] == stats["Objective: Predicted lower bound"]
|
||||
assert stats["Upper bound"] == stats["Objective: Predicted upper bound"]
|
||||
assert stats["mip_lower_bound"] == stats["Objective: Predicted lower bound"]
|
||||
assert stats["mip_upper_bound"] == stats["Objective: Predicted upper bound"]
|
||||
|
||||
@@ -221,7 +221,7 @@ def test_usage() -> None:
|
||||
stats = solver.solve(instance)
|
||||
assert stats["Primal: Free"] == 0
|
||||
assert stats["Primal: One"] + stats["Primal: Zero"] == 10
|
||||
assert stats["Lower bound"] == stats["Warm start value"]
|
||||
assert stats["mip_lower_bound"] == stats["mip_warm_start_value"]
|
||||
|
||||
|
||||
def test_evaluate() -> None:
|
||||
|
||||
@@ -16,7 +16,7 @@ def test_stab() -> None:
|
||||
instance = MaxWeightStableSetInstance(graph, weights)
|
||||
solver = LearningSolver()
|
||||
stats = solver.solve(instance)
|
||||
assert stats["Lower bound"] == 2.0
|
||||
assert stats["mip_lower_bound"] == 2.0
|
||||
|
||||
|
||||
def test_stab_generator_fixed_graph() -> None:
|
||||
|
||||
@@ -47,8 +47,8 @@ def test_instance() -> None:
|
||||
assert solution["x[(1, 2)]"] == 1.0
|
||||
assert solution["x[(1, 3)]"] == 0.0
|
||||
assert solution["x[(2, 3)]"] == 1.0
|
||||
assert stats["Lower bound"] == 4.0
|
||||
assert stats["Upper bound"] == 4.0
|
||||
assert stats["mip_lower_bound"] == 4.0
|
||||
assert stats["mip_upper_bound"] == 4.0
|
||||
|
||||
|
||||
def test_subtour() -> None:
|
||||
|
||||
@@ -140,7 +140,7 @@ def test_simulate_perfect() -> None:
|
||||
simulate_perfect=True,
|
||||
)
|
||||
stats = solver.solve(PickleGzInstance(tmp.name))
|
||||
assert stats["Lower bound"] == stats["Objective: Predicted lower bound"]
|
||||
assert stats["mip_lower_bound"] == stats["Objective: Predicted lower bound"]
|
||||
|
||||
|
||||
def test_gap() -> None:
|
||||
|
||||
Reference in New Issue
Block a user