agent_sensor behaviour (macula_neuroevolution v0.28.0)
View SourceSee also: agent_actuator, agent_bridge, agent_definition.
Summary
Types
Agent-specific state containing position, energy, etc. Structure is domain-defined.
Environment state containing world information. Structure is domain-defined.
Number of neural network input nodes this sensor provides. Must be positive (at least 1 input).
Unique identifier for the sensor type within an agent. Examples: <<"vision">>, <<"hearing">>, <<"energy">>.
List of sensor readings, length must match input_count/0. Values should be normalized to [0.0, 1.0] range.
Types
-type agent_state() :: map().
Agent-specific state containing position, energy, etc. Structure is domain-defined.
-type env_state() :: map().
Environment state containing world information. Structure is domain-defined.
-type input_count() :: pos_integer().
Number of neural network input nodes this sensor provides. Must be positive (at least 1 input).
-type sensor_name() :: binary().
Unique identifier for the sensor type within an agent. Examples: <<"vision">>, <<"hearing">>, <<"energy">>.
-type sensor_values() :: [float()].
List of sensor readings, length must match input_count/0. Values should be normalized to [0.0, 1.0] range.
Callbacks
-callback input_count() -> input_count().
-callback name() -> sensor_name().
-callback read(AgentState, EnvState) -> sensor_values() when AgentState :: agent_state(), EnvState :: env_state().
Functions
-spec get_info(Module) -> {ok, Info} | {error, Reason} when Module :: module(), Info :: #{name := sensor_name(), input_count := input_count()}, Reason :: term().
-spec validate_values(Module, Values) -> ok | {error, Reason} when Module :: module(), Values :: sensor_values(), Reason :: term().