lc_cultural_events (faber_neuroevolution v1.2.4)

View Source

Behavioral event constructors for Cultural Silo.

Events related to behavioral innovations, traditions, and memes. Cultural Silo operates at timescale τ=35.

Summary

Types

cultural_event/0

-type cultural_event() ::
          #innovation_discovered{meta ::
                                     #lc_event_meta{event_id :: binary(),
                                                    correlation_id :: binary() | undefined,
                                                    causation_id :: binary() | undefined,
                                                    timestamp :: timestamp(),
                                                    version :: pos_integer(),
                                                    emitter :: atom()},
                                 innovator_id :: individual_id(),
                                 innovation_id :: binary(),
                                 population_id :: population_id(),
                                 novelty_score :: float(),
                                 fitness_advantage :: float(),
                                 innovation_type :: behavioral | structural | strategic} |
          #innovation_spread{meta ::
                                 #lc_event_meta{event_id :: binary(),
                                                correlation_id :: binary() | undefined,
                                                causation_id :: binary() | undefined,
                                                timestamp :: timestamp(),
                                                version :: pos_integer(),
                                                emitter :: atom()},
                             innovation_id :: binary(),
                             source_id :: individual_id(),
                             adopter_id :: individual_id(),
                             spread_fidelity :: float(),
                             total_adopters :: non_neg_integer()} |
          #tradition_established{meta ::
                                     #lc_event_meta{event_id :: binary(),
                                                    correlation_id :: binary() | undefined,
                                                    causation_id :: binary() | undefined,
                                                    timestamp :: timestamp(),
                                                    version :: pos_integer(),
                                                    emitter :: atom()},
                                 tradition_id :: binary(),
                                 population_id :: population_id(),
                                 behavior_signature :: binary(),
                                 initial_practitioners :: non_neg_integer(),
                                 establishment_threshold :: non_neg_integer()} |
          #tradition_abandoned{meta ::
                                   #lc_event_meta{event_id :: binary(),
                                                  correlation_id :: binary() | undefined,
                                                  causation_id :: binary() | undefined,
                                                  timestamp :: timestamp(),
                                                  version :: pos_integer(),
                                                  emitter :: atom()},
                               tradition_id :: binary(),
                               population_id :: population_id(),
                               abandonment_reason :: obsolescence | competition | drift,
                               final_practitioners :: non_neg_integer(),
                               duration_generations :: non_neg_integer()} |
          #meme_created{meta ::
                            #lc_event_meta{event_id :: binary(),
                                           correlation_id :: binary() | undefined,
                                           causation_id :: binary() | undefined,
                                           timestamp :: timestamp(),
                                           version :: pos_integer(),
                                           emitter :: atom()},
                        meme_id :: binary(),
                        creator_id :: individual_id(),
                        population_id :: population_id(),
                        meme_encoding :: term(),
                        initial_fitness_correlation :: float()} |
          #meme_spread{meta ::
                           #lc_event_meta{event_id :: binary(),
                                          correlation_id :: binary() | undefined,
                                          causation_id :: binary() | undefined,
                                          timestamp :: timestamp(),
                                          version :: pos_integer(),
                                          emitter :: atom()},
                       meme_id :: binary(),
                       source_id :: individual_id(),
                       target_id :: individual_id(),
                       spread_fidelity :: float(),
                       fitness_correlation :: float(),
                       total_adopters :: non_neg_integer()} |
          #meme_mutated{meta ::
                            #lc_event_meta{event_id :: binary(),
                                           correlation_id :: binary() | undefined,
                                           causation_id :: binary() | undefined,
                                           timestamp :: timestamp(),
                                           version :: pos_integer(),
                                           emitter :: atom()},
                        original_meme_id :: binary(),
                        mutated_meme_id :: binary(),
                        mutator_id :: individual_id(),
                        mutation_magnitude :: float(),
                        fitness_change :: float()} |
          #cultural_convergence{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(),
                                behavioral_variance_before :: float(),
                                behavioral_variance_after :: float(),
                                convergence_driver :: selection | imitation | drift} |
          #cultural_divergence{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(),
                               behavioral_variance_before :: float(),
                               behavioral_variance_after :: float(),
                               divergence_driver :: exploration | speciation | isolation}.

individual_id/0

-type individual_id() :: binary().

population_id/0

-type population_id() :: binary().

timestamp/0

-type timestamp() :: integer().

Functions

cultural_convergence(Data)

-spec cultural_convergence(map()) ->
                              #cultural_convergence{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(),
                                                    behavioral_variance_before :: float(),
                                                    behavioral_variance_after :: float(),
                                                    convergence_driver :: selection | imitation | drift}.

cultural_divergence(Data)

-spec cultural_divergence(map()) ->
                             #cultural_divergence{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(),
                                                  behavioral_variance_before :: float(),
                                                  behavioral_variance_after :: float(),
                                                  divergence_driver ::
                                                      exploration | speciation | isolation}.

event_to_map(Event)

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

innovation_discovered(Data)

-spec innovation_discovered(map()) ->
                               #innovation_discovered{meta ::
                                                          #lc_event_meta{event_id :: binary(),
                                                                         correlation_id ::
                                                                             binary() | undefined,
                                                                         causation_id ::
                                                                             binary() | undefined,
                                                                         timestamp :: timestamp(),
                                                                         version :: pos_integer(),
                                                                         emitter :: atom()},
                                                      innovator_id :: individual_id(),
                                                      innovation_id :: binary(),
                                                      population_id :: population_id(),
                                                      novelty_score :: float(),
                                                      fitness_advantage :: float(),
                                                      innovation_type ::
                                                          behavioral | structural | strategic}.

innovation_spread(Data)

-spec innovation_spread(map()) ->
                           #innovation_spread{meta ::
                                                  #lc_event_meta{event_id :: binary(),
                                                                 correlation_id :: binary() | undefined,
                                                                 causation_id :: binary() | undefined,
                                                                 timestamp :: timestamp(),
                                                                 version :: pos_integer(),
                                                                 emitter :: atom()},
                                              innovation_id :: binary(),
                                              source_id :: individual_id(),
                                              adopter_id :: individual_id(),
                                              spread_fidelity :: float(),
                                              total_adopters :: 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()}.

meme_created(Data)

-spec meme_created(map()) ->
                      #meme_created{meta ::
                                        #lc_event_meta{event_id :: binary(),
                                                       correlation_id :: binary() | undefined,
                                                       causation_id :: binary() | undefined,
                                                       timestamp :: timestamp(),
                                                       version :: pos_integer(),
                                                       emitter :: atom()},
                                    meme_id :: binary(),
                                    creator_id :: individual_id(),
                                    population_id :: population_id(),
                                    meme_encoding :: term(),
                                    initial_fitness_correlation :: float()}.

meme_mutated(Data)

-spec meme_mutated(map()) ->
                      #meme_mutated{meta ::
                                        #lc_event_meta{event_id :: binary(),
                                                       correlation_id :: binary() | undefined,
                                                       causation_id :: binary() | undefined,
                                                       timestamp :: timestamp(),
                                                       version :: pos_integer(),
                                                       emitter :: atom()},
                                    original_meme_id :: binary(),
                                    mutated_meme_id :: binary(),
                                    mutator_id :: individual_id(),
                                    mutation_magnitude :: float(),
                                    fitness_change :: float()}.

meme_spread(Data)

-spec meme_spread(map()) ->
                     #meme_spread{meta ::
                                      #lc_event_meta{event_id :: binary(),
                                                     correlation_id :: binary() | undefined,
                                                     causation_id :: binary() | undefined,
                                                     timestamp :: timestamp(),
                                                     version :: pos_integer(),
                                                     emitter :: atom()},
                                  meme_id :: binary(),
                                  source_id :: individual_id(),
                                  target_id :: individual_id(),
                                  spread_fidelity :: float(),
                                  fitness_correlation :: float(),
                                  total_adopters :: non_neg_integer()}.

tradition_abandoned(Data)

-spec tradition_abandoned(map()) ->
                             #tradition_abandoned{meta ::
                                                      #lc_event_meta{event_id :: binary(),
                                                                     correlation_id ::
                                                                         binary() | undefined,
                                                                     causation_id ::
                                                                         binary() | undefined,
                                                                     timestamp :: timestamp(),
                                                                     version :: pos_integer(),
                                                                     emitter :: atom()},
                                                  tradition_id :: binary(),
                                                  population_id :: population_id(),
                                                  abandonment_reason ::
                                                      obsolescence | competition | drift,
                                                  final_practitioners :: non_neg_integer(),
                                                  duration_generations :: non_neg_integer()}.

tradition_established(Data)

-spec tradition_established(map()) ->
                               #tradition_established{meta ::
                                                          #lc_event_meta{event_id :: binary(),
                                                                         correlation_id ::
                                                                             binary() | undefined,
                                                                         causation_id ::
                                                                             binary() | undefined,
                                                                         timestamp :: timestamp(),
                                                                         version :: pos_integer(),
                                                                         emitter :: atom()},
                                                      tradition_id :: binary(),
                                                      population_id :: population_id(),
                                                      behavior_signature :: binary(),
                                                      initial_practitioners :: non_neg_integer(),
                                                      establishment_threshold :: non_neg_integer()}.