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

update code

parent dcc5a9d7
......@@ -52,3 +52,6 @@ const _constants = (
),
colors = (empty = :dark_gray, payload = :default, key = :cyan),
)
const MAX = COBREXA.MOI.MAX_SENSE
const MIN = COBREXA.MOI.MIN_SENSE
......@@ -42,3 +42,15 @@ function optimize_model(model::MetabolicModel, optimizer; sense = MOI.MIN_SENSE)
COBREXA.JuMP.optimize!(optimization_model)
return optimization_model
end
"""
is_solved(optmodel)
Return `true` if `optmodel` solved successfully (solution is optimal or locally optimal).
Return `false` if any other termination status is reached. Termination status is defined
in the documentation of `JuMP`.
"""
function is_solved(optmodel)
COBREXA.JuMP.termination_status(optmodel) in [MOI.OPTIMAL, MOI.LOCALLY_SOLVED] ? true : false
end
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