Commit fa49c258 authored by HEMERY Mathieu's avatar HEMERY Mathieu
Browse files

Merge branch 'develop' of https://gitlab.inria.fr/lifeware/biocham into develop

parents 5537726c 84ce4e76
......@@ -120,7 +120,7 @@ jupyter_tests: install_kernel
# runs test unit %
test_%: biocham_debug
echo "flag(slow_test, _, false), run_tests_and_halt('$*')." | ./biocham_debug
echo "flag(slow_test, _, true), run_tests_and_halt('$*')." | ./biocham_debug
install_kernel: biocham $(KERNEL_DIR)/commands.js $(KERNEL_DIR)/commands.py $(WORKFLOWS_DIR)/workflows.js
- pip3 install --user $(JUPYTER_DIR)/kernel || pip install --user $(JUPYTER_DIR)/kernel
......
......@@ -191,17 +191,26 @@ conserv_laws_for_multistability_graph :-
asserta(conservLawsParent(ConservList)).
%%% Conservation laws are adapted to the permutation
adapt_conserv_aux(_, [], []) :- !.
adapt_conserv_aux(Swaps, [H | T], [NewH | NewT]) :-
member([H, NewHName], Swaps),
adapt_conserv_aux([], [], _) :- !.
adapt_conserv_aux([H | T], [NewH | NewT], Swaps) :-
memberchk([H, NewHName], Swaps),
!,
correspond_vertex_name_id(NewHName, NewH),
adapt_conserv_aux(Swaps, T, NewT), !.
adapt_conserv_aux(T, NewT, Swaps).
% Isolated nodes create conservation laws with species not part of the graph
adapt_conserv_aux([H], [], Swaps) :-
\+ member([H, _], Swaps).
adapt_conserv_laws(_, [], []) :- !.
adapt_conserv_laws(Swaps, [HList | TList], [NewHList | NewTList]) :-
adapt_conserv_aux(Swaps, HList, NewHListUnsorted),
adapt_conserv_laws([], [], _) :- !.
adapt_conserv_laws([HList | TList], [NewHList | NewTList], Swaps) :-
adapt_conserv_aux(HList, NewHListUnsorted, Swaps),
sort(NewHListUnsorted, NewHList),
adapt_conserv_laws(Swaps, TList, NewTList), !.
adapt_conserv_laws(TList, NewTList, Swaps).
%%%
remove_vertex_from_conserv_laws(_, [], []) :- !.
remove_vertex_from_conserv_laws(VertexName, [H | T], L) :-
......@@ -230,6 +239,7 @@ reset_gauss_system :-
%%% Add a loop to the gauss system
add_loop_to_system(Loop) :-
debug(multistability, "Loop: ~w~n", [Loop]),
loop_gauss_system(System),
pass_loop_in_system(Loop, System, [Species, Sign], Pivots_Used),
(
......@@ -288,6 +298,7 @@ add_loop_to_system(Loop) :-
)
),
!,
debug(multistability, "Positive circuit: ~w~n", [Species_conflict]),
fail
)
;
......@@ -623,7 +634,7 @@ copy_multistability_graph(ParentId, Swaps) :-
conservLawsParent(ConservList),
retractall(conservLaws(_)),
% write(Swaps), write(' '), write(ConservList), write('\n'),
adapt_conserv_laws(Swaps, ConservList, NewConservList),
adapt_conserv_laws(ConservList, NewConservList, Swaps),
asserta(conservLaws(NewConservList)),
get_current_graph(MultiGraphId),
set_attribute(MultiGraphId, swaps_used=Swaps).
......@@ -866,6 +877,7 @@ get_vertex_to_remove(VertexId) :-
remove_best_vertex :-
get_vertex_to_remove(VertexId),
debug(multistability, "Removing vertex: ~w~n", [VertexId]),
remove_vertex(VertexId).
......@@ -944,7 +956,12 @@ check_multistability_graph :-
true
),
get_current_graph(GraphId),
get_attribute(GraphId, swaps_used=Swaps),
(
get_attribute(GraphId, swaps_used=Swaps)
->
% get_attribute creates a choice point
true
),
write('There is no multiple steady states with non-zero values, no positive circuit\n'),
(
identity_swap(Swaps)
......
Supports Markdown
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