mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Store solution into instance object after solving
This commit is contained in:
@@ -18,6 +18,13 @@ def test_solver():
|
||||
instance = _get_instance()
|
||||
solver = LearningSolver()
|
||||
solver.solve(instance)
|
||||
assert instance.solution["x"][0] == 1.0
|
||||
assert instance.solution["x"][1] == 0.0
|
||||
assert instance.solution["x"][2] == 1.0
|
||||
assert instance.solution["x"][3] == 1.0
|
||||
assert instance.lower_bound == 1183.0
|
||||
assert instance.upper_bound == 1183.0
|
||||
|
||||
solver.fit()
|
||||
solver.solve(instance)
|
||||
|
||||
@@ -52,3 +59,6 @@ def test_parallel_solve():
|
||||
assert len(solver.components["warm-start"].x_train["default"]) == 40
|
||||
assert len(solver.components["warm-start"].y_train["default"]) == 40
|
||||
|
||||
for instance in instances:
|
||||
assert len(instance.solution["x"].keys()) == 4
|
||||
|
||||
|
||||
Reference in New Issue
Block a user