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

Make binomial_reduction a 'yesno' option in gpac

parent a2724e64
......@@ -42,6 +42,7 @@ Rq: The distinction between pivp_string and pivp_list is not always obvious.
]).
:- use_module(doc).
:- use_module(biocham).
:- use_module(objects).
:- use_module(reaction_rules).
:- use_module(util).
......@@ -55,6 +56,8 @@ Rq: The distinction between pivp_string and pivp_list is not always obvious.
%%% Main Tools of the module %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:- initial(option(binomial_reduction: no)).
%! compile_from_expression(+Expr, +Input, +Output)
%
% biocham command
......@@ -75,8 +78,14 @@ compile_from_expression(Expr, Input, Output) :-
creates a biochemical reaction network such that Output = Expr(Input). Use \'time\' as
input to get Output = Expr(t).
'),
option(
binomial_reduction,
yesno,
Reduction,
'Determine if the binomial reduction has to be performed'
),
expression_to_PIVP(Expr, PIVP),
pivp_compile(PIVP, Input, Output).
pivp_compile(PIVP, Input, Output, Reduction).
:- doc('
\\begin{example} Compilation of the expression 4+time^2:\n
......@@ -226,8 +235,14 @@ compile_from_pivp(PIVP, Input, Output) :-
compiles a PIVP into biochemical reactions. Use \'time\' as input
to get output f(t), or use any other input x to get f(x) as output.
'),
option(
binomial_reduction,
yesno,
Reduction,
'Determine if the binomial reduction has to be performed'
),
format_pivp(PIVP, P),
pivp_compile(P, Input, Output).
pivp_compile(P, Input, Output, Reduction).
:- devdoc('\\begin{todo} Compilation of the cosine function as a function of time defined as the solution of a PIVP)\n
\\texttt{
......@@ -265,15 +280,21 @@ test_2908 :-
').
%! pivp_compile(+PIVP_list, +Input, +Output)
%! pivp_compile(+PIVP_list, +Input, +Output, +Reduction)
%
% Compile a PIVP_list, this function first reduce the PIVP to a binomial form
% then make a call to compile_PIVP to
% make the real work but take charge of the modification of the model
% when Input is not time through a call to g_to_c_PIVP/3.
pivp_compile(PIVP_non_bin, Input, Output):-
reduce_to_binomial(PIVP_non_bin,PIVP),
pivp_compile(PIVP_non_bin, Input, Output, Reduction):-
(
Reduction = yes
->
reduce_to_binomial(PIVP_non_bin,PIVP)
;
PIVP = PIVP_non_bin
),
clear_model,
get_option(fast_rate, Fast),
set_parameter(fast, Fast),
......
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