MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 1ff94d9d authored by Thierry Martinez's avatar Thierry Martinez
Browse files

load_ode

parent 48fd4780
......@@ -30,9 +30,10 @@ filename(Filename, ExpandedFilename) :-
library_path(LibraryPath),
Options = [relative_to(LibraryPath)]
;
SubFilename = Filename,
%Options = [], !bugwar: relative_to(Dir)!
working_directory(Dir, Dir),
Options = [relative_to(Dir)],
SubFilename = Filename
Options = [relative_to(Dir)]
),
absolute_file_name(SubFilename, ExpandedFilename, [expand(true) | Options]).
......
......@@ -173,6 +173,10 @@ convert_expression(- A, - AIndexed) :-
!,
convert_expression(A, AIndexed).
convert_expression([A], - AIndexed) :-
!,
convert_expression(A, AIndexed).
convert_expression(A + B, AIndexed + BIndexed) :-
!,
convert_expression(A, AIndexed),
......
......@@ -219,5 +219,3 @@ reserved('EX').
reserved('xor').
reserved('R').
......@@ -3,7 +3,8 @@
[
list_ODE/0,
compute_ode/0,
ode/2
ode/2,
load_ode/1
]).
:- dynamic(ode/2).
......@@ -79,3 +80,40 @@ print_ode :-
format('~f \td[~w]/dt=~w\n', [InitialConcentration, Molecule, Equation])
)
).
load_ode(InputFile) :-
biocham_command,
type(InputFile, input_file),
doc('
creates a new Biocham model (reaction rules, initial state, parameters and
macros) inferred from an xppaut .ode file (preferably written with
parameters).
'),
external_convert_ode(InputFile, 'external_ode.bc'),
load_biocham('external_ode.bc').
add_ode(InputFile) :-
biocham_command,
type(InputFile, input_file),
doc('
adds reaction rules, initial state, parameters and
macros inferred from an xppaut .ode file (preferably written with
parameters).
'),
external_convert_ode(InputFile, 'external_ode.bc'),
add_biocham('external_ode.bc').
external_convert_ode(InputFile, OutputFile) :-
setup_call_cleanup(
open('external_load_ode.bc', write, Ode_bc),
(
portray_clause(Ode_bc, load_ode(InputFile)),
portray_clause(Ode_bc, export_biocham(OutputFile)),
portray_clause(Ode_bc, 'quit')
),
close(Ode_bc)
),
call_subprocess(path(biocham), ['external_load_ode.bc'], [stdout(pipe(_))]).
......@@ -13,4 +13,21 @@ test('compute_ode', [true(ODEs == [ode(b, a), ode(a, -a)])]) :-
ODEs).
test('load_ode', [true(Reactions = [[a] for a => b])]) :-
clear_model,
setup_call_cleanup(
open('test.ode', write, TestOde),
write(TestOde, '
init a = 0
init b = 0
da/dt = -a
db/dt = a
done
'),
close(TestOde)
),
load_ode('test.ode'),
all_items([kind: reaction], Reactions).
:- end_tests(ode).
......@@ -117,6 +117,10 @@ kinetics((SimpleKinetics0, SimpleKinetics1)) :-
:- grammar(simple_kinetics).
simple_kinetics([A]) :-
simple_kinetics(A).
simple_kinetics(SimpleKinetics0 + SimpleKinetics1) :-
simple_kinetics(SimpleKinetics0),
simple_kinetics(SimpleKinetics1).
......
A <=> B.
list_ODE.
numerical_simulation.
quit.
\ No newline at end of file
% BIOCHAM model file
% Reaction rules
[a] for a=>b.
% Initial state
absent(a).
absent(b).
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