Skip to content

Commit

Permalink
Use a more pythonic pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbowly authored Nov 27, 2024
1 parent 8c19d0e commit c4225bb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/gurobi_optimods/opf/grbformulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,8 @@ def lpformulator_optimize(alldata, model, opftype):
bus = buses[j]
evar[bus].PStart = 1.0
if alldata["branchswitching_mip"]:
zvar = alldata["MIP"]["zvar"]
branches = alldata["branches"]
numbranches = alldata["numbranches"]
for j in range(1, 1 + numbranches):
branch = branches[j]
zvar[branch].PStart = 1.0
for zvar in alldata["MIP"]["zvar"].values():
zvar.PStart = 1.0
model.update()
model.optimize()

Expand Down

0 comments on commit c4225bb

Please sign in to comment.