agent_actuator behaviour (macula_neuroevolution v0.28.0)
View SourceSee also: agent_bridge, agent_definition, agent_sensor.
Summary
Types
Action command produced by the actuator. Structure is domain-defined, typically includes: #{type => atom(), ...action_specific_fields}.
Unique identifier for the actuator type within an agent. Examples: <<"movement">>, <<"signal">>, <<"eat">>.
Agent-specific state. See agent_sensor:agent_state().
Environment state. See agent_sensor:env_state().
Number of neural network output nodes this actuator consumes. Must be positive (at least 1 output).
List of neural network outputs to interpret. Length must match output_count/0.
Types
-type action() :: map().
Action command produced by the actuator. Structure is domain-defined, typically includes: #{type => atom(), ...action_specific_fields}.
-type actuator_name() :: binary().
Unique identifier for the actuator type within an agent. Examples: <<"movement">>, <<"signal">>, <<"eat">>.
-type agent_state() :: map().
Agent-specific state. See agent_sensor:agent_state().
-type env_state() :: map().
Environment state. See agent_sensor:env_state().
-type output_count() :: pos_integer().
Number of neural network output nodes this actuator consumes. Must be positive (at least 1 output).
-type output_values() :: [float()].
List of neural network outputs to interpret. Length must match output_count/0.
Callbacks
-callback act(Outputs, AgentState, EnvState) -> {ok, Action} | {error, Reason} when Outputs :: output_values(), AgentState :: agent_state(), EnvState :: env_state(), Action :: action(), Reason :: term().
-callback name() -> actuator_name().
-callback output_count() -> output_count().
Functions
-spec get_info(Module) -> {ok, Info} | {error, Reason} when Module :: module(), Info :: #{name := actuator_name(), output_count := output_count()}, Reason :: term().
-spec validate_outputs(Module, Outputs) -> ok | {error, Reason} when Module :: module(), Outputs :: output_values(), Reason :: term().