lc_distribution_events (faber_neuroevolution v1.2.4)

View Source

Behavioral event constructors for Distribution Silo.

Events related to distributed computing, islands, and load balancing. Distribution Silo operates at timescale τ=60.

Summary

Types

distribution_event/0

-type distribution_event() ::
          #island_created{meta ::
                              #lc_event_meta{event_id :: binary(),
                                             correlation_id :: binary() | undefined,
                                             causation_id :: binary() | undefined,
                                             timestamp :: timestamp(),
                                             version :: pos_integer(),
                                             emitter :: atom()},
                          island_id :: binary(),
                          cluster_id :: binary(),
                          initial_population_size :: non_neg_integer(),
                          compute_capacity :: float(),
                          connected_islands :: [binary()]} |
          #island_destroyed{meta ::
                                #lc_event_meta{event_id :: binary(),
                                               correlation_id :: binary() | undefined,
                                               causation_id :: binary() | undefined,
                                               timestamp :: timestamp(),
                                               version :: pos_integer(),
                                               emitter :: atom()},
                            island_id :: binary(),
                            cluster_id :: binary(),
                            destruction_reason :: consolidation | failure | migration,
                            final_population :: non_neg_integer(),
                            individuals_migrated :: non_neg_integer()} |
          #migration_route_established{meta ::
                                           #lc_event_meta{event_id :: binary(),
                                                          correlation_id :: binary() | undefined,
                                                          causation_id :: binary() | undefined,
                                                          timestamp :: timestamp(),
                                                          version :: pos_integer(),
                                                          emitter :: atom()},
                                       route_id :: binary(),
                                       source_island_id :: binary(),
                                       target_island_id :: binary(),
                                       bandwidth :: float(),
                                       latency_ms :: non_neg_integer()} |
          #migration_route_severed{meta ::
                                       #lc_event_meta{event_id :: binary(),
                                                      correlation_id :: binary() | undefined,
                                                      causation_id :: binary() | undefined,
                                                      timestamp :: timestamp(),
                                                      version :: pos_integer(),
                                                      emitter :: atom()},
                                   route_id :: binary(),
                                   source_island_id :: binary(),
                                   target_island_id :: binary(),
                                   severance_reason :: failure | policy | consolidation} |
          #load_rebalanced{meta ::
                               #lc_event_meta{event_id :: binary(),
                                              correlation_id :: binary() | undefined,
                                              causation_id :: binary() | undefined,
                                              timestamp :: timestamp(),
                                              version :: pos_integer(),
                                              emitter :: atom()},
                           cluster_id :: binary(),
                           load_variance_before :: float(),
                           load_variance_after :: float(),
                           individuals_migrated :: non_neg_integer(),
                           rebalance_strategy :: random | fitness_based | load_based} |
          #topology_updated{meta ::
                                #lc_event_meta{event_id :: binary(),
                                               correlation_id :: binary() | undefined,
                                               causation_id :: binary() | undefined,
                                               timestamp :: timestamp(),
                                               version :: pos_integer(),
                                               emitter :: atom()},
                            cluster_id :: binary(),
                            topology_type :: ring | mesh | star | hierarchical,
                            island_count :: non_neg_integer(),
                            route_count :: non_neg_integer(),
                            diameter :: non_neg_integer()} |
          #node_joined{meta ::
                           #lc_event_meta{event_id :: binary(),
                                          correlation_id :: binary() | undefined,
                                          causation_id :: binary() | undefined,
                                          timestamp :: timestamp(),
                                          version :: pos_integer(),
                                          emitter :: atom()},
                       node_id :: binary(),
                       cluster_id :: binary(),
                       compute_capacity :: float(),
                       assigned_islands :: [binary()]} |
          #node_departed{meta ::
                             #lc_event_meta{event_id :: binary(),
                                            correlation_id :: binary() | undefined,
                                            causation_id :: binary() | undefined,
                                            timestamp :: timestamp(),
                                            version :: pos_integer(),
                                            emitter :: atom()},
                         node_id :: binary(),
                         cluster_id :: binary(),
                         departure_reason :: graceful | failure | eviction,
                         affected_islands :: [binary()],
                         individuals_orphaned :: non_neg_integer()} |
          #synchronization_completed{meta ::
                                         #lc_event_meta{event_id :: binary(),
                                                        correlation_id :: binary() | undefined,
                                                        causation_id :: binary() | undefined,
                                                        timestamp :: timestamp(),
                                                        version :: pos_integer(),
                                                        emitter :: atom()},
                                     cluster_id :: binary(),
                                     islands_synchronized :: [binary()],
                                     sync_duration_ms :: non_neg_integer(),
                                     conflicts_resolved :: non_neg_integer()}.

timestamp/0

-type timestamp() :: integer().

Functions

event_to_map(Event)

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

island_created(Data)

-spec island_created(map()) ->
                        #island_created{meta ::
                                            #lc_event_meta{event_id :: binary(),
                                                           correlation_id :: binary() | undefined,
                                                           causation_id :: binary() | undefined,
                                                           timestamp :: timestamp(),
                                                           version :: pos_integer(),
                                                           emitter :: atom()},
                                        island_id :: binary(),
                                        cluster_id :: binary(),
                                        initial_population_size :: non_neg_integer(),
                                        compute_capacity :: float(),
                                        connected_islands :: [binary()]}.

island_destroyed(Data)

-spec island_destroyed(map()) ->
                          #island_destroyed{meta ::
                                                #lc_event_meta{event_id :: binary(),
                                                               correlation_id :: binary() | undefined,
                                                               causation_id :: binary() | undefined,
                                                               timestamp :: timestamp(),
                                                               version :: pos_integer(),
                                                               emitter :: atom()},
                                            island_id :: binary(),
                                            cluster_id :: binary(),
                                            destruction_reason :: consolidation | failure | migration,
                                            final_population :: non_neg_integer(),
                                            individuals_migrated :: non_neg_integer()}.

load_rebalanced(Data)

-spec load_rebalanced(map()) ->
                         #load_rebalanced{meta ::
                                              #lc_event_meta{event_id :: binary(),
                                                             correlation_id :: binary() | undefined,
                                                             causation_id :: binary() | undefined,
                                                             timestamp :: timestamp(),
                                                             version :: pos_integer(),
                                                             emitter :: atom()},
                                          cluster_id :: binary(),
                                          load_variance_before :: float(),
                                          load_variance_after :: float(),
                                          individuals_migrated :: non_neg_integer(),
                                          rebalance_strategy :: random | fitness_based | load_based}.

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

migration_route_established(Data)

-spec migration_route_established(map()) ->
                                     #migration_route_established{meta ::
                                                                      #lc_event_meta{event_id ::
                                                                                         binary(),
                                                                                     correlation_id ::
                                                                                         binary() |
                                                                                         undefined,
                                                                                     causation_id ::
                                                                                         binary() |
                                                                                         undefined,
                                                                                     timestamp ::
                                                                                         timestamp(),
                                                                                     version ::
                                                                                         pos_integer(),
                                                                                     emitter :: atom()},
                                                                  route_id :: binary(),
                                                                  source_island_id :: binary(),
                                                                  target_island_id :: binary(),
                                                                  bandwidth :: float(),
                                                                  latency_ms :: non_neg_integer()}.

migration_route_severed(Data)

-spec migration_route_severed(map()) ->
                                 #migration_route_severed{meta ::
                                                              #lc_event_meta{event_id :: binary(),
                                                                             correlation_id ::
                                                                                 binary() | undefined,
                                                                             causation_id ::
                                                                                 binary() | undefined,
                                                                             timestamp :: timestamp(),
                                                                             version :: pos_integer(),
                                                                             emitter :: atom()},
                                                          route_id :: binary(),
                                                          source_island_id :: binary(),
                                                          target_island_id :: binary(),
                                                          severance_reason ::
                                                              failure | policy | consolidation}.

node_departed(Data)

-spec node_departed(map()) ->
                       #node_departed{meta ::
                                          #lc_event_meta{event_id :: binary(),
                                                         correlation_id :: binary() | undefined,
                                                         causation_id :: binary() | undefined,
                                                         timestamp :: timestamp(),
                                                         version :: pos_integer(),
                                                         emitter :: atom()},
                                      node_id :: binary(),
                                      cluster_id :: binary(),
                                      departure_reason :: graceful | failure | eviction,
                                      affected_islands :: [binary()],
                                      individuals_orphaned :: non_neg_integer()}.

node_joined(Data)

-spec node_joined(map()) ->
                     #node_joined{meta ::
                                      #lc_event_meta{event_id :: binary(),
                                                     correlation_id :: binary() | undefined,
                                                     causation_id :: binary() | undefined,
                                                     timestamp :: timestamp(),
                                                     version :: pos_integer(),
                                                     emitter :: atom()},
                                  node_id :: binary(),
                                  cluster_id :: binary(),
                                  compute_capacity :: float(),
                                  assigned_islands :: [binary()]}.

synchronization_completed(Data)

-spec synchronization_completed(map()) ->
                                   #synchronization_completed{meta ::
                                                                  #lc_event_meta{event_id :: binary(),
                                                                                 correlation_id ::
                                                                                     binary() |
                                                                                     undefined,
                                                                                 causation_id ::
                                                                                     binary() |
                                                                                     undefined,
                                                                                 timestamp ::
                                                                                     timestamp(),
                                                                                 version ::
                                                                                     pos_integer(),
                                                                                 emitter :: atom()},
                                                              cluster_id :: binary(),
                                                              islands_synchronized :: [binary()],
                                                              sync_duration_ms :: non_neg_integer(),
                                                              conflicts_resolved :: non_neg_integer()}.

topology_updated(Data)

-spec topology_updated(map()) ->
                          #topology_updated{meta ::
                                                #lc_event_meta{event_id :: binary(),
                                                               correlation_id :: binary() | undefined,
                                                               causation_id :: binary() | undefined,
                                                               timestamp :: timestamp(),
                                                               version :: pos_integer(),
                                                               emitter :: atom()},
                                            cluster_id :: binary(),
                                            topology_type :: ring | mesh | star | hierarchical,
                                            island_count :: non_neg_integer(),
                                            route_count :: non_neg_integer(),
                                            diameter :: non_neg_integer()}.