Skip to content

Commit

Permalink
add test_FP_L1_norm
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Dec 1, 2023
1 parent 875269f commit 65e58f5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pyomo/contrib/mindtpy/tests/test_mindtpy_feas_pump.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pyomo.contrib.mindtpy.tests.feasibility_pump1 import FeasPump1
from pyomo.contrib.mindtpy.tests.feasibility_pump2 import FeasPump2

required_solvers = ('ipopt', 'cplex')
required_solvers = ('ipopt', 'glpk')
# TODO: 'appsi_highs' will fail here.
if all(SolverFactory(s).available(exception_flag=False) for s in required_solvers):
subsolvers_available = True
Expand Down Expand Up @@ -69,6 +69,22 @@ def test_FP(self):
log_infeasible_constraints(model)
self.assertTrue(is_feasible(model, self.get_config(opt)))

def test_FP_L1_norm(self):
"""Test the feasibility pump algorithm."""
with SolverFactory('mindtpy') as opt:
for model in model_list:
model = model.clone()
results = opt.solve(
model,
strategy='FP',
mip_solver=required_solvers[1],
nlp_solver=required_solvers[0],
absolute_bound_tolerance=1e-5,
fp_main_norm='L1',
)
log_infeasible_constraints(model)
self.assertTrue(is_feasible(model, self.get_config(opt)))

def test_FP_OA_8PP(self):
"""Test the FP-OA algorithm."""
with SolverFactory('mindtpy') as opt:
Expand Down

0 comments on commit 65e58f5

Please sign in to comment.