mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 17:38:51 -06:00
Fix failing test
This commit is contained in:
@@ -131,6 +131,10 @@ end
|
|||||||
@error "JuMPSolver: set_threads not implemented"
|
@error "JuMPSolver: set_threads not implemented"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function set_branching_priorities(self, priorities)
|
||||||
|
@error "JuMPSolver: set_branching_priorities not implemented"
|
||||||
|
end
|
||||||
|
|
||||||
function set_time_limit(self, time_limit)
|
function set_time_limit(self, time_limit)
|
||||||
JuMP.set_time_limit_sec(self.model, time_limit)
|
JuMP.set_time_limit_sec(self.model, time_limit)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
from miplearn import LearningSolver
|
|
||||||
from miplearn.problems.stab import MaxWeightStableSetInstance
|
|
||||||
from miplearn.problems.stab import MaxWeightStableSetGenerator
|
|
||||||
import networkx as nx
|
import networkx as nx
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from miplearn import LearningSolver
|
||||||
|
from miplearn.problems.stab import MaxWeightStableSetInstance
|
||||||
from scipy.stats import uniform, randint
|
from scipy.stats import uniform, randint
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +15,7 @@ def test_stab():
|
|||||||
instance = MaxWeightStableSetInstance(graph, weights)
|
instance = MaxWeightStableSetInstance(graph, weights)
|
||||||
solver = LearningSolver()
|
solver = LearningSolver()
|
||||||
solver.solve(instance)
|
solver.solve(instance)
|
||||||
assert instance.model.OBJ() == 2.
|
assert instance.lower_bound == 2.
|
||||||
|
|
||||||
|
|
||||||
def test_stab_generator_fixed_graph():
|
def test_stab_generator_fixed_graph():
|
||||||
|
|||||||
Reference in New Issue
Block a user