resource_l0_sensors (faber_neuroevolution v1.2.4)

View Source

Resource Silo L0 Sensors - Collects and normalizes sensor inputs for TWEANN.

Part of the Liquid Conglomerate v2 architecture. This module collects raw system metrics and transforms them into normalized inputs for the L0 TWEANN.

Responsibilities

1. Collect raw metrics from resource_monitor and other sources 2. Compute derived metrics (velocities, ratios) 3. Normalize all values to appropriate ranges for TWEANN input 4. Handle cross-silo input signals 5. Maintain state for velocity calculations

Usage

%% Start the sensor collector {ok, Pid} = resource_l0_sensors:start_link(Config),

%% Get current sensor vector (ordered list) SensorVector = resource_l0_sensors:get_sensor_vector(Pid), %% Returns: [0.45, 0.12, 0.33, ...] (13 values)

%% Get sensor map (named values) SensorMap = resource_l0_sensors:get_sensors(Pid), %% Returns: #{memory_pressure => 0.45, memory_velocity => 0.12, ...}

Summary

Functions

Get ordered sensor vector for TWEANN input.

Get ordered sensor vector from specific server.

Get named sensor map.

Get named sensor map from specific server.

Set the realm for event publishing.

Start the sensor collector with default configuration.

Start the sensor collector with custom configuration.

Update archive memory statistics.

Update cross-silo signal from another silo.

Update evaluation metrics from neuroevolution_server.

Functions

get_sensor_vector()

-spec get_sensor_vector() -> [float()].

Get ordered sensor vector for TWEANN input.

Returns a list of 15 float values in the order defined by resource_l0_morphology:sensor_names/0.

get_sensor_vector(Pid)

-spec get_sensor_vector(pid()) -> [float()].

Get ordered sensor vector from specific server.

get_sensors()

-spec get_sensors() -> map().

Get named sensor map.

get_sensors(Pid)

-spec get_sensors(pid()) -> map().

Get named sensor map from specific server.

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

init(Config)

set_realm(Realm)

-spec set_realm(binary()) -> ok.

Set the realm for event publishing.

Use this to dynamically update the realm when a training session starts. Events will be published to the topic for the specified realm.

start_link()

-spec start_link() -> {ok, pid()} | ignore | {error, term()}.

Start the sensor collector with default configuration.

start_link(Config)

-spec start_link(map()) -> {ok, pid()} | ignore | {error, term()}.

Start the sensor collector with custom configuration.

terminate(Reason, State)

update_archive_memory_stats(Stats)

-spec update_archive_memory_stats(map()) -> ok.

Update archive memory statistics.

Expected keys in Stats map: - archive_memory_bytes: Memory used by archive entries - crdt_state_bytes: Memory used by CRDT sync state - total_entries: Number of archive entries

update_cross_silo_signal(SignalName, Value)

-spec update_cross_silo_signal(atom(), float()) -> ok.

Update cross-silo signal from another silo.

update_evaluation_metrics(CurrentConcurrency, Throughput)

-spec update_evaluation_metrics(non_neg_integer(), float()) -> ok.

Update evaluation metrics from neuroevolution_server.