miniworld-maze 1.2.0__py3-none-any.whl → 1.3.1__py3-none-any.whl
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.
Potentially problematic release.
This version of miniworld-maze might be problematic. Click here for more details.
- miniworld_maze/core/miniworld_gymnasium/base_env.py +3 -0
- miniworld_maze/core/miniworld_gymnasium/unified_env.py +16 -14
- miniworld_maze/environments/base_grid_rooms.py +3 -0
- {miniworld_maze-1.2.0.dist-info → miniworld_maze-1.3.1.dist-info}/METADATA +1 -1
- {miniworld_maze-1.2.0.dist-info → miniworld_maze-1.3.1.dist-info}/RECORD +6 -6
- {miniworld_maze-1.2.0.dist-info → miniworld_maze-1.3.1.dist-info}/WHEEL +0 -0
|
@@ -21,6 +21,7 @@ class MiniWorldEnv(UnifiedMiniWorldEnv):
|
|
|
21
21
|
window_height=600,
|
|
22
22
|
params=DEFAULT_PARAMS,
|
|
23
23
|
domain_rand=False,
|
|
24
|
+
render_mode=None,
|
|
24
25
|
):
|
|
25
26
|
"""
|
|
26
27
|
Initialize base MiniWorld environment.
|
|
@@ -33,6 +34,7 @@ class MiniWorldEnv(UnifiedMiniWorldEnv):
|
|
|
33
34
|
window_height: Window height for human rendering
|
|
34
35
|
params: Environment parameters for domain randomization
|
|
35
36
|
domain_rand: Whether to enable domain randomization
|
|
37
|
+
render_mode: Render mode ("human", "rgb_array", or None)
|
|
36
38
|
"""
|
|
37
39
|
# Mark this as a base environment (not custom) for background color handling
|
|
38
40
|
self._is_custom_env = False
|
|
@@ -49,4 +51,5 @@ class MiniWorldEnv(UnifiedMiniWorldEnv):
|
|
|
49
51
|
window_height=window_height,
|
|
50
52
|
params=params,
|
|
51
53
|
domain_rand=domain_rand,
|
|
54
|
+
render_mode=render_mode,
|
|
52
55
|
)
|
|
@@ -63,7 +63,7 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
63
63
|
both the enhanced features of CustomMiniWorldEnv and the legacy BaseEnv functionality.
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
|
-
metadata = {"
|
|
66
|
+
metadata = {"render_modes": ["human", "rgb_array"], "video.frames_per_second": 30}
|
|
67
67
|
|
|
68
68
|
# Enumeration of possible actions
|
|
69
69
|
class Actions(IntEnum):
|
|
@@ -98,6 +98,7 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
98
98
|
params=DEFAULT_PARAMS,
|
|
99
99
|
domain_rand=False,
|
|
100
100
|
info_obs: Optional[List[ObservationLevel]] = None,
|
|
101
|
+
render_mode=None,
|
|
101
102
|
):
|
|
102
103
|
"""
|
|
103
104
|
Initialize unified MiniWorld environment.
|
|
@@ -114,6 +115,7 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
114
115
|
params: Environment parameters for domain randomization
|
|
115
116
|
domain_rand: Whether to enable domain randomization
|
|
116
117
|
info_obs: List of observation levels to include in info dictionary
|
|
118
|
+
render_mode: Render mode ("human", "rgb_array", or None)
|
|
117
119
|
"""
|
|
118
120
|
# Store configuration
|
|
119
121
|
self.obs_level = obs_level
|
|
@@ -123,6 +125,13 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
123
125
|
self.params = params
|
|
124
126
|
self.domain_rand = domain_rand
|
|
125
127
|
self.info_obs = info_obs
|
|
128
|
+
self.render_mode = render_mode
|
|
129
|
+
|
|
130
|
+
# Validate render_mode
|
|
131
|
+
if render_mode is not None and render_mode not in self.metadata["render_modes"]:
|
|
132
|
+
raise ValueError(
|
|
133
|
+
f"render_mode must be one of {self.metadata['render_modes']}, got {render_mode}"
|
|
134
|
+
)
|
|
126
135
|
|
|
127
136
|
# Setup action space
|
|
128
137
|
self._setup_action_space()
|
|
@@ -340,8 +349,8 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
340
349
|
for obs_level in self.info_obs:
|
|
341
350
|
# Generate observation with the specified level
|
|
342
351
|
info_obs = self._generate_observation(observation_level=obs_level)
|
|
343
|
-
# Use the observation level
|
|
344
|
-
info[
|
|
352
|
+
# Use the observation level enum as key
|
|
353
|
+
info[obs_level] = info_obs
|
|
345
354
|
|
|
346
355
|
# Return first observation with info dict for Gymnasium compatibility
|
|
347
356
|
return obs, info
|
|
@@ -575,19 +584,14 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
575
584
|
|
|
576
585
|
def _calculate_step_results(self, observation):
|
|
577
586
|
"""Calculate reward, termination, and info for step."""
|
|
578
|
-
# Generate topdown view for info if needed
|
|
579
|
-
topdown = None
|
|
580
|
-
if self.obs_level != 2: # Not TOP_DOWN_FULL
|
|
581
|
-
topdown = self.render_top_view(POMDP=False, frame_buffer=self.topdown_fb)
|
|
582
|
-
|
|
583
587
|
# Generate additional observations for info dictionary if specified
|
|
584
588
|
info = {}
|
|
585
589
|
if self.info_obs is not None:
|
|
586
590
|
for obs_level in self.info_obs:
|
|
587
591
|
# Generate observation with the specified level
|
|
588
592
|
info_obs = self._generate_observation(observation_level=obs_level)
|
|
589
|
-
# Use the observation level
|
|
590
|
-
info[
|
|
593
|
+
# Use the observation level enum as key
|
|
594
|
+
info[obs_level] = info_obs
|
|
591
595
|
|
|
592
596
|
# Check termination
|
|
593
597
|
if self.step_count >= self.max_episode_steps:
|
|
@@ -595,8 +599,7 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
595
599
|
reward = 0
|
|
596
600
|
info.update(
|
|
597
601
|
{
|
|
598
|
-
"pos": self.agent.pos,
|
|
599
|
-
"mdp_view": topdown if topdown is not None else observation,
|
|
602
|
+
"pos": np.array([self.agent.pos[0], self.agent.pos[2]]),
|
|
600
603
|
}
|
|
601
604
|
)
|
|
602
605
|
else:
|
|
@@ -604,8 +607,7 @@ class UnifiedMiniWorldEnv(gym.Env):
|
|
|
604
607
|
terminated = False
|
|
605
608
|
info.update(
|
|
606
609
|
{
|
|
607
|
-
"pos": self.agent.pos,
|
|
608
|
-
"mdp_view": topdown if topdown is not None else observation,
|
|
610
|
+
"pos": np.array([self.agent.pos[0], self.agent.pos[2]]),
|
|
609
611
|
}
|
|
610
612
|
)
|
|
611
613
|
|
|
@@ -46,6 +46,7 @@ class GridRoomsEnvironment(UnifiedMiniWorldEnv):
|
|
|
46
46
|
agent_mode: Optional[str] = None,
|
|
47
47
|
obs_width: int = DEFAULT_OBS_WIDTH,
|
|
48
48
|
obs_height: int = DEFAULT_OBS_HEIGHT,
|
|
49
|
+
render_mode=None,
|
|
49
50
|
**kwargs,
|
|
50
51
|
):
|
|
51
52
|
"""
|
|
@@ -64,6 +65,7 @@ class GridRoomsEnvironment(UnifiedMiniWorldEnv):
|
|
|
64
65
|
agent_mode: Agent rendering mode ('triangle', 'circle', 'empty')
|
|
65
66
|
obs_width: Observation width in pixels (defaults to DEFAULT_OBS_WIDTH)
|
|
66
67
|
obs_height: Observation height in pixels (defaults to DEFAULT_OBS_HEIGHT)
|
|
68
|
+
render_mode: Render mode ("human", "rgb_array", or None)
|
|
67
69
|
**kwargs: Additional arguments passed to parent class
|
|
68
70
|
"""
|
|
69
71
|
|
|
@@ -120,6 +122,7 @@ class GridRoomsEnvironment(UnifiedMiniWorldEnv):
|
|
|
120
122
|
agent_mode=self.agent_mode,
|
|
121
123
|
obs_width=obs_width,
|
|
122
124
|
obs_height=obs_height,
|
|
125
|
+
render_mode=render_mode,
|
|
123
126
|
**kwargs,
|
|
124
127
|
)
|
|
125
128
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: miniworld-maze
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Multi-room maze environments from the DrStrategy paper. Provides NineRooms-v0, SpiralNineRooms-v0, and TwentyFiveRooms-v0 gymnasium environments.
|
|
5
5
|
Keywords: reinforcement-learning,environment,gymnasium,multi-room-maze,drstrategy,maze-navigation,partial-observability,3d-environments
|
|
6
6
|
Author: Tim Joseph
|
|
@@ -3,7 +3,7 @@ miniworld_maze/core/__init__.py,sha256=5BA4WKXQjrG55TNaEid2JGrnf1KQniJZ1HhRqovM1
|
|
|
3
3
|
miniworld_maze/core/constants.py,sha256=UXqmuvsT9ww1GljW74lWPPP9XxVmvti-8JfM_RBSoWQ,4314
|
|
4
4
|
miniworld_maze/core/miniworld_gymnasium/README.md,sha256=kkZgkRKBdgixpot3uHuiBFlRIKRFIVBVfXwu68XTEv0,74
|
|
5
5
|
miniworld_maze/core/miniworld_gymnasium/__init__.py,sha256=ALOqr4SCVk9I9bmxyoU0Du8LUPE_57jIyZuV4QhOcBc,159
|
|
6
|
-
miniworld_maze/core/miniworld_gymnasium/base_env.py,sha256=
|
|
6
|
+
miniworld_maze/core/miniworld_gymnasium/base_env.py,sha256=K2L5r4gG2k4fEknFqRJ7f-b2S0Uj5QhanS-MLi6ncVc,1927
|
|
7
7
|
miniworld_maze/core/miniworld_gymnasium/entities/__init__.py,sha256=gbMJcFeasvlRSIuXWyOYO-MhW0JKKY5ZNxF5TMsWJ5c,262
|
|
8
8
|
miniworld_maze/core/miniworld_gymnasium/entities/agent.py,sha256=U3Zt2Hk21rJSdzPCBj46-N930n7XAkA9qo_fKbezn2k,3153
|
|
9
9
|
miniworld_maze/core/miniworld_gymnasium/entities/base_entity.py,sha256=ox2k3rf64Y2mp4S0mcpNpPUg0QeUuJ7LVoduvBuLXDg,3657
|
|
@@ -260,18 +260,18 @@ miniworld_maze/core/miniworld_gymnasium/textures/white_1.png,sha256=wRrgs92I_Ids
|
|
|
260
260
|
miniworld_maze/core/miniworld_gymnasium/textures/wood_1.png,sha256=XRZyIN34HFo14olbxRcsHGrzCAFqUlowc6nLR22IFBE,184713
|
|
261
261
|
miniworld_maze/core/miniworld_gymnasium/textures/wood_2.png,sha256=qSDHB-ZO11JJLQuiQse-0edpbuTg1YO-eIBhdTvNUhc,93121
|
|
262
262
|
miniworld_maze/core/miniworld_gymnasium/textures/wood_planks_1.png,sha256=E4SNN1s4yOtkLfZFQy905eip6KvDWnnPUrpS82FxMAg,847259
|
|
263
|
-
miniworld_maze/core/miniworld_gymnasium/unified_env.py,sha256=
|
|
263
|
+
miniworld_maze/core/miniworld_gymnasium/unified_env.py,sha256=_xkznGIzXQpZOULgK-XFZaXZbhsouEupByf-4cfZLZc,46607
|
|
264
264
|
miniworld_maze/core/miniworld_gymnasium/utils.py,sha256=9cfpg4qYz-Esxvu8nTMPFJc-Tl0TRxTrX6cfg0YuK_o,1007
|
|
265
265
|
miniworld_maze/core/miniworld_gymnasium/wrappers.py,sha256=cD0nGSJYNU96zoWv63aEiKd986POhtHfGGEpNpRL5ec,122
|
|
266
266
|
miniworld_maze/core/observation_types.py,sha256=Co8mEIXzIgk0MLx6tqeBd1EE0PuZOL1gbZwobiEde08,1316
|
|
267
267
|
miniworld_maze/environments/__init__.py,sha256=DKld5MQU7x9eNL6BlxIettA44bCiIn2zIpYECDCNxoQ,331
|
|
268
|
-
miniworld_maze/environments/base_grid_rooms.py,sha256
|
|
268
|
+
miniworld_maze/environments/base_grid_rooms.py,sha256=--tm6t9cHn444xJX9N3Md-4YApK38a2dQi7mnggevbI,14885
|
|
269
269
|
miniworld_maze/environments/factory.py,sha256=Zk26JawsMgSLMgvSnQxFhQCD8yMH76HgqFtogzWFfqY,1333
|
|
270
270
|
miniworld_maze/environments/nine_rooms.py,sha256=Ct96cKtSt1_nLNI5RBUhwqdNUQq1rHfBJ3aB5Igbdow,1794
|
|
271
271
|
miniworld_maze/environments/spiral_nine_rooms.py,sha256=a_pUuv-ghez8h76Z7YsHkQoLXsQ-w9azKLjEjO4uKmA,1749
|
|
272
272
|
miniworld_maze/environments/twenty_five_rooms.py,sha256=MewKPDHDilscQGTT3aGRrSHvo4uFgHHAOrnJMrHaezQ,2598
|
|
273
273
|
miniworld_maze/tools/__init__.py,sha256=XiReXrJIcBKvDVyPZrKPq1mckJs0_WC7q_RmdXXcKHs,55
|
|
274
274
|
miniworld_maze/utils.py,sha256=HTOkfRq72oOC844gVXjWMH1ox7wdSxfCS6oTrWBw05Q,7523
|
|
275
|
-
miniworld_maze-1.
|
|
276
|
-
miniworld_maze-1.
|
|
277
|
-
miniworld_maze-1.
|
|
275
|
+
miniworld_maze-1.3.1.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
|
|
276
|
+
miniworld_maze-1.3.1.dist-info/METADATA,sha256=P-TEotub0dhvLm08sS1HWkRQWqF3HDzXOlUpVEPyPQs,9657
|
|
277
|
+
miniworld_maze-1.3.1.dist-info/RECORD,,
|
|
File without changes
|