mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
StaticLazy: Add tolerance to tests
This commit is contained in:
@@ -41,7 +41,8 @@ def test_usage_with_solver():
|
|||||||
}[cid])
|
}[cid])
|
||||||
|
|
||||||
component = StaticLazyConstraintsComponent(threshold=0.90,
|
component = StaticLazyConstraintsComponent(threshold=0.90,
|
||||||
use_two_phase_gap=False)
|
use_two_phase_gap=False,
|
||||||
|
violation_tolerance=1.0)
|
||||||
component.classifiers = {
|
component.classifiers = {
|
||||||
"type-a": Mock(spec=Classifier),
|
"type-a": Mock(spec=Classifier),
|
||||||
"type-b": Mock(spec=Classifier),
|
"type-b": Mock(spec=Classifier),
|
||||||
@@ -105,7 +106,7 @@ def test_usage_with_solver():
|
|||||||
|
|
||||||
# Should ask internal solver to verify if constraints in the pool are
|
# Should ask internal solver to verify if constraints in the pool are
|
||||||
# satisfied and add the ones that are not
|
# satisfied and add the ones that are not
|
||||||
internal.is_constraint_satisfied.assert_called_once_with("<c2>")
|
internal.is_constraint_satisfied.assert_called_once_with("<c2>", tol=1.0)
|
||||||
internal.is_constraint_satisfied.reset_mock()
|
internal.is_constraint_satisfied.reset_mock()
|
||||||
internal.add_constraint.assert_called_once_with("<c2>")
|
internal.add_constraint.assert_called_once_with("<c2>")
|
||||||
internal.add_constraint.reset_mock()
|
internal.add_constraint.reset_mock()
|
||||||
|
|||||||
Reference in New Issue
Block a user