multi-agent-rlenv 3.3.1__tar.gz → 3.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/PKG-INFO +1 -1
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/__init__.py +1 -1
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/overcooked_adapter.py +11 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_serialization.py +26 -5
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/.github/workflows/ci.yaml +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/.github/workflows/docs.yaml +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/.gitignore +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/LICENSE +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/README.md +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/pyproject.toml +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/__init__.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/gym_adapter.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/pettingzoo_adapter.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/pymarl_adapter.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/smac_adapter.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/env_builder.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/env_pool.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/exceptions.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/mock_env.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/__init__.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/env.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/episode.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/observation.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/spaces.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/state.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/step.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/models/transition.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/py.typed +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/__init__.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/agent_id_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/available_actions_mask.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/available_actions_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/blind_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/centralised.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/delayed_rewards.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/last_action_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/paddings.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/penalty_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/rlenv_wrapper.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/time_limit.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/video_recorder.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/__init__.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_adapters.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_episode.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_models.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_pool.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_spaces.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/test_wrappers.py +0 -0
- {multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multi-agent-rlenv
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.2
|
|
4
4
|
Summary: A strongly typed Multi-Agent Reinforcement Learning framework
|
|
5
5
|
Project-URL: repository, https://github.com/yamoling/multi-agent-rlenv
|
|
6
6
|
Author-email: Yannick Molinghen <yannick.molinghen@ulb.be>
|
|
@@ -62,7 +62,7 @@ print(env.extras_shape) # (1, )
|
|
|
62
62
|
If you want to create a new environment, you can simply create a class that inherits from `MARLEnv`. If you want to create a wrapper around an existing `MARLEnv`, you probably want to subclass `RLEnvWrapper` which implements a default behaviour for every method.
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
__version__ = "3.3.
|
|
65
|
+
__version__ = "3.3.2"
|
|
66
66
|
|
|
67
67
|
from . import models
|
|
68
68
|
from . import wrappers
|
{multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/overcooked_adapter.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import Literal, Sequence
|
|
4
|
+
from copy import deepcopy
|
|
4
5
|
|
|
5
6
|
import cv2
|
|
6
7
|
import numpy as np
|
|
@@ -87,6 +88,16 @@ class Overcooked(MARLEnv[Sequence[int] | npt.NDArray, DiscreteActionSpace]):
|
|
|
87
88
|
info=info,
|
|
88
89
|
)
|
|
89
90
|
|
|
91
|
+
def __deepcopy__(self, memo: dict):
|
|
92
|
+
mdp = deepcopy(self._mdp)
|
|
93
|
+
return Overcooked(OvercookedEnv.from_mdp(mdp, horizon=self.horizon))
|
|
94
|
+
|
|
95
|
+
def __getstate__(self):
|
|
96
|
+
return {"horizon": self.horizon, "mdp": self._mdp}
|
|
97
|
+
|
|
98
|
+
def __setstate__(self, state: dict):
|
|
99
|
+
self.__init__(OvercookedEnv.from_mdp(state["mdp"], horizon=state["horizon"]))
|
|
100
|
+
|
|
90
101
|
def get_image(self):
|
|
91
102
|
rewards_dict = {} # dictionary of details you want rendered in the UI
|
|
92
103
|
for key, value in self._oenv.game_stats.items():
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import pickle
|
|
2
|
-
from importlib.util import find_spec
|
|
3
|
-
|
|
4
2
|
import numpy as np
|
|
5
3
|
import orjson
|
|
6
4
|
import pytest
|
|
5
|
+
from copy import deepcopy
|
|
7
6
|
|
|
8
7
|
import marlenv
|
|
9
8
|
from marlenv import DiscreteMockEnv
|
|
10
9
|
|
|
11
|
-
skip_gym = find_spec("gymnasium") is None
|
|
12
|
-
|
|
13
10
|
|
|
14
11
|
def test_registry():
|
|
15
12
|
env = DiscreteMockEnv(4)
|
|
@@ -22,7 +19,7 @@ def test_registry():
|
|
|
22
19
|
assert restored_env.n_actions == env.n_actions
|
|
23
20
|
|
|
24
21
|
|
|
25
|
-
@pytest.mark.skipif(
|
|
22
|
+
@pytest.mark.skipif(not marlenv.adapters.HAS_GYM, reason="Gymnasium is not installed")
|
|
26
23
|
def test_registry_gym():
|
|
27
24
|
env = marlenv.make("CartPole-v1")
|
|
28
25
|
restored_env = pickle.loads(pickle.dumps(env))
|
|
@@ -135,3 +132,27 @@ def test_serialize_episode():
|
|
|
135
132
|
episode.add(transition)
|
|
136
133
|
|
|
137
134
|
_ = orjson.dumps(episode, option=orjson.OPT_SERIALIZE_NUMPY)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@pytest.mark.skipif(not marlenv.adapters.HAS_OVERCOOKED, reason="Overcooked is not installed")
|
|
138
|
+
def test_deepcopy_overcooked():
|
|
139
|
+
env = marlenv.adapters.Overcooked.from_layout("scenario4")
|
|
140
|
+
env2 = deepcopy(env)
|
|
141
|
+
assert env == env2
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@pytest.mark.skipif(not marlenv.adapters.HAS_OVERCOOKED, reason="Overcooked is not installed")
|
|
145
|
+
def test_pickle_overcooked():
|
|
146
|
+
env = marlenv.adapters.Overcooked.from_layout("scenario1_s", horizon=60)
|
|
147
|
+
serialized = pickle.dumps(env)
|
|
148
|
+
restored = pickle.loads(serialized)
|
|
149
|
+
assert env == restored
|
|
150
|
+
|
|
151
|
+
env.reset()
|
|
152
|
+
restored.reset()
|
|
153
|
+
|
|
154
|
+
for _ in range(50):
|
|
155
|
+
actions = env.sample_action()
|
|
156
|
+
step = env.step(actions)
|
|
157
|
+
step_restored = restored.step(actions)
|
|
158
|
+
assert step == step_restored
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/adapters/pettingzoo_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/agent_id_wrapper.py
RENAMED
|
File without changes
|
{multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/available_actions_mask.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{multi_agent_rlenv-3.3.1 → multi_agent_rlenv-3.3.2}/src/marlenv/wrappers/last_action_wrapper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|