Skip to content

Commit

Permalink
Merge branch 'master' into agilerl-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepratt1 authored Dec 4, 2024
2 parents 9ae9b6a + 00cb35c commit 07a8223
Show file tree
Hide file tree
Showing 65 changed files with 1,183 additions and 878 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- os: ubuntu-latest
python: 311
platform: manylinux_x86_64
- os: ubuntu-latest
python: 312
platform: manylinux_x86_64

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux-tutorials-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false

matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
tutorial: [Tianshou, CustomEnvironment, CleanRL, SB3/kaz, SB3/waterworld, SB3/connect_four, SB3/test] # TODO: fix tutorials and add back Ray

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
# Big Sur, Monterey
os: [macos-11, macos-12]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ SuperSuit is a library that includes all commonly used wrappers in RL (frame sta

PettingZoo keeps strict versioning for reproducibility reasons. All environments end in a suffix like "\_v0". When changes are made to environments that might impact learning results, the number is increased by one to prevent potential confusion.

## Project Maintainers
Project Manager: [Elliot Tower](https://github.com/elliottower/)

Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).

## Citation

To cite this project in publication, please use
Expand All @@ -92,3 +87,6 @@ To cite this project in publication, please use
year={2021}
}
```
## Project Maintainers
- Project Manager: [David Gerard](https://github.com/David-GERARD) - `[email protected]`.
- Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).
4 changes: 2 additions & 2 deletions docs/api/aec.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ The [_Agent Environment Cycle_](https://arxiv.org/abs/2009.13051) (AEC) model wa

In an AEC environment, agents act sequentially, receiving updated observations and rewards before taking an action. The environment updates after each agent's step, making it a natural way of representing sequential games such as Chess. The AEC model is flexible enough to handle any type of game that multi-agent RL can consider.

with the underlying environment updating after each agent's step. Agents receive updated observations and rewards at the beginning of their . The environment is updated after every step,
This is a natural way of representing sequential games such as Chess, and
with the underlying environment updating after each agent's step. Agents receive updated observations and rewards at the beginning of their turn. The environment is updated after every step,
This is a natural way of representing sequential games such as Chess and Go.

```{figure} /_static/img/aec_cycle_figure.png
:width: 480px
Expand Down
2 changes: 1 addition & 1 deletion docs/api/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Base class which is used by [CaptureStdoutWrapper](https://pettingzoo.farama.org

The agent selector utility allows for easy cycling of agents in an AEC environment. At any time it can be reset or reinitialized with a new order, allowing for changes in turn order or handling a dynamic number of agents (see [Knights-Archers-Zombies](https://pettingzoo.farama.org/environments/butterfly/knights_archers_zombies/) for an example of spawning/killing agents)

Note: while many PettingZoo environments use agent_selector to manage agent cycling internally, it is not intended to be used externally when interacting with an environment. Instead, use `for agent in env.agent_iter()` (see [AEC API Usage](https://pettingzoo.farama.org/api/aec/#usage)).
Note: while many PettingZoo environments use AgentSelector to manage agent cycling internally, it is not intended to be used externally when interacting with an environment. Instead, use `for agent in env.agent_iter()` (see [AEC API Usage](https://pettingzoo.farama.org/api/aec/#usage)).

```{eval-rst}
.. currentmodule:: pettingzoo.utils
Expand Down
6 changes: 3 additions & 3 deletions docs/code_examples/aec_rps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from gymnasium.spaces import Discrete

from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector, wrappers
from pettingzoo.utils import AgentSelector, wrappers

ROCK = 0
PAPER = 1
Expand Down Expand Up @@ -156,9 +156,9 @@ def reset(self, seed=None, options=None):
self.observations = {agent: NONE for agent in self.agents}
self.num_moves = 0
"""
Our agent_selector utility allows easy cyclic stepping through the agents list.
Our AgentSelector utility allows easy cyclic stepping through the agents list.
"""
self._agent_selector = agent_selector(self.agents)
self._agent_selector = AgentSelector(self.agents)
self.agent_selection = self._agent_selector.next()

def step(self, action):
Expand Down
2 changes: 1 addition & 1 deletion docs/code_examples/aec_rps_usage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aec_rps
from . import aec_rps

env = aec_rps.env(render_mode="human")
env.reset(seed=42)
Expand Down
2 changes: 1 addition & 1 deletion docs/code_examples/parallel_rps_usage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import parallel_rps
from . import parallel_rps

env = parallel_rps.parallel_env(render_mode="human")
observations, infos = env.reset()
Expand Down
6 changes: 3 additions & 3 deletions docs/content/environment_creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ The utils directory also contain some classes which are only helpful for develop

### Agent selector

The `agent_selector` class steps through agents in a cycle
The `AgentSelector` class steps through agents in a cycle

It can be used as follows to cycle through the list of agents:

```python
from pettingzoo.utils import agent_selector
from pettingzoo.utils import AgentSelector
agents = ["agent_1", "agent_2", "agent_3"]
selector = agent_selector(agents)
selector = AgentSelector(agents)
agent_selection = selector.reset()
# agent_selection will be "agent_1"
for i in range(100):
Expand Down
18 changes: 18 additions & 0 deletions docs/environments/third_party_envs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ lastpage:
## Environments using the latest versions of PettingZoo
*Due to a very recent major release of PettingZoo, there are currently few contributed third-party environments. If you'd like to contribute one, please reach out on [Discord](https://discord.gg/nHg2JRN489).*

### [gfootball-gymnasium-pettingzoo](https://github.com/xihuai18/gfootball-gymnasium-pettingzoo)
[![PettingZoo version dependency](https://img.shields.io/badge/PettingZoo-v1.24.3-blue)]()
[![GitHub stars](https://img.shields.io/github/stars/xihuai18/gfootball-gymnasium-pettingzoo)]()

Google Research Football ([GRF](https://github.com/google-research/football)) with Gymnasium and PettingZoo Compatibility.

### [SMAC and SMACv2 with latest PettingZoo APIs](https://github.com/xihuai18/SMAC-PettingZoo)
[![PettingZoo version dependency](https://img.shields.io/badge/PettingZoo-v1.24.3-blue)]()
[![GitHub stars](https://img.shields.io/github/stars/xihuai18/gfootball-gymnasium-pettingzoo)]()

[SMAC](https://github.com/oxwhirl/smac) and [SMACv2](https://github.com/oxwhirl/smacv2) with the latest PettingZoo Parallel APIs.

### [Sumo-RL](https://github.com/LucasAlegre/sumo-rl)

[![PettingZoo version dependency](https://img.shields.io/badge/PettingZoo-v1.22.2-blue)]()
Expand Down Expand Up @@ -57,6 +69,12 @@ CookingZoo: a gym-cooking derivative to simulate a complex cooking environment.

A library for doing reinforcement learning using [Crazyflie](https://www.bitcraze.io/products/crazyflie-2-1/) drones.

### [DSSE: Drone Swarm Search Environment](https://github.com/pfeinsper/drone-swarm-search)
[![PettingZoo version dependency](https://img.shields.io/badge/PettingZoo-v1.22.3-blue)]()
![GitHub stars](https://img.shields.io/github/stars/pfeinsper/drone-swarm-search)

A single and multi-agent environment to train swarms of drones for maritime search.


### [PettingZoo Dilemma Envs](https://github.com/tianyu-z/pettingzoo_dilemma_envs)

Expand Down
Loading

0 comments on commit 07a8223

Please sign in to comment.