Unverified Commit e9410821 authored by St. Elmo's avatar St. Elmo
Browse files

added warm start capability to fva and pfba

parent 0081b9b2
...@@ -145,6 +145,9 @@ function _FVA_optimize_reaction(model, rid, ret) ...@@ -145,6 +145,9 @@ function _FVA_optimize_reaction(model, rid, ret)
var = all_variables(model)[abs(rid)] var = all_variables(model)[abs(rid)]
@objective(model, sense, var) @objective(model, sense, var)
if termination_status(model) != MOI.OPTIMIZE_NOT_CALLED && solver_name(model) in ["Gurobi", ]
set_start_value.(all_variables(model), value.(all_variables(model))) # warm start
end
optimize!(model) optimize!(model)
if is_solved(model) if is_solved(model)
......
...@@ -54,6 +54,11 @@ function parsimonious_flux_balance_analysis( ...@@ -54,6 +54,11 @@ function parsimonious_flux_balance_analysis(
# add the minimization constraint for total flux # add the minimization constraint for total flux
v = opt_model[:x] # fluxes v = opt_model[:x] # fluxes
if solver_name(opt_model) in ["Gurobi", ]
set_start_value.(all_variables(opt_model), value.(all_variables(opt_model))) # warm start
end
@objective(opt_model, Min, sum(dot(v, v))) @objective(opt_model, Min, sum(dot(v, v)))
for rb in relax_bounds for rb in relax_bounds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment