lc_competitive_events (faber_neuroevolution v1.2.4)
View SourceBehavioral event constructors for Competitive Silo.
Events related to Elo ratings, opponent archives, and matchmaking. Competitive Silo operates at timescale τ=15.
Summary
Types
-type competitive_event() :: #opponent_archived{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, opponent_id :: individual_id(), archive_id :: binary(), fitness_at_archive :: float(), elo_at_archive :: float(), generation :: generation(), archive_size_after :: non_neg_integer()} | #opponent_retired{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, opponent_id :: individual_id(), archive_id :: binary(), retirement_reason :: age | performance | diversity, games_played :: non_neg_integer(), final_elo :: float()} | #match_completed{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, match_id :: binary(), player_a_id :: individual_id(), player_b_id :: individual_id(), winner_id :: individual_id() | draw, player_a_elo_before :: float(), player_b_elo_before :: float(), player_a_elo_after :: float(), player_b_elo_after :: float(), match_duration_ms :: non_neg_integer()} | #elo_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(), elo_before :: float(), elo_after :: float(), k_factor :: float(), match_result :: win | loss | draw} | #strategy_countered{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, counter_id :: individual_id(), countered_id :: individual_id(), win_rate_against :: float(), strategy_signature :: binary(), generation :: generation()} | #arms_race_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(), cycle_length :: non_neg_integer(), participants :: [individual_id()], intensity :: float(), generation :: generation()} | #matchmaking_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(), elo_range_before :: float(), elo_range_after :: float(), self_play_ratio_before :: float(), self_play_ratio_after :: float(), adjustment_reason :: diversity | exploitation | exploration} | #dominance_matrix_updated{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(), matrix_size :: non_neg_integer(), strongest_counter :: {individual_id(), individual_id(), float()}, cycle_detected :: boolean(), update_generation :: generation()}.
-type generation() :: non_neg_integer().
-type individual_id() :: binary().
-type population_id() :: binary().
-type timestamp() :: integer().
Functions
-spec arms_race_detected(map()) -> #arms_race_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(), cycle_length :: non_neg_integer(), participants :: [individual_id()], intensity :: float(), generation :: generation()}.
-spec dominance_matrix_updated(map()) -> #dominance_matrix_updated{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(), matrix_size :: non_neg_integer(), strongest_counter :: {individual_id(), individual_id(), float()}, cycle_detected :: boolean(), update_generation :: generation()}.
-spec elo_updated(map()) -> #elo_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(), elo_before :: float(), elo_after :: float(), k_factor :: float(), match_result :: win | loss | draw}.
-spec event_to_map(competitive_event()) -> map().
-spec match_completed(map()) -> #match_completed{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, match_id :: binary(), player_a_id :: individual_id(), player_b_id :: individual_id(), winner_id :: individual_id() | draw, player_a_elo_before :: float(), player_b_elo_before :: float(), player_a_elo_after :: float(), player_b_elo_after :: float(), match_duration_ms :: non_neg_integer()}.
-spec matchmaking_adjusted(map()) -> #matchmaking_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(), elo_range_before :: float(), elo_range_after :: float(), self_play_ratio_before :: float(), self_play_ratio_after :: float(), adjustment_reason :: diversity | exploitation | exploration}.
-spec opponent_archived(map()) -> #opponent_archived{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, opponent_id :: individual_id(), archive_id :: binary(), fitness_at_archive :: float(), elo_at_archive :: float(), generation :: generation(), archive_size_after :: non_neg_integer()}.
-spec opponent_retired(map()) -> #opponent_retired{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, opponent_id :: individual_id(), archive_id :: binary(), retirement_reason :: age | performance | diversity, games_played :: non_neg_integer(), final_elo :: float()}.
-spec strategy_countered(map()) -> #strategy_countered{meta :: #lc_event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, counter_id :: individual_id(), countered_id :: individual_id(), win_rate_against :: float(), strategy_signature :: binary(), generation :: generation()}.