Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
0104137f
Commit
0104137f
authored
Dec 11, 2019
by
SOLIMAN Sylvain
Browse files
add option for a single solution for tropicalization
parent
543ec9c2
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
library/biomodels/BIOMD0000000014.xml
0 → 100644
View file @
0104137f
This diff is collapsed.
Click to expand it.
library/biomodels/BIOMD0000000103.xml
0 → 100644
View file @
0104137f
This diff is collapsed.
Click to expand it.
tropical.pl
View file @
0104137f
...
...
@@ -444,6 +444,7 @@ ignore_partial([Eq | E], [Eq | Equils], [_ | Vars], Ignored) :-
:-
initial
(
option
(
tropical_max_degree
:
3
)).
:-
initial
(
option
(
tropical_ignore
:
{})).
:-
initial
(
option
(
tropical_denominator
:
0
)).
:-
initial
(
option
(
tropical_single_solution
:
no
)).
:-
biocham_silent
(
clear_model
).
...
...
@@ -485,6 +486,12 @@ tropicalize :-
Denominator
,
'Look for solutions that are integers/(tropical_denominator+1)'
),
option
(
tropical_single_solution
,
yesno
,
Single
,
'Stop after finding one solution'
),
nb_setval
(
ovidiu_denominator
,
Denominator
),
set_degrees
(
Eps
),
retractall
(
is_zero
(
_
)),
...
...
@@ -504,7 +511,11 @@ tropicalize :-
length
(
Ai
,
VL
),
(
(
nb_current
(
ovidiu_file
,
_
)
(
nb_current
(
ovidiu_file
,
_
)
;
Single
=
yes
)
->
MaxD
is
2
^
Max
;
...
...
@@ -534,8 +545,13 @@ tropicalize :-
equilibrate_rec
(
Equils
),
MinD
is
-
MaxD
,
Ai
ins
MinD
..
MaxD
,
labeling
([
bisect
],
Ai
),
% ffc makes biomodel 407 slow...
% bisect slightly better
(
Single
=
yes
->
once
(
labeling
([
bisect
],
Ai
))
% ffc makes biomodel 407 slow...
;
labeling
([
bisect
],
Ai
)
% bisect slightly better
),
(
nb_current
(
ovidiu_file
,
_
)
->
...
...
tropical.plt
View file @
0104137f
:- use_module(library(plunit)).
get_number_of_solutions(Output, N) :-
findall(
Pos,
(
sub_atom(Output, Pos, _, _, 'found a complete equilibration'),
once(sub_atom(Output, _, _, _, 'ε'))
),
Positions
),
length(Positions, N).
:- begin_tests(tropical).
...
...
@@ -18,15 +30,30 @@ test(
tropicalize
)
),
findall(
Pos,
(
sub_atom(Output, Pos, _, _, 'found a complete equilibration'),
once(sub_atom(Output, _, _, _, 'ε'))
),
Positions
get_number_of_solutions(Output, N).
test(
'tropical_single_solution',
[
condition(flag(slow_test, true, true)),
setup(load('library/biomodels/BIOMD0000000103.xml')),
cleanup(clear_model),
true(N == 1)
]
) :-
with_output_to(
atom(Output),
with_option(
[
tropical_max_degree: 2,
tropical_epsilon: 0.2,
tropical_single_solution: yes
],
tropicalize
)
),
length(Positions
, N).
get_number_of_solutions(Output
, N).
:- end_tests(tropical).
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment