Commit 40a15283 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

better species ignore list for equilibration

parent b99347a0
......@@ -215,6 +215,11 @@ subst_deg_and_vars(A ^ N, Vars, Ai, NN * AA) :-
!,
subst_deg_and_vars(A, Vars, Ai, AA).
subst_deg_and_vars(N, _Vars, _Ai, D) :-
number(N),
!,
get_degree(N, D).
subst_deg_and_vars(K, _Vars, _Ai, D) :-
degree(K, D),
!.
......@@ -425,7 +430,7 @@ ignore_unbalanced([H | T], [H | TT]) :-
:- initial(option(tropical_epsilon: 0.1)).
:- initial(option(tropical_max_degree: 3)).
:- initial(option(tropical_partial: 0)).
:- initial(option(tropical_ignore: {})).
:- initial(option(tropical_denominator: 0)).
:- biocham_silent(clear_model).
......@@ -456,12 +461,11 @@ tropicalize :-
'Max absolute value of the degree in epsilon as a power of 2'
),
option(
tropical_partial,
number,
tropical_ignore,
{object},
Partial,
'Number of a variable (as displayed by \\command{list_molecules/0} plus 1)
to ignore for equilibration (0 to ignore none, -1 to ignore all
unbalanced)'
'set of species to ignore for equilibration ({} to ignore none, {-1} to
ignore all unbalanced)'
),
option(
tropical_denominator,
......@@ -501,18 +505,26 @@ tropicalize :-
get_equilibrations(Vars, Ai, E, _DE),
debug(tropical, "equilibrations: ~w", [E]),
(
Partial == 0
Partial == [{}]
->
Equils = E
;
Partial == -1
Partial == [-1]
->
ignore_unbalanced(E, Equils),
write(E),nl,
write(Equils),nl
;
format("Ignoring equilibration for ~wth variable\n", [Partial]),
nth1(Partial, E, _, Equils)
format("Ignoring equilibration for ~w\n", [Partial]),
findall(
Eq,
(
nth0(N, E, Eq),
nth0(N, Vars, V),
\+ member(V, Partial)
),
Equils
)
),
debug(tropical, "equilibrations: ~w~n", [Equils]),
equilibrate_rec(Equils),
......
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