lc_regulatory_events (faber_neuroevolution v1.2.4)

View Source

Behavioral event constructors for Regulatory Silo.

Events related to gene expression and module activation. Regulatory Silo operates at timescale τ=45.

Summary

Types

individual_id/0

-type individual_id() :: binary().

regulatory_event/0

-type regulatory_event() ::
          #gene_expressed{meta ::
                              #lc_event_meta{event_id :: binary(),
                                             correlation_id :: binary() | undefined,
                                             causation_id :: binary() | undefined,
                                             timestamp :: timestamp(),
                                             version :: pos_integer(),
                                             emitter :: atom()},
                          individual_id :: individual_id(),
                          gene_id :: binary(),
                          expression_level :: float(),
                          trigger :: environmental | developmental | conditional,
                          context :: term()} |
          #gene_silenced{meta ::
                             #lc_event_meta{event_id :: binary(),
                                            correlation_id :: binary() | undefined,
                                            causation_id :: binary() | undefined,
                                            timestamp :: timestamp(),
                                            version :: pos_integer(),
                                            emitter :: atom()},
                         individual_id :: individual_id(),
                         gene_id :: binary(),
                         silencing_cause :: regulatory | epigenetic | conditional,
                         duration :: temporary | permanent} |
          #module_activated{meta ::
                                #lc_event_meta{event_id :: binary(),
                                               correlation_id :: binary() | undefined,
                                               causation_id :: binary() | undefined,
                                               timestamp :: timestamp(),
                                               version :: pos_integer(),
                                               emitter :: atom()},
                            individual_id :: individual_id(),
                            module_id :: binary(),
                            activation_context :: term(),
                            neurons_involved :: non_neg_integer(),
                            switching_cost :: float()} |
          #module_deactivated{meta ::
                                  #lc_event_meta{event_id :: binary(),
                                                 correlation_id :: binary() | undefined,
                                                 causation_id :: binary() | undefined,
                                                 timestamp :: timestamp(),
                                                 version :: pos_integer(),
                                                 emitter :: atom()},
                              individual_id :: individual_id(),
                              module_id :: binary(),
                              deactivation_reason :: context_change | resource_constraint | completion,
                              active_duration_ms :: non_neg_integer()} |
          #context_switched{meta ::
                                #lc_event_meta{event_id :: binary(),
                                               correlation_id :: binary() | undefined,
                                               causation_id :: binary() | undefined,
                                               timestamp :: timestamp(),
                                               version :: pos_integer(),
                                               emitter :: atom()},
                            individual_id :: individual_id(),
                            context_before :: term(),
                            context_after :: term(),
                            genes_affected :: [binary()],
                            modules_toggled :: non_neg_integer()} |
          #regulatory_network_updated{meta ::
                                          #lc_event_meta{event_id :: binary(),
                                                         correlation_id :: binary() | undefined,
                                                         causation_id :: binary() | undefined,
                                                         timestamp :: timestamp(),
                                                         version :: pos_integer(),
                                                         emitter :: atom()},
                                      individual_id :: individual_id(),
                                      regulators_added :: non_neg_integer(),
                                      regulators_removed :: non_neg_integer(),
                                      network_complexity :: float()} |
          #dormancy_entered{meta ::
                                #lc_event_meta{event_id :: binary(),
                                               correlation_id :: binary() | undefined,
                                               causation_id :: binary() | undefined,
                                               timestamp :: timestamp(),
                                               version :: pos_integer(),
                                               emitter :: atom()},
                            individual_id :: individual_id(),
                            dormant_capabilities :: [binary()],
                            dormancy_trigger :: resource_constraint | environmental | developmental,
                            maintenance_cost :: float()} |
          #dormancy_exited{meta ::
                               #lc_event_meta{event_id :: binary(),
                                              correlation_id :: binary() | undefined,
                                              causation_id :: binary() | undefined,
                                              timestamp :: timestamp(),
                                              version :: pos_integer(),
                                              emitter :: atom()},
                           individual_id :: individual_id(),
                           reactivated_capabilities :: [binary()],
                           reactivation_trigger :: opportunity | stress | development,
                           reactivation_delay_ms :: non_neg_integer()}.

timestamp/0

-type timestamp() :: integer().

Functions

context_switched(Data)

-spec context_switched(map()) ->
                          #context_switched{meta ::
                                                #lc_event_meta{event_id :: binary(),
                                                               correlation_id :: binary() | undefined,
                                                               causation_id :: binary() | undefined,
                                                               timestamp :: timestamp(),
                                                               version :: pos_integer(),
                                                               emitter :: atom()},
                                            individual_id :: individual_id(),
                                            context_before :: term(),
                                            context_after :: term(),
                                            genes_affected :: [binary()],
                                            modules_toggled :: non_neg_integer()}.

dormancy_entered(Data)

-spec dormancy_entered(map()) ->
                          #dormancy_entered{meta ::
                                                #lc_event_meta{event_id :: binary(),
                                                               correlation_id :: binary() | undefined,
                                                               causation_id :: binary() | undefined,
                                                               timestamp :: timestamp(),
                                                               version :: pos_integer(),
                                                               emitter :: atom()},
                                            individual_id :: individual_id(),
                                            dormant_capabilities :: [binary()],
                                            dormancy_trigger ::
                                                resource_constraint | environmental | developmental,
                                            maintenance_cost :: float()}.

dormancy_exited(Data)

-spec dormancy_exited(map()) ->
                         #dormancy_exited{meta ::
                                              #lc_event_meta{event_id :: binary(),
                                                             correlation_id :: binary() | undefined,
                                                             causation_id :: binary() | undefined,
                                                             timestamp :: timestamp(),
                                                             version :: pos_integer(),
                                                             emitter :: atom()},
                                          individual_id :: individual_id(),
                                          reactivated_capabilities :: [binary()],
                                          reactivation_trigger :: opportunity | stress | development,
                                          reactivation_delay_ms :: non_neg_integer()}.

event_to_map(Event)

-spec event_to_map(regulatory_event()) -> map().

gene_expressed(Data)

-spec gene_expressed(map()) ->
                        #gene_expressed{meta ::
                                            #lc_event_meta{event_id :: binary(),
                                                           correlation_id :: binary() | undefined,
                                                           causation_id :: binary() | undefined,
                                                           timestamp :: timestamp(),
                                                           version :: pos_integer(),
                                                           emitter :: atom()},
                                        individual_id :: individual_id(),
                                        gene_id :: binary(),
                                        expression_level :: float(),
                                        trigger :: environmental | developmental | conditional,
                                        context :: term()}.

gene_silenced(Data)

-spec gene_silenced(map()) ->
                       #gene_silenced{meta ::
                                          #lc_event_meta{event_id :: binary(),
                                                         correlation_id :: binary() | undefined,
                                                         causation_id :: binary() | undefined,
                                                         timestamp :: timestamp(),
                                                         version :: pos_integer(),
                                                         emitter :: atom()},
                                      individual_id :: individual_id(),
                                      gene_id :: binary(),
                                      silencing_cause :: regulatory | epigenetic | conditional,
                                      duration :: temporary | permanent}.

make_meta(Emitter)

-spec make_meta(Emitter :: atom()) ->
                   #lc_event_meta{event_id :: binary(),
                                  correlation_id :: binary() | undefined,
                                  causation_id :: binary() | undefined,
                                  timestamp :: timestamp(),
                                  version :: pos_integer(),
                                  emitter :: atom()}.

make_meta(Emitter, Opts)

-spec make_meta(Emitter :: atom(), Opts :: map()) ->
                   #lc_event_meta{event_id :: binary(),
                                  correlation_id :: binary() | undefined,
                                  causation_id :: binary() | undefined,
                                  timestamp :: timestamp(),
                                  version :: pos_integer(),
                                  emitter :: atom()}.

module_activated(Data)

-spec module_activated(map()) ->
                          #module_activated{meta ::
                                                #lc_event_meta{event_id :: binary(),
                                                               correlation_id :: binary() | undefined,
                                                               causation_id :: binary() | undefined,
                                                               timestamp :: timestamp(),
                                                               version :: pos_integer(),
                                                               emitter :: atom()},
                                            individual_id :: individual_id(),
                                            module_id :: binary(),
                                            activation_context :: term(),
                                            neurons_involved :: non_neg_integer(),
                                            switching_cost :: float()}.

module_deactivated(Data)

-spec module_deactivated(map()) ->
                            #module_deactivated{meta ::
                                                    #lc_event_meta{event_id :: binary(),
                                                                   correlation_id ::
                                                                       binary() | undefined,
                                                                   causation_id :: binary() | undefined,
                                                                   timestamp :: timestamp(),
                                                                   version :: pos_integer(),
                                                                   emitter :: atom()},
                                                individual_id :: individual_id(),
                                                module_id :: binary(),
                                                deactivation_reason ::
                                                    context_change | resource_constraint | completion,
                                                active_duration_ms :: non_neg_integer()}.

regulatory_network_updated(Data)

-spec regulatory_network_updated(map()) ->
                                    #regulatory_network_updated{meta ::
                                                                    #lc_event_meta{event_id :: binary(),
                                                                                   correlation_id ::
                                                                                       binary() |
                                                                                       undefined,
                                                                                   causation_id ::
                                                                                       binary() |
                                                                                       undefined,
                                                                                   timestamp ::
                                                                                       timestamp(),
                                                                                   version ::
                                                                                       pos_integer(),
                                                                                   emitter :: atom()},
                                                                individual_id :: individual_id(),
                                                                regulators_added :: non_neg_integer(),
                                                                regulators_removed :: non_neg_integer(),
                                                                network_complexity :: float()}.