rescue-gridworld 1.0.0__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.
- rescue_gridworld-1.0.0/PKG-INFO +88 -0
- rescue_gridworld-1.0.0/README.md +72 -0
- rescue_gridworld-1.0.0/pyproject.toml +31 -0
- rescue_gridworld-1.0.0/rescue_gridworld/__init__.py +11 -0
- rescue_gridworld-1.0.0/rescue_gridworld/env.py +1474 -0
- rescue_gridworld-1.0.0/rescue_gridworld/env_constants.py +48 -0
- rescue_gridworld-1.0.0/rescue_gridworld.egg-info/PKG-INFO +88 -0
- rescue_gridworld-1.0.0/rescue_gridworld.egg-info/SOURCES.txt +10 -0
- rescue_gridworld-1.0.0/rescue_gridworld.egg-info/dependency_links.txt +1 -0
- rescue_gridworld-1.0.0/rescue_gridworld.egg-info/requires.txt +3 -0
- rescue_gridworld-1.0.0/rescue_gridworld.egg-info/top_level.txt +1 -0
- rescue_gridworld-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rescue_gridworld
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A procedural gridworld maze requiring completion of temporally extended tasks.
|
|
5
|
+
Author-email: Andy Edmondson <Andy.Edmondson@ed.ac.uk>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Levinin/rescue_gridworld_env
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/Levinin/rescue_gridworld_env/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: gymnasium
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: pygame
|
|
16
|
+
|
|
17
|
+
# Rescue Gridworld
|
|
18
|
+
|
|
19
|
+
This environment provides a Search and Rescue gridworld where the objective is to rescue all the people from the maze. To achieve this requires completion of a temporally extended sequence of tasks as follows.
|
|
20
|
+
|
|
21
|
+
Exploration of the maze, opening locked doors to progress. Unlocking a door requires completion of the subtask sequence *collect key* -> *unlock cupboard* -> *collect keycard* -> *unlock door*.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
```bash
|
|
25
|
+
pip install .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
You can run a random agent to test the environment:
|
|
30
|
+
```bash
|
|
31
|
+
python run_random_agent.py --render --steps 1000 --rooms 5
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Manual Usage
|
|
35
|
+
```python
|
|
36
|
+
import gymnasium as gym
|
|
37
|
+
import rescue_gridworld
|
|
38
|
+
|
|
39
|
+
env = gym.make("RescueGridworld-v0", render_mode="human", num_rooms=5)
|
|
40
|
+
obs, info = env.reset()
|
|
41
|
+
# ... step the env ...
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Action Space
|
|
45
|
+
|
|
46
|
+
There are 9 actions in the environment:
|
|
47
|
+
- 0: Move up.
|
|
48
|
+
- 1: Move down.
|
|
49
|
+
- 2: Move left.
|
|
50
|
+
- 3: Move right.
|
|
51
|
+
- 4: Collect key.
|
|
52
|
+
- 5: Unlock cupboard.
|
|
53
|
+
- 6: Collect keycard.
|
|
54
|
+
- 7: Unlock door.
|
|
55
|
+
- 8: Talk to person.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Observation Space
|
|
59
|
+
|
|
60
|
+
The observation provides 2 7x7 "windows".
|
|
61
|
+
- The first is a line-of-sight observation of the local environment.
|
|
62
|
+
- The second is a line-of-sight filtered set of "chain id's".
|
|
63
|
+
|
|
64
|
+
The Python definitions are as follows to allow the grid to be viewed as an image.:
|
|
65
|
+
```python
|
|
66
|
+
self.observation_space = spaces.Dict(
|
|
67
|
+
{
|
|
68
|
+
"grid": spaces.Box(low=0, high=255, shape=(1, 7, 7), dtype=np.uint8),
|
|
69
|
+
"chain_grid": spaces.Box(low=-2, high=500, shape=(1, 7, 7), dtype=np.int16),
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Rewards
|
|
79
|
+
|
|
80
|
+
Reward of 5 is given for completion of subtasks:
|
|
81
|
+
- Collect key.
|
|
82
|
+
- Unlock cupboard.
|
|
83
|
+
- Collect keycard.
|
|
84
|
+
- Unlock door.
|
|
85
|
+
- Talk to person.
|
|
86
|
+
- Exit.
|
|
87
|
+
|
|
88
|
+
An additional reward of 50 is given if all people have been saved before exiting.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Rescue Gridworld
|
|
2
|
+
|
|
3
|
+
This environment provides a Search and Rescue gridworld where the objective is to rescue all the people from the maze. To achieve this requires completion of a temporally extended sequence of tasks as follows.
|
|
4
|
+
|
|
5
|
+
Exploration of the maze, opening locked doors to progress. Unlocking a door requires completion of the subtask sequence *collect key* -> *unlock cupboard* -> *collect keycard* -> *unlock door*.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
```bash
|
|
9
|
+
pip install .
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
You can run a random agent to test the environment:
|
|
14
|
+
```bash
|
|
15
|
+
python run_random_agent.py --render --steps 1000 --rooms 5
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Manual Usage
|
|
19
|
+
```python
|
|
20
|
+
import gymnasium as gym
|
|
21
|
+
import rescue_gridworld
|
|
22
|
+
|
|
23
|
+
env = gym.make("RescueGridworld-v0", render_mode="human", num_rooms=5)
|
|
24
|
+
obs, info = env.reset()
|
|
25
|
+
# ... step the env ...
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Action Space
|
|
29
|
+
|
|
30
|
+
There are 9 actions in the environment:
|
|
31
|
+
- 0: Move up.
|
|
32
|
+
- 1: Move down.
|
|
33
|
+
- 2: Move left.
|
|
34
|
+
- 3: Move right.
|
|
35
|
+
- 4: Collect key.
|
|
36
|
+
- 5: Unlock cupboard.
|
|
37
|
+
- 6: Collect keycard.
|
|
38
|
+
- 7: Unlock door.
|
|
39
|
+
- 8: Talk to person.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Observation Space
|
|
43
|
+
|
|
44
|
+
The observation provides 2 7x7 "windows".
|
|
45
|
+
- The first is a line-of-sight observation of the local environment.
|
|
46
|
+
- The second is a line-of-sight filtered set of "chain id's".
|
|
47
|
+
|
|
48
|
+
The Python definitions are as follows to allow the grid to be viewed as an image.:
|
|
49
|
+
```python
|
|
50
|
+
self.observation_space = spaces.Dict(
|
|
51
|
+
{
|
|
52
|
+
"grid": spaces.Box(low=0, high=255, shape=(1, 7, 7), dtype=np.uint8),
|
|
53
|
+
"chain_grid": spaces.Box(low=-2, high=500, shape=(1, 7, 7), dtype=np.int16),
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## Rewards
|
|
63
|
+
|
|
64
|
+
Reward of 5 is given for completion of subtasks:
|
|
65
|
+
- Collect key.
|
|
66
|
+
- Unlock cupboard.
|
|
67
|
+
- Collect keycard.
|
|
68
|
+
- Unlock door.
|
|
69
|
+
- Talk to person.
|
|
70
|
+
- Exit.
|
|
71
|
+
|
|
72
|
+
An additional reward of 50 is given if all people have been saved before exiting.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rescue_gridworld"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Andy Edmondson", email="Andy.Edmondson@ed.ac.uk" },
|
|
10
|
+
]
|
|
11
|
+
description = "A procedural gridworld maze requiring completion of temporally extended tasks."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"gymnasium",
|
|
21
|
+
"numpy",
|
|
22
|
+
"pygame",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
"Homepage" = "https://github.com/Levinin/rescue_gridworld_env"
|
|
27
|
+
"Bug Tracker" = "https://github.com/Levinin/rescue_gridworld_env/issues"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["."]
|
|
31
|
+
include = ["rescue_gridworld*"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from gymnasium.envs.registration import register
|
|
2
|
+
from .env_constants import *
|
|
3
|
+
from .env import RescueGridworldEnv
|
|
4
|
+
|
|
5
|
+
# Register the environment
|
|
6
|
+
register(
|
|
7
|
+
id="RescueGridworld-v0",
|
|
8
|
+
entry_point="rescue_gridworld.env:RescueGridworldEnv",
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = ["RescueGridworldEnv"]
|