Skip to main content

Module environment

Module environment 

Source
Expand description

Multi-agent environment trait. Multi-agent environment trait.

Extends the base crate::env::Environment trait to support multiple agents interacting in the same game instance, enabling cooperative, competitive, and mixed-motive scenarios.

§Multi-discrete action spaces

This trait supports both pure-discrete and factored (multi-discrete) action spaces. Each agent’s action is a Vec<i64> whose length equals the number of action dimensions for that agent:

  • Pure-discrete agent with n choices: action vector has length 1 (e.g. vec![3] to pick action 3).
  • Factored Bucket-Brigade-style agent with [house_index, mode]: action vector has length 2 (e.g. vec![7, 1] for “house 7, mode 1”).

The per-agent layout is published via MultiAgentEnvironment::agent_action_space.

§Burn migration note

This trait holds no tensor types — it only deals in Vec<f32> host observations and Vec<i64> host actions. The Burn-native crate::multi_agent::joint trainer is the place where Burn tensors enter the picture; the environment surface stays backend-agnostic.

Structs§

MultiAgentResult
Result of a multi-agent environment step.

Traits§

MultiAgentEnvironment
Multi-agent environment trait.