Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable usage of Highs solver #766

Merged
merged 22 commits into from Jul 31, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
62a3c21
add highs to requirements
victorgarcia98 Jul 19, 2023
150a951
Merge branch 'main' into dependencies/add-highspy
victorgarcia98 Jul 20, 2023
d615b25
Merge branch 'main' into dependencies/add-highspy
victorgarcia98 Jul 21, 2023
ebbc65a
docs: add changelog entry
victorgarcia98 Jul 21, 2023
51a3148
fix: get results with infeasible termination status instead of Runtim…
victorgarcia98 Jul 23, 2023
a699c16
fx: avoid double solving
victorgarcia98 Jul 24, 2023
f6b3772
style: fix HiGHS capitalization
victorgarcia98 Jul 24, 2023
6d9c2a6
remove HiGHS from requirements
victorgarcia98 Jul 24, 2023
58b24e3
remove dependency
victorgarcia98 Jul 24, 2023
bb00d3a
add dependency back
victorgarcia98 Jul 24, 2023
d2809ad
docs: document how to install HiGHS
victorgarcia98 Jul 24, 2023
2a94530
add HIghs to Dockerfile
victorgarcia98 Jul 24, 2023
ffacf30
remove extra lines
victorgarcia98 Jul 24, 2023
ce969db
fix typos
victorgarcia98 Jul 24, 2023
ae09379
load solution when termination_condition!=infeasible
victorgarcia98 Jul 24, 2023
c8cb457
Merge branch 'main' into dependencies/add-highspy
victorgarcia98 Jul 24, 2023
3d249ce
address some textual changes
victorgarcia98 Jul 24, 2023
97d9bde
fx CBC capitalization
victorgarcia98 Jul 24, 2023
9a253df
fix grammar
victorgarcia98 Jul 24, 2023
ca7a0e6
check if there are results in a more robustly
victorgarcia98 Jul 24, 2023
aea59bb
update inline comment
Flix6x Jul 25, 2023
2fffe45
Merge branch 'main' into dependencies/add-highspy
victorgarcia98 Jul 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions flexmeasures/data/models/planning/linear_optimization.py
Expand Up @@ -339,9 +339,16 @@ def cost_function(m):
model.costs = Objective(rule=cost_function, sense=minimize)

# Solve
results = SolverFactory(current_app.config.get("FLEXMEASURES_LP_SOLVER")).solve(
model
)
solver_name = current_app.config.get("FLEXMEASURES_LP_SOLVER")
opt = SolverFactory(solver_name)

if "highs" in solver_name.lower():
try:
results = opt.solve(model)
except RuntimeError:
results = opt.solve(model, load_solutions=False)
victorgarcia98 marked this conversation as resolved.
Show resolved Hide resolved
else:
results = opt.solve(model)

planned_costs = value(model.costs)
planned_power_per_device = []
Expand Down