diff --git a/docs/environments/mpe.md b/docs/environments/mpe.md index 2ad185e05..0daf085f0 100644 --- a/docs/environments/mpe.md +++ b/docs/environments/mpe.md @@ -36,9 +36,9 @@ pip install pettingzoo[mpe] ### Usage To launch a [Simple Tag](https://pettingzoo.farama.org/environments/mpe/simple_tag/) environment with random agents: -```python -from pettingzoo.mpe import simple_tag_v2 -env = simple_tag_v2.env(render_mode='human') +``` python +from pettingzoo.mpe import simple_tag_v3 +env = simple_tag_v3.env(render_mode='human') env.reset() for agent in env.agent_iter(): diff --git a/pettingzoo/mpe/_mpe_utils/core.py b/pettingzoo/mpe/_mpe_utils/core.py index ea6e34fd6..532166507 100644 --- a/pettingzoo/mpe/_mpe_utils/core.py +++ b/pettingzoo/mpe/_mpe_utils/core.py @@ -168,6 +168,7 @@ def integrate_state(self, p_force): for i, entity in enumerate(self.entities): if not entity.movable: continue + entity.state.p_pos += entity.state.p_vel * self.dt entity.state.p_vel = entity.state.p_vel * (1 - self.damping) if p_force[i] is not None: entity.state.p_vel += (p_force[i] / entity.mass) * self.dt @@ -184,7 +185,6 @@ def integrate_state(self, p_force): ) * entity.max_speed ) - entity.state.p_pos += entity.state.p_vel * self.dt def update_agent_state(self, agent): # set communication state (directly for now) diff --git a/pettingzoo/mpe/simple/simple.py b/pettingzoo/mpe/simple/simple.py index 457bb3f81..00ac3af7d 100644 --- a/pettingzoo/mpe/simple/simple.py +++ b/pettingzoo/mpe/simple/simple.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_v2` | +| Import | `from pettingzoo.mpe import simple_v3` | |--------------------|----------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -31,7 +31,7 @@ ### Arguments ``` python -simple_v2.env(max_cycles=25, continuous_actions=False) +simple_v3.env(max_cycles=25, continuous_actions=False) ``` @@ -69,7 +69,7 @@ def __init__(self, max_cycles=25, continuous_actions=False, render_mode=None): max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_v2" + self.metadata["name"] = "simple_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_adversary/simple_adversary.py b/pettingzoo/mpe/simple_adversary/simple_adversary.py index d68e6cdef..eef2e2a46 100644 --- a/pettingzoo/mpe/simple_adversary/simple_adversary.py +++ b/pettingzoo/mpe/simple_adversary/simple_adversary.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_adversary_v2` | +| Import | `from pettingzoo.mpe import simple_adversary_v3` | |--------------------|--------------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -39,7 +39,7 @@ ### Arguments ``` python -simple_adversary_v2.env(N=2, max_cycles=25, continuous_actions=False) +simple_adversary_v3.env(N=2, max_cycles=25, continuous_actions=False) ``` @@ -80,7 +80,7 @@ def __init__(self, N=2, max_cycles=25, continuous_actions=False, render_mode=Non max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_adversary_v2" + self.metadata["name"] = "simple_adversary_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_adversary_v2.py b/pettingzoo/mpe/simple_adversary_v3.py similarity index 100% rename from pettingzoo/mpe/simple_adversary_v2.py rename to pettingzoo/mpe/simple_adversary_v3.py diff --git a/pettingzoo/mpe/simple_crypto/simple_crypto.py b/pettingzoo/mpe/simple_crypto/simple_crypto.py index 9234943be..b369dce17 100644 --- a/pettingzoo/mpe/simple_crypto/simple_crypto.py +++ b/pettingzoo/mpe/simple_crypto/simple_crypto.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_crypto_v2` | +| Import | `from pettingzoo.mpe import simple_crypto_v3` | |--------------------|-----------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -45,7 +45,7 @@ ### Arguments ``` python -simple_crypto_v2.env(max_cycles=25, continuous_actions=False) +simple_crypto_v3.env(max_cycles=25, continuous_actions=False) ``` @@ -90,7 +90,7 @@ def __init__(self, max_cycles=25, continuous_actions=False, render_mode=None): max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_crypto_v2" + self.metadata["name"] = "simple_crypto_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_crypto_v2.py b/pettingzoo/mpe/simple_crypto_v3.py similarity index 100% rename from pettingzoo/mpe/simple_crypto_v2.py rename to pettingzoo/mpe/simple_crypto_v3.py diff --git a/pettingzoo/mpe/simple_push/simple_push.py b/pettingzoo/mpe/simple_push/simple_push.py index dee55cf7e..053d67086 100644 --- a/pettingzoo/mpe/simple_push/simple_push.py +++ b/pettingzoo/mpe/simple_push/simple_push.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_push_v2` | +| Import | `from pettingzoo.mpe import simple_push_v3` | |--------------------|---------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -38,7 +38,7 @@ ### Arguments ``` python -simple_push_v2.env(max_cycles=25, continuous_actions=False) +simple_push_v3.env(max_cycles=25, continuous_actions=False) ``` @@ -74,7 +74,7 @@ def __init__(self, max_cycles=25, continuous_actions=False, render_mode=None): max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_push_v2" + self.metadata["name"] = "simple_push_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_push_v2.py b/pettingzoo/mpe/simple_push_v3.py similarity index 100% rename from pettingzoo/mpe/simple_push_v2.py rename to pettingzoo/mpe/simple_push_v3.py diff --git a/pettingzoo/mpe/simple_reference/simple_reference.py b/pettingzoo/mpe/simple_reference/simple_reference.py index 0acb83098..b0f233aba 100644 --- a/pettingzoo/mpe/simple_reference/simple_reference.py +++ b/pettingzoo/mpe/simple_reference/simple_reference.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_reference_v2` | +| Import | `from pettingzoo.mpe import simple_reference_v3` | |--------------------|--------------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -40,7 +40,7 @@ ``` python -simple_reference_v2.env(local_ratio=0.5, max_cycles=25, continuous_actions=False) +simple_reference_v3.env(local_ratio=0.5, max_cycles=25, continuous_actions=False) ``` @@ -87,7 +87,7 @@ def __init__( continuous_actions=continuous_actions, local_ratio=local_ratio, ) - self.metadata["name"] = "simple_reference_v2" + self.metadata["name"] = "simple_reference_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_reference_v2.py b/pettingzoo/mpe/simple_reference_v3.py similarity index 100% rename from pettingzoo/mpe/simple_reference_v2.py rename to pettingzoo/mpe/simple_reference_v3.py diff --git a/pettingzoo/mpe/simple_speaker_listener/simple_speaker_listener.py b/pettingzoo/mpe/simple_speaker_listener/simple_speaker_listener.py index c1e268fb9..bd953c00e 100644 --- a/pettingzoo/mpe/simple_speaker_listener/simple_speaker_listener.py +++ b/pettingzoo/mpe/simple_speaker_listener/simple_speaker_listener.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_speaker_listener_v3` | +| Import | `from pettingzoo.mpe import simple_speaker_listener_v4` | |----------------------|---------------------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -37,7 +37,7 @@ ### Arguments ``` python -simple_speaker_listener_v2.env(max_cycles=25, continuous_actions=False) +simple_speaker_listener_v4.env(max_cycles=25, continuous_actions=False) ``` @@ -75,7 +75,7 @@ def __init__(self, max_cycles=25, continuous_actions=False, render_mode=None): max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_speaker_listener_v3" + self.metadata["name"] = "simple_speaker_listener_v4" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_speaker_listener_v3.py b/pettingzoo/mpe/simple_speaker_listener_v4.py similarity index 100% rename from pettingzoo/mpe/simple_speaker_listener_v3.py rename to pettingzoo/mpe/simple_speaker_listener_v4.py diff --git a/pettingzoo/mpe/simple_spread/simple_spread.py b/pettingzoo/mpe/simple_spread/simple_spread.py index e5a3ccbfa..b4098f64e 100644 --- a/pettingzoo/mpe/simple_spread/simple_spread.py +++ b/pettingzoo/mpe/simple_spread/simple_spread.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_spread_v2` | +| Import | `from pettingzoo.mpe import simple_spread_v3` | |----------------------|-----------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -36,7 +36,7 @@ ### Arguments ``` python -simple_spread_v2.env(N=3, local_ratio=0.5, max_cycles=25, continuous_actions=False) +simple_spread_v3.env(N=3, local_ratio=0.5, max_cycles=25, continuous_actions=False) ``` @@ -91,7 +91,7 @@ def __init__( continuous_actions=continuous_actions, local_ratio=local_ratio, ) - self.metadata["name"] = "simple_spread_v2" + self.metadata["name"] = "simple_spread_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_spread_v2.py b/pettingzoo/mpe/simple_spread_v3.py similarity index 100% rename from pettingzoo/mpe/simple_spread_v2.py rename to pettingzoo/mpe/simple_spread_v3.py diff --git a/pettingzoo/mpe/simple_tag/simple_tag.py b/pettingzoo/mpe/simple_tag/simple_tag.py index f6f078dce..d93228265 100644 --- a/pettingzoo/mpe/simple_tag/simple_tag.py +++ b/pettingzoo/mpe/simple_tag/simple_tag.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_tag_v2` | +| Import | `from pettingzoo.mpe import simple_tag_v3` | |--------------------|------------------------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -45,7 +45,7 @@ def bound(x): ### Arguments ``` python -simple_tag_v2.env(num_good=1, num_adversaries=3, num_obstacles=2, max_cycles=25, continuous_actions=False) +simple_tag_v3.env(num_good=1, num_adversaries=3, num_obstacles=2, max_cycles=25, continuous_actions=False) ``` @@ -100,7 +100,7 @@ def __init__( max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_tag_v2" + self.metadata["name"] = "simple_tag_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_tag_v2.py b/pettingzoo/mpe/simple_tag_v3.py similarity index 100% rename from pettingzoo/mpe/simple_tag_v2.py rename to pettingzoo/mpe/simple_tag_v3.py diff --git a/pettingzoo/mpe/simple_v2.py b/pettingzoo/mpe/simple_v3.py similarity index 100% rename from pettingzoo/mpe/simple_v2.py rename to pettingzoo/mpe/simple_v3.py diff --git a/pettingzoo/mpe/simple_world_comm/simple_world_comm.py b/pettingzoo/mpe/simple_world_comm/simple_world_comm.py index 94e3a7f4f..d4c02e1e2 100644 --- a/pettingzoo/mpe/simple_world_comm/simple_world_comm.py +++ b/pettingzoo/mpe/simple_world_comm/simple_world_comm.py @@ -9,7 +9,7 @@ This environment is part of the MPE environments. Please read that page first for general information. -| Import | `from pettingzoo.mpe import simple_world_comm_v2` | +| Import | `from pettingzoo.mpe import simple_world_comm_v3` | |--------------------|-------------------------------------------------------------------------------------| | Actions | Discrete/Continuous | | Parallel API | Yes | @@ -117,7 +117,7 @@ def __init__( max_cycles=max_cycles, continuous_actions=continuous_actions, ) - self.metadata["name"] = "simple_world_comm_v2" + self.metadata["name"] = "simple_world_comm_v3" env = make_env(raw_env) diff --git a/pettingzoo/mpe/simple_world_comm_v2.py b/pettingzoo/mpe/simple_world_comm_v3.py similarity index 100% rename from pettingzoo/mpe/simple_world_comm_v2.py rename to pettingzoo/mpe/simple_world_comm_v3.py diff --git a/pettingzoo/test/api_test.py b/pettingzoo/test/api_test.py index 6893d291c..168a9da71 100644 --- a/pettingzoo/test/api_test.py +++ b/pettingzoo/test/api_test.py @@ -32,13 +32,13 @@ ] env_graphical_obs = ["knights_archers_zombies_v10"] env_diff_obs_shapes = [ - "simple_adversary_v2", - "simple_world_comm_v2", - "simple_tag_v2", + "simple_adversary_v3", + "simple_world_comm_v3", + "simple_tag_v3", "knights_archers_zombies_v10", - "simple_push_v2", - "simple_speaker_listener_v3", - "simple_crypto_v2", + "simple_push_v3", + "simple_speaker_listener_v4", + "simple_crypto_v3", ] env_all_zeros_obs = ["knights_archers_zombies_v10"] env_obs_space = [ @@ -54,36 +54,36 @@ "gin_rummy_v4", ] env_diff_agent_obs_size = [ - "simple_adversary_v2", - "simple_world_comm_v2", - "simple_tag_v2", - "simple_crypto_v2", - "simple_push_v2", - "simple_speaker_listener_v3", + "simple_adversary_v3", + "simple_world_comm_v3", + "simple_tag_v3", + "simple_crypto_v3", + "simple_push_v3", + "simple_speaker_listener_v4", ] env_pos_inf_obs = [ - "simple_adversary_v2", - "simple_reference_v2", - "simple_spread_v2", - "simple_tag_v2", - "simple_world_comm_v2", + "simple_adversary_v3", + "simple_reference_v3", + "simple_spread_v3", + "simple_tag_v3", + "simple_world_comm_v3", "multiwalker_v9", - "simple_crypto_v2", - "simple_push_v2", - "simple_speaker_listener_v3", - "simple_v2", + "simple_crypto_v3", + "simple_push_v3", + "simple_speaker_listener_v4", + "simple_v3", ] env_neg_inf_obs = [ - "simple_adversary_v2", - "simple_reference_v2", - "simple_spread_v2", - "simple_tag_v2", - "simple_world_comm_v2", + "simple_adversary_v3", + "simple_reference_v3", + "simple_spread_v3", + "simple_tag_v3", + "simple_world_comm_v3", "multiwalker_v9", - "simple_crypto_v2", - "simple_push_v2", - "simple_speaker_listener_v3", - "simple_v2", + "simple_crypto_v3", + "simple_push_v3", + "simple_speaker_listener_v4", + "simple_v3", ] diff --git a/pettingzoo/test/state_test.py b/pettingzoo/test/state_test.py index 80ff32db6..de116ffe4 100644 --- a/pettingzoo/test/state_test.py +++ b/pettingzoo/test/state_test.py @@ -4,26 +4,26 @@ import numpy as np env_pos_inf_state = [ - "simple_adversary_v2", - "simple_reference_v2", - "simple_spread_v2", - "simple_tag_v2", - "simple_world_comm_v2", - "simple_crypto_v2", - "simple_push_v2", - "simple_speaker_listener_v3", - "simple_v2", + "simple_adversary_v3", + "simple_reference_v3", + "simple_spread_v3", + "simple_tag_v3", + "simple_world_comm_v3", + "simple_crypto_v3", + "simple_push_v3", + "simple_speaker_listener_v4", + "simple_v3", ] env_neg_inf_state = [ - "simple_adversary_v2", - "simple_reference_v2", - "simple_spread_v2", - "simple_tag_v2", - "simple_world_comm_v2", - "simple_crypto_v2", - "simple_push_v2", - "simple_speaker_listener_v3", - "simple_v2", + "simple_adversary_v3", + "simple_reference_v3", + "simple_spread_v3", + "simple_tag_v3", + "simple_world_comm_v3", + "simple_crypto_v3", + "simple_push_v3", + "simple_speaker_listener_v4", + "simple_v3", ] diff --git a/test/all_modules.py b/test/all_modules.py index 53a2a84fe..05339affc 100644 --- a/test/all_modules.py +++ b/test/all_modules.py @@ -41,15 +41,15 @@ tictactoe_v3, ) from pettingzoo.mpe import ( - simple_adversary_v2, - simple_crypto_v2, - simple_push_v2, - simple_reference_v2, - simple_speaker_listener_v3, - simple_spread_v2, - simple_tag_v2, - simple_v2, - simple_world_comm_v2, + simple_adversary_v3, + simple_crypto_v3, + simple_push_v3, + simple_reference_v3, + simple_speaker_listener_v4, + simple_spread_v3, + simple_tag_v3, + simple_v3, + simple_world_comm_v3, ) from pettingzoo.sisl import multiwalker_v9, pursuit_v4, waterworld_v4 @@ -99,15 +99,15 @@ "butterfly/knights_archers_zombies_v10": knights_archers_zombies_v10, "butterfly/pistonball_v6": pistonball_v6, "butterfly/cooperative_pong_v5": cooperative_pong_v5, - "mpe/simple_adversary_v2": simple_adversary_v2, - "mpe/simple_crypto_v2": simple_crypto_v2, - "mpe/simple_push_v2": simple_push_v2, - "mpe/simple_reference_v2": simple_reference_v2, - "mpe/simple_speaker_listener_v3": simple_speaker_listener_v3, - "mpe/simple_spread_v2": simple_spread_v2, - "mpe/simple_tag_v2": simple_tag_v2, - "mpe/simple_world_comm_v2": simple_world_comm_v2, - "mpe/simple_v2": simple_v2, + "mpe/simple_adversary_v3": simple_adversary_v3, + "mpe/simple_crypto_v3": simple_crypto_v3, + "mpe/simple_push_v3": simple_push_v3, + "mpe/simple_reference_v3": simple_reference_v3, + "mpe/simple_speaker_listener_v4": simple_speaker_listener_v4, + "mpe/simple_spread_v3": simple_spread_v3, + "mpe/simple_tag_v3": simple_tag_v3, + "mpe/simple_world_comm_v3": simple_world_comm_v3, + "mpe/simple_v3": simple_v3, "sisl/multiwalker_v9": multiwalker_v9, "sisl/waterworld_v4": waterworld_v4, "sisl/pursuit_v4": pursuit_v4, diff --git a/test/all_parameter_combs_test.py b/test/all_parameter_combs_test.py index 5a1a14fe9..ea2008145 100644 --- a/test/all_parameter_combs_test.py +++ b/test/all_parameter_combs_test.py @@ -16,11 +16,11 @@ texas_holdem_v4, ) from pettingzoo.mpe import ( - simple_adversary_v2, - simple_reference_v2, - simple_spread_v2, - simple_tag_v2, - simple_world_comm_v2, + simple_adversary_v3, + simple_reference_v3, + simple_spread_v3, + simple_tag_v3, + simple_world_comm_v3, ) from pettingzoo.sisl import multiwalker_v9, pursuit_v4, waterworld_v4 from pettingzoo.test.api_test import api_test @@ -153,53 +153,53 @@ ["classic/hanabi_v4", hanabi_v4, dict(observation_type=1)], ["classic/hanabi_v4", hanabi_v4, dict(random_start_player=False)], ["classic/hanabi_v4", hanabi_v4, dict(random_start_player=True)], - ["mpe/simple_adversary_v2", simple_adversary_v2, dict(N=4)], - ["mpe/simple_reference_v2", simple_reference_v2, dict(local_ratio=0.2)], - ["mpe/simple_spread_v2", simple_spread_v2, dict(N=5)], + ["mpe/simple_adversary_v3", simple_adversary_v3, dict(N=4)], + ["mpe/simple_reference_v3", simple_reference_v3, dict(local_ratio=0.2)], + ["mpe/simple_spread_v3", simple_spread_v3, dict(N=5)], [ - "mpe/simple_tag_v2", - simple_tag_v2, + "mpe/simple_tag_v3", + simple_tag_v3, dict(num_good=5, num_adversaries=10, num_obstacles=4), ], [ - "mpe/simple_tag_v2", - simple_tag_v2, + "mpe/simple_tag_v3", + simple_tag_v3, dict(num_good=1, num_adversaries=1, num_obstacles=1), ], [ - "mpe/simple_world_comm_v2", - simple_world_comm_v2, + "mpe/simple_world_comm_v3", + simple_world_comm_v3, dict(num_good=5, num_adversaries=10, num_obstacles=4, num_food=3), ], [ - "mpe/simple_world_comm_v2", - simple_world_comm_v2, + "mpe/simple_world_comm_v3", + simple_world_comm_v3, dict(num_good=1, num_adversaries=1, num_obstacles=1, num_food=1), ], [ - "mpe/simple_adversary_v2", - simple_adversary_v2, + "mpe/simple_adversary_v3", + simple_adversary_v3, dict(N=4, continuous_actions=True), ], [ - "mpe/simple_reference_v2", - simple_reference_v2, + "mpe/simple_reference_v3", + simple_reference_v3, dict(local_ratio=0.2, continuous_actions=True), ], - ["mpe/simple_spread_v2", simple_spread_v2, dict(N=5, continuous_actions=True)], + ["mpe/simple_spread_v3", simple_spread_v3, dict(N=5, continuous_actions=True)], [ - "mpe/simple_tag_v2", - simple_tag_v2, + "mpe/simple_tag_v3", + simple_tag_v3, dict(num_good=5, num_adversaries=10, num_obstacles=4, continuous_actions=True), ], [ - "mpe/simple_tag_v2", - simple_tag_v2, + "mpe/simple_tag_v3", + simple_tag_v3, dict(num_good=1, num_adversaries=1, num_obstacles=1, continuous_actions=True), ], [ - "mpe/simple_world_comm_v2", - simple_world_comm_v2, + "mpe/simple_world_comm_v3", + simple_world_comm_v3, dict( num_good=5, num_adversaries=10, @@ -209,8 +209,8 @@ ), ], [ - "mpe/simple_world_comm_v2", - simple_world_comm_v2, + "mpe/simple_world_comm_v3", + simple_world_comm_v3, dict( num_good=1, num_adversaries=1,