lc_ecological_events (faber_neuroevolution v1.2.4)

View Source

Behavioral event constructors for Ecological Silo.

Events related to niches, environmental stress, and carrying capacity. Ecological Silo operates at timescale τ=50.

Summary

Types

ecological_event/0

-type ecological_event() ::
          #niche_occupied{meta ::
                              #lc_event_meta{event_id :: binary(),
                                             correlation_id :: binary() | undefined,
                                             causation_id :: binary() | undefined,
                                             timestamp :: timestamp(),
                                             version :: pos_integer(),
                                             emitter :: atom()},
                          niche_id :: binary(),
                          occupant_id :: individual_id(),
                          population_id :: population_id(),
                          niche_fitness_range :: {float(), float()},
                          competition_level :: float()} |
          #niche_vacated{meta ::
                             #lc_event_meta{event_id :: binary(),
                                            correlation_id :: binary() | undefined,
                                            causation_id :: binary() | undefined,
                                            timestamp :: timestamp(),
                                            version :: pos_integer(),
                                            emitter :: atom()},
                         niche_id :: binary(),
                         vacating_id :: individual_id() | undefined,
                         population_id :: population_id(),
                         vacation_reason :: extinction | migration | outcompeted} |
          #stress_applied{meta ::
                              #lc_event_meta{event_id :: binary(),
                                             correlation_id :: binary() | undefined,
                                             causation_id :: binary() | undefined,
                                             timestamp :: timestamp(),
                                             version :: pos_integer(),
                                             emitter :: atom()},
                          population_id :: population_id(),
                          stress_type :: resource | environmental | competitive | random,
                          stress_intensity :: float(),
                          affected_individuals :: non_neg_integer(),
                          expected_duration :: non_neg_integer() | indefinite} |
          #stress_relieved{meta ::
                               #lc_event_meta{event_id :: binary(),
                                              correlation_id :: binary() | undefined,
                                              causation_id :: binary() | undefined,
                                              timestamp :: timestamp(),
                                              version :: pos_integer(),
                                              emitter :: atom()},
                           population_id :: population_id(),
                           stress_type :: resource | environmental | competitive | random,
                           previous_intensity :: float(),
                           relief_cause :: adaptation | environment_change | intervention} |
          #carrying_capacity_changed{meta ::
                                         #lc_event_meta{event_id :: binary(),
                                                        correlation_id :: binary() | undefined,
                                                        causation_id :: binary() | undefined,
                                                        timestamp :: timestamp(),
                                                        version :: pos_integer(),
                                                        emitter :: atom()},
                                     population_id :: population_id(),
                                     capacity_before :: non_neg_integer(),
                                     capacity_after :: non_neg_integer(),
                                     change_cause :: resource_availability | environmental | policy} |
          #resource_scarcity_detected{meta ::
                                          #lc_event_meta{event_id :: binary(),
                                                         correlation_id :: binary() | undefined,
                                                         causation_id :: binary() | undefined,
                                                         timestamp :: timestamp(),
                                                         version :: pos_integer(),
                                                         emitter :: atom()},
                                      population_id :: population_id(),
                                      resource_type :: compute | memory | evaluation_time,
                                      availability :: float(),
                                      threshold :: float(),
                                      affected_ratio :: float()} |
          #resource_abundance_detected{meta ::
                                           #lc_event_meta{event_id :: binary(),
                                                          correlation_id :: binary() | undefined,
                                                          causation_id :: binary() | undefined,
                                                          timestamp :: timestamp(),
                                                          version :: pos_integer(),
                                                          emitter :: atom()},
                                       population_id :: population_id(),
                                       resource_type :: compute | memory | evaluation_time,
                                       availability :: float(),
                                       surplus_ratio :: float()} |
          #extinction_risk_elevated{meta ::
                                        #lc_event_meta{event_id :: binary(),
                                                       correlation_id :: binary() | undefined,
                                                       causation_id :: binary() | undefined,
                                                       timestamp :: timestamp(),
                                                       version :: pos_integer(),
                                                       emitter :: atom()},
                                    species_id :: species_id(),
                                    population_id :: population_id(),
                                    risk_level :: float(),
                                    risk_factors :: [atom()],
                                    population_size :: non_neg_integer()} |
          #ecosystem_disrupted{meta ::
                                   #lc_event_meta{event_id :: binary(),
                                                  correlation_id :: binary() | undefined,
                                                  causation_id :: binary() | undefined,
                                                  timestamp :: timestamp(),
                                                  version :: pos_integer(),
                                                  emitter :: atom()},
                               population_id :: population_id(),
                               disruption_type :: catastrophe | invasion | collapse,
                               disruption_severity :: float(),
                               species_affected :: non_neg_integer(),
                               recovery_estimate_generations :: non_neg_integer()}.

individual_id/0

-type individual_id() :: binary().

population_id/0

-type population_id() :: binary().

species_id/0

-type species_id() :: binary().

timestamp/0

-type timestamp() :: integer().

Functions

carrying_capacity_changed(Data)

-spec carrying_capacity_changed(map()) ->
                                   #carrying_capacity_changed{meta ::
                                                                  #lc_event_meta{event_id :: binary(),
                                                                                 correlation_id ::
                                                                                     binary() |
                                                                                     undefined,
                                                                                 causation_id ::
                                                                                     binary() |
                                                                                     undefined,
                                                                                 timestamp ::
                                                                                     timestamp(),
                                                                                 version ::
                                                                                     pos_integer(),
                                                                                 emitter :: atom()},
                                                              population_id :: population_id(),
                                                              capacity_before :: non_neg_integer(),
                                                              capacity_after :: non_neg_integer(),
                                                              change_cause ::
                                                                  resource_availability |
                                                                  environmental | policy}.

ecosystem_disrupted(Data)

-spec ecosystem_disrupted(map()) ->
                             #ecosystem_disrupted{meta ::
                                                      #lc_event_meta{event_id :: binary(),
                                                                     correlation_id ::
                                                                         binary() | undefined,
                                                                     causation_id ::
                                                                         binary() | undefined,
                                                                     timestamp :: timestamp(),
                                                                     version :: pos_integer(),
                                                                     emitter :: atom()},
                                                  population_id :: population_id(),
                                                  disruption_type :: catastrophe | invasion | collapse,
                                                  disruption_severity :: float(),
                                                  species_affected :: non_neg_integer(),
                                                  recovery_estimate_generations :: non_neg_integer()}.

event_to_map(Event)

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

extinction_risk_elevated(Data)

-spec extinction_risk_elevated(map()) ->
                                  #extinction_risk_elevated{meta ::
                                                                #lc_event_meta{event_id :: binary(),
                                                                               correlation_id ::
                                                                                   binary() | undefined,
                                                                               causation_id ::
                                                                                   binary() | undefined,
                                                                               timestamp :: timestamp(),
                                                                               version :: pos_integer(),
                                                                               emitter :: atom()},
                                                            species_id :: species_id(),
                                                            population_id :: population_id(),
                                                            risk_level :: float(),
                                                            risk_factors :: [atom()],
                                                            population_size :: non_neg_integer()}.

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()}.

niche_occupied(Data)

-spec niche_occupied(map()) ->
                        #niche_occupied{meta ::
                                            #lc_event_meta{event_id :: binary(),
                                                           correlation_id :: binary() | undefined,
                                                           causation_id :: binary() | undefined,
                                                           timestamp :: timestamp(),
                                                           version :: pos_integer(),
                                                           emitter :: atom()},
                                        niche_id :: binary(),
                                        occupant_id :: individual_id(),
                                        population_id :: population_id(),
                                        niche_fitness_range :: {float(), float()},
                                        competition_level :: float()}.

niche_vacated(Data)

-spec niche_vacated(map()) ->
                       #niche_vacated{meta ::
                                          #lc_event_meta{event_id :: binary(),
                                                         correlation_id :: binary() | undefined,
                                                         causation_id :: binary() | undefined,
                                                         timestamp :: timestamp(),
                                                         version :: pos_integer(),
                                                         emitter :: atom()},
                                      niche_id :: binary(),
                                      vacating_id :: individual_id() | undefined,
                                      population_id :: population_id(),
                                      vacation_reason :: extinction | migration | outcompeted}.

resource_abundance_detected(Data)

-spec resource_abundance_detected(map()) ->
                                     #resource_abundance_detected{meta ::
                                                                      #lc_event_meta{event_id ::
                                                                                         binary(),
                                                                                     correlation_id ::
                                                                                         binary() |
                                                                                         undefined,
                                                                                     causation_id ::
                                                                                         binary() |
                                                                                         undefined,
                                                                                     timestamp ::
                                                                                         timestamp(),
                                                                                     version ::
                                                                                         pos_integer(),
                                                                                     emitter :: atom()},
                                                                  population_id :: population_id(),
                                                                  resource_type ::
                                                                      compute | memory | evaluation_time,
                                                                  availability :: float(),
                                                                  surplus_ratio :: float()}.

resource_scarcity_detected(Data)

-spec resource_scarcity_detected(map()) ->
                                    #resource_scarcity_detected{meta ::
                                                                    #lc_event_meta{event_id :: binary(),
                                                                                   correlation_id ::
                                                                                       binary() |
                                                                                       undefined,
                                                                                   causation_id ::
                                                                                       binary() |
                                                                                       undefined,
                                                                                   timestamp ::
                                                                                       timestamp(),
                                                                                   version ::
                                                                                       pos_integer(),
                                                                                   emitter :: atom()},
                                                                population_id :: population_id(),
                                                                resource_type ::
                                                                    compute | memory | evaluation_time,
                                                                availability :: float(),
                                                                threshold :: float(),
                                                                affected_ratio :: float()}.

stress_applied(Data)

-spec stress_applied(map()) ->
                        #stress_applied{meta ::
                                            #lc_event_meta{event_id :: binary(),
                                                           correlation_id :: binary() | undefined,
                                                           causation_id :: binary() | undefined,
                                                           timestamp :: timestamp(),
                                                           version :: pos_integer(),
                                                           emitter :: atom()},
                                        population_id :: population_id(),
                                        stress_type :: resource | environmental | competitive | random,
                                        stress_intensity :: float(),
                                        affected_individuals :: non_neg_integer(),
                                        expected_duration :: non_neg_integer() | indefinite}.

stress_relieved(Data)

-spec stress_relieved(map()) ->
                         #stress_relieved{meta ::
                                              #lc_event_meta{event_id :: binary(),
                                                             correlation_id :: binary() | undefined,
                                                             causation_id :: binary() | undefined,
                                                             timestamp :: timestamp(),
                                                             version :: pos_integer(),
                                                             emitter :: atom()},
                                          population_id :: population_id(),
                                          stress_type :: resource | environmental | competitive | random,
                                          previous_intensity :: float(),
                                          relief_cause :: adaptation | environment_change | intervention}.