neuroevolution_behavioral_events (macula_neuroevolution v0.29.0)
View SourceBehavioral event constructors for neuroevolution.
This module provides helper functions to construct properly-formed behavioral events. All events include standard metadata and follow the behavioral naming conventions (past tense, domain language).
Usage
Event = neuroevolution_behavioral_events:offspring_born(#{
individual_id => IndId,
parent_ids => [P1, P2],
generation => 42,
species_id => SpeciesId,
population_id => PopId
}),
neuroevolution_lineage_events:persist_event(Event, State).
Summary
Functions
Create activation_changed event.
Create bias_perturbed event.
Create breakthrough_achieved event.
Create champion_crowned event.
Create clone_produced event.
Create connection_added event.
Create connection_removed event.
Create controller_adjusted event.
Create crossover_performed event.
Create evaluation_timeout event.
Convert an event record to a map for serialization.
Create fertility_waned event.
Create fitness_declined event.
Create fitness_evaluated event.
Create fitness_improved event.
Create generation_completed event.
Create immigrant_arrived event.
Create individual_culled event.
Create individual_matured event.
Create individual_perished event.
Create lifespan_expired event.
Create lineage_diverged event.
Create lineage_ended event.
Create event metadata with default values.
Create event metadata with options.
Create mating_occurred event.
Create mutation_applied event.
Create neuron_added event.
Create neuron_removed event.
Create offspring_born event.
Create pioneer_spawned event.
Create population_initialized event.
Create population_terminated event.
Create silo_activated event.
Create silo_deactivated event.
Create species_emerged event.
Create stagnation_detected event.
Generate stream ID for an entity.
Create weight_perturbed event.
Types
-type behavioral_event() :: birth_event() | death_event() | mutation_event() | fitness_event() | generation_event() | species_event() | breeding_event() | lifecycle_event() | controller_event().
-type birth_event() :: #offspring_born{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), parent_ids :: [individual_id()], generation :: generation(), species_id :: species_id(), population_id :: population_id(), genome_hash :: binary(), initial_fitness :: fitness() | undefined} | #pioneer_spawned{meta :: #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(), species_id :: species_id(), generation :: generation(), genome_hash :: binary()} | #clone_produced{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), parent_id :: individual_id(), generation :: generation(), species_id :: species_id(), population_id :: population_id(), mutation_applied :: boolean()} | #immigrant_arrived{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), source_population_id :: population_id(), target_population_id :: population_id(), source_species_id :: species_id(), target_species_id :: species_id(), fitness :: fitness()}.
-type breeding_event() :: #mating_occurred{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, parent_a_id :: individual_id(), parent_b_id :: individual_id(), offspring_ids :: [individual_id()], crossover_method :: atom(), compatibility_distance :: float(), relatedness_coefficient :: float()} | #crossover_performed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, parent_a_id :: individual_id(), parent_b_id :: individual_id(), offspring_id :: individual_id(), crossover_point :: non_neg_integer() | multiple, genes_from_a :: non_neg_integer(), genes_from_b :: non_neg_integer()}.
-type controller_event() :: #controller_adjusted{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, controller_id :: binary(), population_id :: population_id(), adjustments :: #{atom() => float()}, trigger :: stagnation | diversity_crisis | breakthrough | scheduled} | #silo_activated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, silo_type :: atom(), realm :: binary(), config :: map()} | #silo_deactivated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, silo_type :: atom(), realm :: binary(), reason :: manual | dependency_removed | error}.
-type death_event() :: #individual_culled{meta :: #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(), species_id :: species_id(), final_fitness :: fitness(), age_generations :: non_neg_integer(), cause :: selection | stagnation | overcrowding, lineage_depth :: non_neg_integer()} | #lifespan_expired{meta :: #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(), age_generations :: non_neg_integer(), lifecycle_stage :: senescent, peak_fitness :: fitness(), offspring_count :: non_neg_integer()} | #individual_perished{meta :: #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(), cause :: evaluation_crash | simulation_death | timeout, generation :: generation()}.
-type fitness() :: float().
-type fitness_event() :: #fitness_evaluated{meta :: #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(), fitness :: fitness(), fitness_components :: #{atom() => float()}, evaluation_duration_ms :: non_neg_integer(), generation :: generation()} | #fitness_improved{meta :: #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(), previous_fitness :: fitness(), new_fitness :: fitness(), improvement :: float(), generation :: generation()} | #fitness_declined{meta :: #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(), previous_fitness :: fitness(), new_fitness :: fitness(), decline :: float(), generation :: generation()} | #champion_crowned{meta :: #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(), fitness :: fitness(), previous_champion_id :: individual_id() | undefined, previous_champion_fitness :: fitness() | undefined, generation :: generation()} | #evaluation_timeout{meta :: #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(), timeout_ms :: non_neg_integer(), generation :: generation()} | #stagnation_detected{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), generations_stagnant :: non_neg_integer(), best_fitness :: fitness(), generation :: generation()} | #breakthrough_achieved{meta :: #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(), previous_best :: fitness(), new_best :: fitness(), improvement_ratio :: float(), generation :: generation()}.
-type generation() :: non_neg_integer().
-type generation_event() :: #generation_completed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), generation :: generation(), statistics :: #{population_size => non_neg_integer(), species_count => non_neg_integer(), mean_fitness => float(), max_fitness => float(), min_fitness => float(), std_fitness => float(), mean_complexity => float(), diversity_index => float()}, champion_id :: individual_id(), duration_ms :: non_neg_integer()} | #population_initialized{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), initial_size :: non_neg_integer(), config :: map()} | #population_terminated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), final_generation :: generation(), reason :: target_reached | max_generations | manual | error, final_champion_id :: individual_id(), final_champion_fitness :: fitness()}.
-type individual_id() :: binary().
-type lifecycle_event() :: #individual_matured{meta :: #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(), previous_stage :: juvenile, new_stage :: fertile, age_generations :: non_neg_integer(), fitness_at_maturity :: fitness()} | #fertility_waned{meta :: #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(), previous_stage :: fertile, new_stage :: senescent, age_generations :: non_neg_integer(), offspring_count :: non_neg_integer()}.
-type mutation_event() :: #mutation_applied{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), mutation_id :: binary(), mutation_type :: atom(), generation :: generation()} | #neuron_added{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), layer :: input | hidden | output, layer_index :: float(), activation_function :: atom(), bias :: float(), mutation_id :: binary()} | #neuron_removed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), layer :: input | hidden | output, mutation_id :: binary()} | #connection_added{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), from_neuron_id :: binary(), to_neuron_id :: binary(), weight :: float(), mutation_id :: binary()} | #connection_removed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), from_neuron_id :: binary(), to_neuron_id :: binary(), mutation_id :: binary()} | #weight_perturbed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), old_weight :: float(), new_weight :: float(), mutation_id :: binary()} | #bias_perturbed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), old_bias :: float(), new_bias :: float(), mutation_id :: binary()} | #activation_changed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), old_activation :: atom(), new_activation :: atom(), mutation_id :: binary()}.
-type population_id() :: binary().
-type species_event() :: #lineage_diverged{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, new_species_id :: species_id(), parent_species_id :: species_id(), founder_individual_id :: individual_id(), divergence_cause :: structural | behavioral | geographic, compatibility_distance :: float(), generation :: generation()} | #species_emerged{meta :: #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(), founder_id :: individual_id(), generation :: generation()} | #lineage_ended{meta :: #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(), final_generation :: generation(), total_generations :: non_neg_integer(), peak_fitness :: fitness(), total_individuals :: non_neg_integer()}.
-type species_id() :: binary().
-type timestamp() :: integer().
Functions
-spec activation_changed(map()) -> #activation_changed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), old_activation :: atom(), new_activation :: atom(), mutation_id :: binary()}.
Create activation_changed event.
-spec bias_perturbed(map()) -> #bias_perturbed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), old_bias :: float(), new_bias :: float(), mutation_id :: binary()}.
Create bias_perturbed event.
-spec breakthrough_achieved(map()) -> #breakthrough_achieved{meta :: #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(), previous_best :: fitness(), new_best :: fitness(), improvement_ratio :: float(), generation :: generation()}.
Create breakthrough_achieved event.
-spec champion_crowned(map()) -> #champion_crowned{meta :: #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(), fitness :: fitness(), previous_champion_id :: individual_id() | undefined, previous_champion_fitness :: fitness() | undefined, generation :: generation()}.
Create champion_crowned event.
-spec clone_produced(map()) -> #clone_produced{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), parent_id :: individual_id(), generation :: generation(), species_id :: species_id(), population_id :: population_id(), mutation_applied :: boolean()}.
Create clone_produced event.
-spec connection_added(map()) -> #connection_added{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), from_neuron_id :: binary(), to_neuron_id :: binary(), weight :: float(), mutation_id :: binary()}.
Create connection_added event.
-spec connection_removed(map()) -> #connection_removed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), from_neuron_id :: binary(), to_neuron_id :: binary(), mutation_id :: binary()}.
Create connection_removed event.
-spec controller_adjusted(map()) -> #controller_adjusted{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, controller_id :: binary(), population_id :: population_id(), adjustments :: #{atom() => float()}, trigger :: stagnation | diversity_crisis | breakthrough | scheduled}.
Create controller_adjusted event.
-spec crossover_performed(map()) -> #crossover_performed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, parent_a_id :: individual_id(), parent_b_id :: individual_id(), offspring_id :: individual_id(), crossover_point :: non_neg_integer() | multiple, genes_from_a :: non_neg_integer(), genes_from_b :: non_neg_integer()}.
Create crossover_performed event.
-spec evaluation_timeout(map()) -> #evaluation_timeout{meta :: #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(), timeout_ms :: non_neg_integer(), generation :: generation()}.
Create evaluation_timeout event.
-spec event_to_map(behavioral_event()) -> map().
Convert an event record to a map for serialization.
-spec fertility_waned(map()) -> #fertility_waned{meta :: #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(), previous_stage :: fertile, new_stage :: senescent, age_generations :: non_neg_integer(), offspring_count :: non_neg_integer()}.
Create fertility_waned event.
-spec fitness_declined(map()) -> #fitness_declined{meta :: #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(), previous_fitness :: fitness(), new_fitness :: fitness(), decline :: float(), generation :: generation()}.
Create fitness_declined event.
-spec fitness_evaluated(map()) -> #fitness_evaluated{meta :: #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(), fitness :: fitness(), fitness_components :: #{atom() => float()}, evaluation_duration_ms :: non_neg_integer(), generation :: generation()}.
Create fitness_evaluated event.
-spec fitness_improved(map()) -> #fitness_improved{meta :: #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(), previous_fitness :: fitness(), new_fitness :: fitness(), improvement :: float(), generation :: generation()}.
Create fitness_improved event.
-spec generation_completed(map()) -> #generation_completed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), generation :: generation(), statistics :: #{population_size => non_neg_integer(), species_count => non_neg_integer(), mean_fitness => float(), max_fitness => float(), min_fitness => float(), std_fitness => float(), mean_complexity => float(), diversity_index => float()}, champion_id :: individual_id(), duration_ms :: non_neg_integer()}.
Create generation_completed event.
-spec immigrant_arrived(map()) -> #immigrant_arrived{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), source_population_id :: population_id(), target_population_id :: population_id(), source_species_id :: species_id(), target_species_id :: species_id(), fitness :: fitness()}.
Create immigrant_arrived event.
-spec individual_culled(map()) -> #individual_culled{meta :: #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(), species_id :: species_id(), final_fitness :: fitness(), age_generations :: non_neg_integer(), cause :: selection | stagnation | overcrowding, lineage_depth :: non_neg_integer()}.
Create individual_culled event.
-spec individual_matured(map()) -> #individual_matured{meta :: #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(), previous_stage :: juvenile, new_stage :: fertile, age_generations :: non_neg_integer(), fitness_at_maturity :: fitness()}.
Create individual_matured event.
-spec individual_perished(map()) -> #individual_perished{meta :: #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(), cause :: evaluation_crash | simulation_death | timeout, generation :: generation()}.
Create individual_perished event.
-spec lifespan_expired(map()) -> #lifespan_expired{meta :: #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(), age_generations :: non_neg_integer(), lifecycle_stage :: senescent, peak_fitness :: fitness(), offspring_count :: non_neg_integer()}.
Create lifespan_expired event.
-spec lineage_diverged(map()) -> #lineage_diverged{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, new_species_id :: species_id(), parent_species_id :: species_id(), founder_individual_id :: individual_id(), divergence_cause :: structural | behavioral | geographic, compatibility_distance :: float(), generation :: generation()}.
Create lineage_diverged event.
-spec lineage_ended(map()) -> #lineage_ended{meta :: #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(), final_generation :: generation(), total_generations :: non_neg_integer(), peak_fitness :: fitness(), total_individuals :: non_neg_integer()}.
Create lineage_ended event.
-spec make_meta(Emitter :: atom()) -> #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}.
Create event metadata with default values.
-spec make_meta(Emitter :: atom(), Opts :: map()) -> #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}.
Create event metadata with options.
-spec mating_occurred(map()) -> #mating_occurred{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, parent_a_id :: individual_id(), parent_b_id :: individual_id(), offspring_ids :: [individual_id()], crossover_method :: atom(), compatibility_distance :: float(), relatedness_coefficient :: float()}.
Create mating_occurred event.
-spec mutation_applied(map()) -> #mutation_applied{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), mutation_id :: binary(), mutation_type :: atom(), generation :: generation()}.
Create mutation_applied event.
-spec neuron_added(map()) -> #neuron_added{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), layer :: input | hidden | output, layer_index :: float(), activation_function :: atom(), bias :: float(), mutation_id :: binary()}.
Create neuron_added event.
-spec neuron_removed(map()) -> #neuron_removed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), neuron_id :: binary(), layer :: input | hidden | output, mutation_id :: binary()}.
Create neuron_removed event.
-spec offspring_born(map()) -> #offspring_born{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), parent_ids :: [individual_id()], generation :: generation(), species_id :: species_id(), population_id :: population_id(), genome_hash :: binary(), initial_fitness :: fitness() | undefined}.
Create offspring_born event.
-spec pioneer_spawned(map()) -> #pioneer_spawned{meta :: #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(), species_id :: species_id(), generation :: generation(), genome_hash :: binary()}.
Create pioneer_spawned event.
-spec population_initialized(map()) -> #population_initialized{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), initial_size :: non_neg_integer(), config :: map()}.
Create population_initialized event.
-spec population_terminated(map()) -> #population_terminated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), final_generation :: generation(), reason :: target_reached | max_generations | manual | error, final_champion_id :: individual_id(), final_champion_fitness :: fitness()}.
Create population_terminated event.
-spec silo_activated(map()) -> #silo_activated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, silo_type :: atom(), realm :: binary(), config :: map()}.
Create silo_activated event.
-spec silo_deactivated(map()) -> #silo_deactivated{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, silo_type :: atom(), realm :: binary(), reason :: manual | dependency_removed | error}.
Create silo_deactivated event.
-spec species_emerged(map()) -> #species_emerged{meta :: #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(), founder_id :: individual_id(), generation :: generation()}.
Create species_emerged event.
-spec stagnation_detected(map()) -> #stagnation_detected{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, population_id :: population_id(), generations_stagnant :: non_neg_integer(), best_fitness :: fitness(), generation :: generation()}.
Create stagnation_detected event.
Generate stream ID for an entity.
-spec weight_perturbed(map()) -> #weight_perturbed{meta :: #event_meta{event_id :: binary(), correlation_id :: binary() | undefined, causation_id :: binary() | undefined, timestamp :: timestamp(), version :: pos_integer(), emitter :: atom()}, individual_id :: individual_id(), connection_id :: binary(), old_weight :: float(), new_weight :: float(), mutation_id :: binary()}.
Create weight_perturbed event.