From 62bfcb67da5b248f3fb55fb31b496cb89279b46a Mon Sep 17 00:00:00 2001 From: Matteo Bettini Date: Sun, 24 Nov 2024 16:04:50 +0000 Subject: [PATCH] docs --- README.md | 15 ++++++++------- benchmarl/environments/magent/common.py | 18 ++++++++++-------- docs/source/concepts/components.rst | 2 ++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3e515132..aed9635c 100644 --- a/README.md +++ b/README.md @@ -239,13 +239,14 @@ determine the training strategy. Here is a table with the currently implemented challenge to solve. They differ based on many aspects, here is a table with the current environments in BenchMARL -| Environment | Tasks | Cooperation | Global state | Reward function | Action space | Vectorized | -|--------------------------------------------------------------------|--------------------------------------|---------------------------|--------------|-------------------------------|-----------------------|:----------------:| -| [VMAS](https://github.com/proroklab/VectorizedMultiAgentSimulator) | [27](benchmarl/conf/task/vmas) | Cooperative + Competitive | No | Shared + Independent + Global | Continuous + Discrete | Yes | -| [SMACv2](https://github.com/oxwhirl/smacv2) | [15](benchmarl/conf/task/smacv2) | Cooperative | Yes | Global | Discrete | No | -| [MPE](https://github.com/openai/multiagent-particle-envs) | [8](benchmarl/conf/task/pettingzoo) | Cooperative + Competitive | Yes | Shared + Independent | Continuous + Discrete | No | -| [SISL](https://github.com/sisl/MADRL) | [2](benchmarl/conf/task/pettingzoo) | Cooperative | No | Shared | Continuous | No | -| [MeltingPot](https://github.com/google-deepmind/meltingpot) | [49](benchmarl/conf/task/meltingpot) | Cooperative + Competitive | Yes | Independent | Discrete | No | +| Environment | Tasks | Cooperation | Global state | Reward function | Action space | Vectorized | +|---------------------------------------------------------------------|--------------------------------------|---------------------------|--------------|-------------------------------|-----------------------|:----------------:| +| [VMAS](https://github.com/proroklab/VectorizedMultiAgentSimulator) | [27](benchmarl/conf/task/vmas) | Cooperative + Competitive | No | Shared + Independent + Global | Continuous + Discrete | Yes | +| [SMACv2](https://github.com/oxwhirl/smacv2) | [15](benchmarl/conf/task/smacv2) | Cooperative | Yes | Global | Discrete | No | +| [MPE](https://github.com/openai/multiagent-particle-envs) | [8](benchmarl/conf/task/pettingzoo) | Cooperative + Competitive | Yes | Shared + Independent | Continuous + Discrete | No | +| [SISL](https://github.com/sisl/MADRL) | [2](benchmarl/conf/task/pettingzoo) | Cooperative | No | Shared | Continuous | No | +| [MeltingPot](https://github.com/google-deepmind/meltingpot) | [49](benchmarl/conf/task/meltingpot) | Cooperative + Competitive | Yes | Independent | Discrete | No | +| [MAgent2](https://github.com/Farama-Foundation/magent2) | [1](benchmarl/conf/task/magent) | Cooperative + Competitive | Yes | Global in groups | Discrete | No | > [!NOTE] diff --git a/benchmarl/environments/magent/common.py b/benchmarl/environments/magent/common.py index 4ed6ae20..9a3d9ee4 100644 --- a/benchmarl/environments/magent/common.py +++ b/benchmarl/environments/magent/common.py @@ -25,11 +25,11 @@ class MAgentTask(Task): # TIGER_DEER = None def get_env_fun( - self, - num_envs: int, - continuous_actions: bool, - seed: Optional[int], - device: DEVICE_TYPING, + self, + num_envs: int, + continuous_actions: bool, + seed: Optional[int], + device: DEVICE_TYPING, ) -> Callable[[], EnvBase]: return lambda: PettingZooWrapper( @@ -38,7 +38,7 @@ def get_env_fun( seed=seed, done_on_any=False, use_mask=False, - device=device + device=device, ) def __get_env(self) -> EnvBase: @@ -51,8 +51,10 @@ def __get_env(self) -> EnvBase: # gather_v5, # tiger_deer_v4 ) - except ImportError as e: - raise ImportError("Module `magent2` not found, install it using `pip install magent2`") + except ImportError: + raise ImportError( + "Module `magent2` not found, install it using `pip install magent2`" + ) envs = { "ADVERSARIAL_PURSUIT": adversarial_pursuit_v4, diff --git a/docs/source/concepts/components.rst b/docs/source/concepts/components.rst index 4c718abb..cb8903d0 100644 --- a/docs/source/concepts/components.rst +++ b/docs/source/concepts/components.rst @@ -91,6 +91,8 @@ They differ based on many aspects, here is a table with the current environments +-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+ | :class:`~benchmarl.environments.MeltingPotTask` | 49 | Cooperative + Competitive | Yes | Independent | Discrete | No | +-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+ + | :class:`~benchmarl.environments.MAgentTask` | 1 | Cooperative + Competitive | Yes | Global in groups | Discrete | No | + +-------------------------------------------------+-------+---------------------------+--------------+-------------------------------+-----------------------+------------+