agent_environment behaviour (macula_neuroevolution v0.28.0)
View SourceSee also: agent_actuator, agent_bridge, agent_definition, agent_sensor.
Summary
Types
Action command from an actuator. See agent_actuator:action().
Unique identifier for an agent within an episode.
Agent-specific state containing position, energy, etc. See agent_sensor:agent_state().
Configuration passed to init/1. Structure is domain-defined, typically includes: max_ticks, seed, arena_size, etc.
Unique identifier for the environment type. Examples: <<"hex_arena">>, <<"maze">>, <<"open_field">>.
Environment state containing world information. Structure is domain-defined, typically includes: walls, food, tick, max_ticks, etc.
Performance metrics extracted after episode. Used by evaluator for fitness calculation.
Types
-type action() :: map().
Action command from an actuator. See agent_actuator:action().
-type agent_id() :: term().
Unique identifier for an agent within an episode.
-type agent_state() :: map().
Agent-specific state containing position, energy, etc. See agent_sensor:agent_state().
-type env_config() :: map().
Configuration passed to init/1. Structure is domain-defined, typically includes: max_ticks, seed, arena_size, etc.
-type env_name() :: binary().
Unique identifier for the environment type. Examples: <<"hex_arena">>, <<"maze">>, <<"open_field">>.
-type env_state() :: map().
Environment state containing world information. Structure is domain-defined, typically includes: walls, food, tick, max_ticks, etc.
-type metrics() :: map().
Performance metrics extracted after episode. Used by evaluator for fitness calculation.
Callbacks
-callback apply_action(Action, AgentState, EnvState) -> {ok, AgentState, EnvState} when Action :: action(), AgentState :: agent_state(), EnvState :: env_state().
-callback extract_metrics(AgentState, EnvState) -> metrics() when AgentState :: agent_state(), EnvState :: env_state().
-callback init(Config) -> {ok, EnvState} | {error, Reason} when Config :: env_config(), EnvState :: env_state(), Reason :: term().
-callback is_terminal(AgentState, EnvState) -> boolean() when AgentState :: agent_state(), EnvState :: env_state().
-callback name() -> env_name().
-callback spawn_agent(AgentId, EnvState) -> {ok, AgentState, EnvState} | {error, Reason} when AgentId :: agent_id(), EnvState :: env_state(), AgentState :: agent_state(), Reason :: term().
-callback tick(AgentState, EnvState) -> {ok, AgentState, EnvState} when AgentState :: agent_state(), EnvState :: env_state().