Generic_rule_interpreter.Makemodule Instances : Instances_sig.Stype result = | Clash| Corrected| Blocked| Success of tClash means rectangular approximation failure Corrected means molecular ambiguity failure
*)val empty :
outputs:(Data.t -> unit) ->
with_trace:bool ->
Stdlib.Random.State.t ->
Kappa_terms.Model.t ->
Counter.t ->
tget_alg is by default Model.get_alg but it is not hard wired because perturbations can redefined alg_expr.
val value_alg :
Counter.t ->
t ->
Kappa_terms.Primitives.alg_expr ->
Kappa_data_structures.Nbr.tval value_bool :
Counter.t ->
t ->
(Kappa_terms.Pattern.id array list, int) Kappa_terms.Alg_expr.bool ->
boolval activity : t -> floatval get_edges : t -> Kappa_site_graphs.Edges.tval apply_given_rule :
debug_mode:bool ->
outputs:(Data.t -> unit) ->
?rule_id:int ->
Kappa_terms.Model.t ->
Counter.t ->
t ->
Trace.event_kind ->
Kappa_terms.Primitives.elementary_rule ->
resultReturns the graph obtained by applying the rule. rule_id is mandatory if the rule has an unary rate.
val pick_an_instance : debug_mode:bool -> Kappa_terms.Model.t -> t -> instanceval is_correct_instance : Kappa_terms.Model.t -> t -> instance -> boolval apply_instance :
debug_mode:bool ->
outputs:(Data.t -> unit) ->
?maxConsecutiveBlocked:int ->
maxConsecutiveClash:int ->
Kappa_terms.Model.t ->
Counter.t ->
t ->
instance ->
int option * bool * tapply_rule ~outputs ~maxConsecutiveClash ?is_blocked model counter st Returns (corresponding_syntactic_rule, is_final_step, new_state). is_final_step is determined by the counter. corresponding_syntactic_rule is equal to None if and only if a null event occured
val force_rule :
debug_mode:bool ->
outputs:(Data.t -> unit) ->
Kappa_terms.Model.t ->
Counter.t ->
t ->
Trace.event_kind ->
?rule_id:int ->
Kappa_terms.Primitives.elementary_rule ->
t optionApply the rule for sure if it is possible. Try apply_rule but in case of null_event, it computes the exact injections of the left hand side to do apply the rule and returns the remaining exact injections.
val incorporate_extra_pattern :
debug_mode:bool ->
Kappa_terms.Pattern.Env.t ->
t ->
Kappa_terms.Pattern.id ->
tval overwrite_var :
int ->
Counter.t ->
t ->
Kappa_terms.Primitives.alg_expr ->
tval update_outdated_activities :
debug_mode:bool ->
(int -> float -> float -> unit) ->
Kappa_terms.Model.t ->
Counter.t ->
t ->
int list ->
t * int listResynchronize the state after a rule application.
It takes the function to store the new activities as an argument whose signature is store rule_id syntactic_rule_id new_activity.
As long as you don't use any algebraic variable (that include don't pick a rule randomly), you can apply several rules in row before resynchronizing. (This is what initial state does.)
takes the list of perturbations to be tried and returns it updated
val snapshot :
debug_mode:bool ->
raw:bool ->
Kappa_terms.Model.t ->
Counter.t ->
t ->
Data.snapshotval print : Kappa_terms.Model.t -> Stdlib.Format.formatter -> t -> unitval get_random_state : t -> Stdlib.Random.State.tval update_edges_from_actions :
debug_mode:bool ->
outputs:(Data.t -> unit) ->
Kappa_site_graphs.Signature.s ->
Counter.t ->
Kappa_terms.Pattern.Env.t ->
t ->
(Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.action list
* Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.site list) ->
tval send_instances_message : Instances.message -> t -> ttype event_predicate =
int option ->
Kappa_terms.Matching.t ->
Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.test list ->
Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.action list ->
boolval set_events_to_block : event_predicate option -> t -> tval add_tracked :
outputs:(Data.t -> unit) ->
Kappa_terms.Pattern.id array ->
string ->
Kappa_terms.Instantiation.abstract Kappa_terms.Instantiation.test list list ->
t ->
tval remove_tracked : Kappa_terms.Pattern.id array -> string option -> t -> tval add_tracked_species :
Kappa_terms.Pattern.id array ->
string ->
Kappa_terms.Instantiation.abstract Kappa_terms.Instantiation.test list list ->
t ->
tval print_stats : Stdlib.Format.formatter -> t -> unitval debug_print : Stdlib.Format.formatter -> t -> unitval apply_negative_transformation :
?mod_connectivity_store:Roots.mod_ccs_cache ->
Instances.t ->
(Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.site list
* Kappa_site_graphs.Edges.t) ->
Kappa_terms.Instantiation.concrete Kappa_terms.Primitives.Transformation.t ->
Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.site list
* Kappa_site_graphs.Edges.tInternals
val apply_positive_transformation :
debug_mode:bool ->
Kappa_site_graphs.Signature.s ->
?mod_connectivity_store:Roots.mod_ccs_cache ->
Instances.t ->
((Kappa_terms.Matching.t * int Kappa_data_structures.Mods.IntMap.t)
* Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.site list
* Kappa_site_graphs.Edges.t) ->
Kappa_terms.Instantiation.abstract Kappa_terms.Primitives.Transformation.t ->
((Kappa_terms.Matching.t * int Kappa_data_structures.Mods.IntMap.t)
* Kappa_terms.Instantiation.concrete Kappa_terms.Instantiation.site list
* Kappa_site_graphs.Edges.t)
* Kappa_terms.Instantiation.concrete Kappa_terms.Primitives.Transformation.tval apply_concrete_positive_transformation :
Kappa_site_graphs.Signature.s ->
?mod_connectivity_store:Roots.mod_ccs_cache ->
Instances.t ->
Kappa_site_graphs.Edges.t ->
Kappa_terms.Instantiation.concrete Kappa_terms.Primitives.Transformation.t ->
Kappa_site_graphs.Edges.tval obs_from_transformations :
debug_mode:bool ->
Kappa_terms.Pattern.Env.t ->
Kappa_site_graphs.Edges.t ->
Kappa_terms.Instantiation.concrete Kappa_terms.Primitives.Transformation.t
list ->
(Kappa_terms.Pattern.id * Kappa_site_graphs.Agent.t) list
* Kappa_data_structures.Operator.DepSet.tobs_from_transformations domain state transformations
val add_outdated_dependencies :
Kappa_data_structures.Operator.DepSet.t ->
t ->
tval debug_print_instances : Stdlib.Format.formatter -> t -> unit