pub trait CommunicatingEnvironment: MultiAgentEnvironment {
// Provided methods
fn message_vocab(&self, _agent_id: AgentId) -> Vec<usize> { ... }
fn message_obs_size(&self, _agent_id: AgentId) -> usize { ... }
fn delivery(&self) -> Delivery { ... }
}Expand description
Opt-in extension of MultiAgentEnvironment for environments that expose a
first-class agent-to-agent message channel.
Every method is defaulted to describe a non-communicating environment, so this is a non-breaking supertrait: existing implementors get a zero-width channel for free and keep compiling unchanged. Comms-aware envs override the methods to publish their message layout.
Provided Methods§
Sourcefn message_vocab(&self, _agent_id: AgentId) -> Vec<usize>
fn message_vocab(&self, _agent_id: AgentId) -> Vec<usize>
Per-agent message action-space layout (one bin count per message dim),
analogous to
MultiAgentEnvironment::agent_action_space. These dims are appended
after the task action dims in each agent’s action vector. An empty vec
means the agent sends nothing.
Sourcefn message_obs_size(&self, _agent_id: AgentId) -> usize
fn message_obs_size(&self, _agent_id: AgentId) -> usize
Number of observation dims that carry received messages for this
agent. Zero means the agent receives nothing. The env is responsible
for placing received messages into the observation vector returned
by get_agent_observation / step_multi (see place_message).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".