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)
var = all_variables(model)[abs(rid)]
@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)
if is_solved(model)
......
......@@ -54,6 +54,11 @@ function parsimonious_flux_balance_analysis(
# add the minimization constraint for total flux
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)))
for rb in relax_bounds
......
Supports Markdown
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