Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
COBREXA.jl
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LCSB-BioCore
COBREXA.jl
Commits
7079d229
Unverified
Commit
7079d229
authored
3 years ago
by
St. Elmo
Committed by
Miroslav Kratochvil
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
changed coupling extension
parent
ab48efab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/base/solver.jl
+3
-16
3 additions, 16 deletions
src/base/solver.jl
with
3 additions
and
16 deletions
src/base/solver.jl
+
3
−
16
View file @
7079d229
...
@@ -20,23 +20,10 @@ function make_optimization_model(model::MetabolicModel, optimizer; sense = MOI.M
...
@@ -20,23 +20,10 @@ function make_optimization_model(model::MetabolicModel, optimizer; sense = MOI.M
@constraint
(
optimization_model
,
lbs
,
xl
.<=
x
)
# lower bounds
@constraint
(
optimization_model
,
lbs
,
xl
.<=
x
)
# lower bounds
@constraint
(
optimization_model
,
ubs
,
x
.<=
xu
)
# upper bounds
@constraint
(
optimization_model
,
ubs
,
x
.<=
xu
)
# upper bounds
return
optimization_model
C
=
coupling
(
model
)
# empty if no coupling
end
function
make_optimization_model
(
model
::
CoreModelCoupled
,
optimizer
;
sense
=
MOI
.
MAX_SENSE
)
# coupled models have specific structure
m
,
n
=
size
(
stoichiometry
(
model
))
xl
,
xu
=
bounds
(
model
)
cl
,
cu
=
coupling_bounds
(
model
)
cl
,
cu
=
coupling_bounds
(
model
)
isempty
(
C
)
||
@constraint
(
optimization_model
,
c_lbs
,
cl
.<=
coupling
(
model
)
*
x
)
# coupling lower bounds
optimization_model
=
COBREXA
.
JuMP
.
Model
(
optimizer
)
isempty
(
C
)
||
@constraint
(
optimization_model
,
c_ubs
,
coupling
(
model
)
*
x
.<=
cu
)
# coupling upper bounds
@variable
(
optimization_model
,
x
[
i
=
1
:
n
])
@objective
(
optimization_model
,
sense
,
objective
(
model
)
'
*
x
)
@constraint
(
optimization_model
,
mb
,
stoichiometry
(
model
)
*
x
.==
balance
(
model
))
# mass balance
@constraint
(
optimization_model
,
lbs
,
xl
.<=
x
)
# lower bounds
@constraint
(
optimization_model
,
ubs
,
x
.<=
xu
)
# upper bounds
@constraint
(
optimization_model
,
c_lbs
,
cl
.<=
coupling
(
model
)
*
x
)
# coupling lower bounds
@constraint
(
optimization_model
,
c_ubs
,
coupling
(
model
)
*
x
.<=
cu
)
# coupling upper bounds
return
optimization_model
return
optimization_model
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment