Make all before/solve callbacks receive same parameters

This commit is contained in:
2021-04-02 07:05:16 -05:00
parent 8eb2b63a85
commit 0c687692f7
17 changed files with 201 additions and 189 deletions

View File

@@ -157,11 +157,11 @@ def test_xy_sample_without_lp() -> None:
assert y_actual == y_expected
def test_usage():
def test_usage() -> None:
solver = LearningSolver(components=[ObjectiveValueComponent()])
instance = get_knapsack_instance(GurobiPyomoSolver())
solver.solve(instance)
solver.fit([instance])
stats = solver.solve(instance)
assert stats["Lower bound"] == stats["Objective: predicted LB"]
assert stats["Upper bound"] == stats["Objective: predicted UB"]
assert stats["Lower bound"] == stats["Objective: Predicted LB"]
assert stats["Upper bound"] == stats["Objective: Predicted UB"]