Commit 643a9a8b authored by HEMERY Mathieu's avatar HEMERY Mathieu
Browse files

Rewrite print_alpha_parameter

parent db8c6b42
......@@ -516,7 +516,7 @@ print_event(Reactions_data, Stoch_list, Hybrid_reactants_list, Constraints_list,
length(Reactions_data, Number_of_alpha),
length(Stoch_list, Number_of_species),
print_alpha_parameters(Number_of_alpha, Stream),
print_constraints_parameters(Constraints_list, 1, Stream),
print_constraints_parameters(Constraints_list, Stream),
% 1. Build Starting String for the event.
format(Stream, "add_event(Time > tau,~n",[]),
......@@ -543,7 +543,7 @@ print_event(Reactions_data, Stoch_list, Hybrid_reactants_list, Constraints_list,
%! print_alpha_parameters(+N_alpha, +Stream)
%
%
% write parameter(alpha1=0,alpha2=0,etc.) in the Stream
print_alpha_parameters(N_alpha, Stream) :-
numlist(1,N_alpha,AlphaList),
......@@ -555,7 +555,28 @@ print_alpha_parameters_sr([N| Tail], Stream) :-
format(Stream, "alpha~d = 0, ", [N]),
print_alpha_parameters_sr(Tail, Stream).
print_alpha_parameters_sr([], Stream).
print_alpha_parameters_sr([], _Stream).
%! print_constraints_parameters(+N_constraints, +Stream)
%
% write parameter(lower_level1=0,lower_level2=0,etc.) in the Stream
print_constraints_parameters(List_constraints, Stream) :-
length(List_constraints, N_constraints),
numlist(1,N_constraints,Constr_List),
format(Stream, "parameter(", []),
print_constraints_parameters_sr(Constr_List, Stream),
format(Stream, ").~n", []).
print_constraints_parameters_sr([N], _Stream) :-
format(Stream, "lower_level~d = 0", [N]),!.
print_constraints_parameters_sr([N|Tail], Stream) :-
format(Stream, "lower_level~d = 0, ", [N]),
print_constraints_parameters_sr(Tail, Stream).
print_constraints_parameters(Constraints_list, Current_counter, Stream) :-
length(Constraints_list, Total_count),
......@@ -1261,7 +1282,7 @@ print_dynamic_event(SortedSpecies,Reactions_data, HybridDynamicReactants,MaxPart
get_option(stochastic_conversion,Rate),
length(Reactions_data, Number_of_alpha),
print_alpha_parameters(Number_of_alpha, Stream),
print_constraints_parameters(Constraints_list, 1, Stream),
print_constraints_parameters(Constraints_list, Stream),
% 1. Build Starting String for the event.
write(Stream, 'add_event(Time > tau,'),nl(Stream),
print_dynamic_event_condition(SortedSpecies,HybridDynamicReactants,1,PropTresh,MaxParticleChange,Stream),
......
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