Skip to content

Commit

Permalink
[#123] add ac-local option
Browse files Browse the repository at this point in the history
  • Loading branch information
hhijazi committed Oct 9, 2024
1 parent 897c8e8 commit cbb06b7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/gurobi_optimods/opf/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,21 @@ def solve_opf(
fields
"""

# Exact cartesian AC (force jabr for performance reasons)
if opftype.lower() == "ac":
# use ac-local to run Gurobi as a local solver (stops at the first feasible solution)
if opftype.lower() == "ac-local":
opftype = "ac"
useef = True
usejabr = False
default_solver_params = {
"MIPGap": 1e-3,
"OptimalityTol": 1e-3,
"Presolve": 0,
"SolutionLimit": 1,
}
elif opftype.lower() == "ac":
opftype = "ac"
useef = True
usejabr = True
default_solver_params = {"MIPGap": 1e-3, "OptimalityTol": 1e-3}
# AC relaxation using the JABR inequality
elif opftype.lower() == "acrelax":
Expand Down

0 comments on commit cbb06b7

Please sign in to comment.