Skip to main content

JointEnv

Trait JointEnv 

Source
pub trait JointEnv {
    // Required methods
    fn reset_joint(&mut self, seed: Option<u64>) -> Vec<Vec<f32>>;
    fn step_joint(&mut self, actions: &[Vec<i64>]) -> JointStepResult;
}
Expand description

Minimal joint-environment surface needed by JointMultiAgentTrainer::collect_rollout.

Why a fresh trait instead of crate::multi_agent::environment::MultiAgentEnvironment? The base trait’s step_multi already takes actions: &[Vec<i64>] so it nominally fits, but it also requires a full Environment impl (single-action step, action spaces, snapshot/restore, etc.). The joint trainer only needs reset_joint / step_joint, and adapter envs can implement this trait directly without touching the wider trait hierarchy.

Required Methods§

Source

fn reset_joint(&mut self, seed: Option<u64>) -> Vec<Vec<f32>>

Reset the env in-place. Returns per-agent observations.

Source

fn step_joint(&mut self, actions: &[Vec<i64>]) -> JointStepResult

Step the env with per-agent actions.

actions[i] is the full per-dim action vector for agent i:

  • Length 1 for scalar discrete (e.g. [3]).
  • Length num_dims for multi-discrete (e.g. [house_index, mode]).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl JointEnv for MatchingPennies

Source§

impl JointEnv for NPlayerMatchingPennies

Source§

impl JointEnv for SignalingGame

Thin adapter so the joint PPO trainer can drive the signaling game directly (issue #275, Phase 2). reset_joint / step_joint delegate to the existing MultiAgentEnvironment surface — all message routing is already handled inside SignalingGame::step_multi, so no extra plumbing lives here.