Skip to content

Commit 2af0800

Browse files
authored
Merge pull request #1026 from microsoft/dabignel/nuke_proxy_env
Update from gym to gymnasium, and remove the proxyenv
2 parents b59258d + c4a3bae commit 2af0800

File tree

13 files changed

+9
-775
lines changed

13 files changed

+9
-775
lines changed

MalmoEnv/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Install dependencies:
1414

1515
Java8 JDK ([AdoptOpenJDK](https://adoptopenjdk.net/)), python3, git
1616

17-
`pip3 install gym lxml numpy pillow`
17+
`pip3 install gymnasium lxml numpy pillow`
1818

1919
To prepare Minecraft (after cloning this repository with
2020
`git clone https://github.com/Microsoft/malmo.git`):

MalmoEnv/malmoenv/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@
2626
from malmoenv import comms
2727
from malmoenv.commands import CommandParser
2828
import uuid
29-
import gym.spaces
29+
import gymnasium.spaces
3030
from malmoenv.comms import retry
3131
from malmoenv.version import malmo_version
3232

3333

34-
class StringActionSpace(gym.spaces.Discrete):
34+
class StringActionSpace(gymnasium.spaces.Discrete):
3535
"""Malmo actions as their strings."""
3636
def __init__(self):
37-
gym.spaces.Discrete.__init__(self, 1)
37+
gymnasium.spaces.Discrete.__init__(self, 1)
3838

3939
def __getitem__(self, action):
4040
return action
4141

4242

43-
class ActionSpace(gym.spaces.Discrete):
43+
class ActionSpace(gymnasium.spaces.Discrete):
4444
"""Malmo actions as gym action space"""
4545
def __init__(self, actions):
4646
self.actions = actions
47-
gym.spaces.Discrete.__init__(self, len(self.actions))
47+
gymnasium.spaces.Discrete.__init__(self, len(self.actions))
4848

4949
def sample(self):
5050
return random.randint(1, len(self.actions)) - 1
@@ -56,12 +56,12 @@ def __len__(self):
5656
return len(self.actions)
5757

5858

59-
class VisualObservationSpace(gym.spaces.Box):
59+
class VisualObservationSpace(gymnasium.spaces.Box):
6060
"""Space for visual observations: width x height x depth as a flat array.
6161
Where depth is 3 or 4 if encoding scene depth.
6262
"""
6363
def __init__(self, width, height, depth):
64-
gym.spaces.Box.__init__(self,
64+
gymnasium.spaces.Box.__init__(self,
6565
low=np.iinfo(np.uint8).min, high=np.iinfo(np.uint8).max,
6666
shape=(height, width, depth), dtype=np.uint8)
6767

MalmoEnv/proxyenv/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

MalmoEnv/proxyenv/action_utils.py

Lines changed: 0 additions & 122 deletions
This file was deleted.

MalmoEnv/proxyenv/client.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

MalmoEnv/proxyenv/comms.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)