Commit daf435ab authored by Mathieu Hemery's avatar Mathieu Hemery
Browse files

Add the splitting of two ways kinetics

parent c5e531f4
......@@ -31,7 +31,13 @@ correct_model :-
reactions_with_species(List_Molecule, List_Reaction),
forall(
member(Reaction, List_Reaction),
remove_null_kinetic(Reaction)
(
remove_null_kinetic(Reaction),!
;
split_bidirectional_reaction(Reaction),!
;
true
)
).
%! remove_null_kinetic(+Reaction)
......@@ -43,6 +49,20 @@ remove_null_kinetic(Expression for Reaction) :-
is_null(Expression)
->
delete_reaction(Expression for Reaction)
).
%! split_bidirectional_reaction(+Reaction)
%
% Split a bidirection reaction in two
split_bidirectional_reaction(Expression for Reactant => Product) :-
(
distribute(Expression, DistExpr),
DistExpr = Up - Down
->
delete_reaction(Expression for Reactant => Product),
add_reaction(Up for Reactant => Product),
add_reaction(Down for Product => Reactant)
;
true
).
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