lc_economic_events (faber_neuroevolution v1.2.4)

View Source

Behavioral event constructors for Economic Silo.

Events related to compute budgets, resource economics, and wealth. Economic Silo operates at timescale τ=20.

Summary

Types

economic_event/0

-type economic_event() ::
          #budget_allocated{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(),
                            population_id :: population_id(),
                            amount :: float(),
                            allocation_type :: initial | bonus | redistribution} |
          #budget_exhausted{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(),
                            population_id :: population_id(),
                            initial_budget :: float(),
                            expenditure_history :: [float()],
                            exhaustion_cause :: evaluation | mutation | reproduction} |
          #compute_traded{meta ::
                              #lc_event_meta{event_id :: binary(),
                                             correlation_id :: binary() | undefined,
                                             causation_id :: binary() | undefined,
                                             timestamp :: timestamp(),
                                             version :: pos_integer(),
                                             emitter :: atom()},
                          seller_id :: individual_id(),
                          buyer_id :: individual_id(),
                          amount :: float(),
                          price :: float(),
                          trade_reason :: scarcity | opportunity | altruism} |
          #wealth_redistributed{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(),
                                gini_before :: float(),
                                gini_after :: float(),
                                redistribution_amount :: float(),
                                beneficiaries_count :: non_neg_integer(),
                                redistribution_method :: progressive_tax | universal_basic | merit_bonus} |
          #bankruptcy_declared{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(),
                               population_id :: population_id(),
                               final_balance :: float(),
                               debt_amount :: float(),
                               consequence :: removal | bailout | restructure} |
          #investment_made{meta ::
                               #lc_event_meta{event_id :: binary(),
                                              correlation_id :: binary() | undefined,
                                              causation_id :: binary() | undefined,
                                              timestamp :: timestamp(),
                                              version :: pos_integer(),
                                              emitter :: atom()},
                           investor_id :: individual_id(),
                           target_id :: individual_id() | population_id(),
                           amount :: float(),
                           expected_return :: float(),
                           investment_type :: offspring | coalition | exploration} |
          #dividend_distributed{meta ::
                                    #lc_event_meta{event_id :: binary(),
                                                   correlation_id :: binary() | undefined,
                                                   causation_id :: binary() | undefined,
                                                   timestamp :: timestamp(),
                                                   version :: pos_integer(),
                                                   emitter :: atom()},
                                investment_id :: binary(),
                                investor_id :: individual_id(),
                                return_amount :: float(),
                                roi_percentage :: float()} |
          #inflation_adjusted{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(),
                              inflation_rate :: float(),
                              price_level_before :: float(),
                              price_level_after :: float(),
                              adjustment_trigger :: scheduled | market_pressure | policy}.

individual_id/0

-type individual_id() :: binary().

population_id/0

-type population_id() :: binary().

timestamp/0

-type timestamp() :: integer().

Functions

bankruptcy_declared(Data)

-spec bankruptcy_declared(map()) ->
                             #bankruptcy_declared{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(),
                                                  population_id :: population_id(),
                                                  final_balance :: float(),
                                                  debt_amount :: float(),
                                                  consequence :: removal | bailout | restructure}.

budget_allocated(Data)

-spec budget_allocated(map()) ->
                          #budget_allocated{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(),
                                            population_id :: population_id(),
                                            amount :: float(),
                                            allocation_type :: initial | bonus | redistribution}.

budget_exhausted(Data)

-spec budget_exhausted(map()) ->
                          #budget_exhausted{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(),
                                            population_id :: population_id(),
                                            initial_budget :: float(),
                                            expenditure_history :: [float()],
                                            exhaustion_cause :: evaluation | mutation | reproduction}.

compute_traded(Data)

-spec compute_traded(map()) ->
                        #compute_traded{meta ::
                                            #lc_event_meta{event_id :: binary(),
                                                           correlation_id :: binary() | undefined,
                                                           causation_id :: binary() | undefined,
                                                           timestamp :: timestamp(),
                                                           version :: pos_integer(),
                                                           emitter :: atom()},
                                        seller_id :: individual_id(),
                                        buyer_id :: individual_id(),
                                        amount :: float(),
                                        price :: float(),
                                        trade_reason :: scarcity | opportunity | altruism}.

dividend_distributed(Data)

-spec dividend_distributed(map()) ->
                              #dividend_distributed{meta ::
                                                        #lc_event_meta{event_id :: binary(),
                                                                       correlation_id ::
                                                                           binary() | undefined,
                                                                       causation_id ::
                                                                           binary() | undefined,
                                                                       timestamp :: timestamp(),
                                                                       version :: pos_integer(),
                                                                       emitter :: atom()},
                                                    investment_id :: binary(),
                                                    investor_id :: individual_id(),
                                                    return_amount :: float(),
                                                    roi_percentage :: float()}.

event_to_map(Event)

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

inflation_adjusted(Data)

-spec inflation_adjusted(map()) ->
                            #inflation_adjusted{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(),
                                                inflation_rate :: float(),
                                                price_level_before :: float(),
                                                price_level_after :: float(),
                                                adjustment_trigger ::
                                                    scheduled | market_pressure | policy}.

investment_made(Data)

-spec investment_made(map()) ->
                         #investment_made{meta ::
                                              #lc_event_meta{event_id :: binary(),
                                                             correlation_id :: binary() | undefined,
                                                             causation_id :: binary() | undefined,
                                                             timestamp :: timestamp(),
                                                             version :: pos_integer(),
                                                             emitter :: atom()},
                                          investor_id :: individual_id(),
                                          target_id :: individual_id() | population_id(),
                                          amount :: float(),
                                          expected_return :: float(),
                                          investment_type :: offspring | coalition | exploration}.

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

wealth_redistributed(Data)

-spec wealth_redistributed(map()) ->
                              #wealth_redistributed{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(),
                                                    gini_before :: float(),
                                                    gini_after :: float(),
                                                    redistribution_amount :: float(),
                                                    beneficiaries_count :: non_neg_integer(),
                                                    redistribution_method ::
                                                        progressive_tax | universal_basic | merit_bonus}.