Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
1aa736b
add pygame GUI for frozen_lake.py env
younik Jan 21, 2022
73a9e6b
add new line at EOF
younik Jan 21, 2022
c9a359a
pre-commit reformat
younik Jan 24, 2022
354830c
improve graphics
younik Jan 28, 2022
95258f5
new images and dynamic window size
younik Feb 1, 2022
a121b7b
darker tile borders and fix ICC profile
younik Feb 2, 2022
91f3a03
pre-commit hook
younik Feb 2, 2022
6f56feb
adjust elf and stool size
younik Feb 3, 2022
0abec2f
Update frozen_lake.py
jkterry1 Feb 3, 2022
ad87dbc
reformat
younik Feb 5, 2022
48c22fe
Merge branch 'openai:master' into master
younik Feb 7, 2022
6c38481
fix #2600
younik Feb 7, 2022
2649a1c
#2600
younik Feb 7, 2022
c2da74a
add rgb_array support
younik Feb 8, 2022
45a3154
reformat
younik Feb 8, 2022
db9ba2f
Merge branch 'master' into master
younik Feb 10, 2022
9711282
test render api change on FrozenLake
younik Mar 4, 2022
cd85df4
add render support for reset on frozenlake
younik Mar 5, 2022
1beba40
Merge branch 'render_api'
younik Mar 5, 2022
15d9321
add clock on pygame render
younik Mar 5, 2022
3089e57
new render api for blackjack
younik Mar 5, 2022
fad0f6f
new render api for cliffwalking
younik Mar 5, 2022
ffd9fc8
new render api for Env class
younik Mar 5, 2022
5140dc9
update reset method, lunar and Env
younik Mar 5, 2022
311ac82
fix wrapper
younik Mar 5, 2022
1197a36
fix reset lunar
younik Mar 5, 2022
da77145
new render api for box2d envs
younik Mar 5, 2022
18fe379
new render api for mujoco envs
younik Mar 6, 2022
d586394
fix bug
younik Mar 6, 2022
b078647
new render api for classic control envs
younik Mar 6, 2022
415449c
fix tests
younik Mar 9, 2022
9363aa0
add render_mode None for CartPole
younik Mar 10, 2022
11ab948
Merge branch 'master' into master
younik Mar 10, 2022
4912778
new render api for test fake envs
younik Mar 10, 2022
d5107d4
Merge remote-tracking branch 'origin/master'
younik Mar 10, 2022
98ab069
pre-commit hook
younik Mar 10, 2022
e06d293
fix FrozenLake
younik Mar 10, 2022
6fab5a2
fix FrozenLake
younik Mar 10, 2022
0f970ff
more render_mode to super - frozenlake
younik Mar 11, 2022
9999527
Merge remote-tracking branch 'origin/master'
younik Mar 11, 2022
f945184
Merge branch 'master' into master
younik Mar 11, 2022
4771755
remove kwargs from frozen_lake new
younik Mar 11, 2022
b458f4f
Merge remote-tracking branch 'origin/master'
younik Mar 11, 2022
1f5ddf1
pre-commit hook
younik Mar 11, 2022
96b3a7a
solve conflicts
younik Mar 17, 2022
64dcf77
add deprecated render method
younik Mar 23, 2022
5601778
Merge branch 'master' into master
younik Apr 2, 2022
cffacd7
Merge remote-tracking branch 'origin/master'
younik Apr 2, 2022
9570f30
add backwards compatibility
younik Apr 4, 2022
4345b21
fix test
younik Apr 4, 2022
99c6680
add _render
younik Apr 5, 2022
8ad9ed7
Merge branch 'master' into master
younik Apr 8, 2022
765c014
move pygame.init() (avoid pygame dependency on init)
younik Apr 8, 2022
45cbabd
fix pygame dependencies
younik Apr 8, 2022
7b13622
Merge branch 'master' into master
younik Apr 9, 2022
f53aa27
remove collect_render() maintain multi-behaviours .render()
younik Apr 19, 2022
4d76fe1
Merge remote-tracking branch 'origin/master'
younik Apr 19, 2022
2ab1824
Merge branch 'master' into master
younik Apr 19, 2022
343f72a
add type hints
younik Apr 21, 2022
c4bfe84
fix renderer
younik Apr 21, 2022
2b0ca9a
don't call .render() with None
younik Apr 21, 2022
0869ee7
improve docstring
younik Apr 21, 2022
d08b80d
add single_rgb_array to all envs
younik Apr 25, 2022
c7156bd
remove None from metadata["render_modes"]
younik Apr 25, 2022
e8e3c26
Merge branch 'master' into master
younik Apr 25, 2022
3a2f9b6
add type hints to test_env_checkers
younik Apr 25, 2022
a3ac176
Merge remote-tracking branch 'origin/master'
younik Apr 25, 2022
66b0c23
fix lint
younik Apr 25, 2022
ff4aff3
add comments to renderer
younik Apr 26, 2022
e0753ef
add comments to single_depth_array and single_state_pixels
younik Apr 30, 2022
3a961a3
Merge branch 'master' into master
younik Apr 30, 2022
07cf336
reformat
younik Apr 30, 2022
694220d
add deprecation warnings and env.render_mode declaration
younik May 7, 2022
9d04c6a
fix lint
younik May 7, 2022
52268f9
reformat
younik May 7, 2022
a0a409f
fix tests
younik May 7, 2022
d319228
Merge branch 'master' of https://github.com/openai/gym
younik May 23, 2022
ba01803
add docs
younik May 23, 2022
ce8d471
fix car racing determinism
younik May 23, 2022
f6a0c42
remove warning test envs, customizable modes on renderer
younik Jun 2, 2022
11d2260
remove commments and add todo for env_checker
younik Jun 3, 2022
7efffb8
fix car racing
younik Jun 3, 2022
5fe6e80
replace render mode check with assert
younik Jun 3, 2022
e4dc18c
Merge remote-tracking branch 'openai-gym/master'
younik Jun 3, 2022
0a979cc
update new mujoco
younik Jun 3, 2022
69326af
reformat
younik Jun 3, 2022
c220b4a
Merge remote-tracking branch 'openai-gym/master'
younik Jun 3, 2022
efda297
reformat
younik Jun 3, 2022
edb2c7a
change metaclass definition
younik Jun 4, 2022
88da572
Merge remote-tracking branch 'openai-gym/master'
younik Jun 4, 2022
540019c
fix tests
younik Jun 5, 2022
6c55c7b
implement mark suggestions (test, docs, sets)
younik Jun 6, 2022
34b8d08
Merge remote-tracking branch 'openai-gym/master'
younik Jun 6, 2022
bdb3220
check_render
younik Jun 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'openai-gym/master'
# Conflicts:
#	gym/core.py
#	gym/envs/toy_text/cliffwalking.py
#	gym/envs/toy_text/frozen_lake.py
#	gym/wrappers/monitoring/video_recorder.py
#	gym/wrappers/pixel_observation.py
  • Loading branch information
younik committed Jun 3, 2022
commit c220b4a55d799a77d264d930cb596a07b3beb324
3 changes: 2 additions & 1 deletion gym/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Core API for Environment, Wrapper, ActionWrapper, RewardWrapper and ObservationWrapper."""
import sys
from typing import Generic, Optional, SupportsFloat, Tuple, TypeVar, Union
from __future__ import annotations

from abc import abstractmethod
Expand Down Expand Up @@ -179,7 +181,6 @@ def reset(
if seed is not None:
self._np_random, seed = seeding.np_random(seed)

@abstractmethod
# TODO: remove kwarg mode with gym 1.0
def render(self, mode="human") -> Optional[Union[RenderFrame, List[RenderFrame]]]:
"""Compute the render frames as specified by render_mode attribute during initialization of the environment.
Expand Down
8 changes: 2 additions & 6 deletions gym/envs/toy_text/cliffwalking.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ def __init__(self, render_mode: Optional[str] = None):
self.render_mode = render_mode
self.renderer = Renderer(self.render_mode, self._render)

def _limit_coordinates(self, coord):
"""
Prevent the agent from falling out of the grid world
:param coord:
:return:
"""
def _limit_coordinates(self, coord: np.ndarray) -> np.ndarray:
"""Prevent the agent from falling out of the grid world."""
coord[0] = min(coord[0], self.shape[0] - 1)
coord[0] = max(coord[0], 0)
coord[1] = min(coord[1], self.shape[1] - 1)
Expand Down
21 changes: 19 additions & 2 deletions gym/envs/toy_text/frozen_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,39 +73,53 @@ def is_valid(res):

class FrozenLakeEnv(Env):
"""
Frozen lake involves crossing a frozen lake from Start(S) to Goal(G) without falling into any Holes(H) by walking over
the Frozen(F) lake. The agent may not always move in the intended direction due to the slippery nature of the frozen lake.
Frozen lake involves crossing a frozen lake from Start(S) to Goal(G) without falling into any Holes(H)
by walking over the Frozen(F) lake.
The agent may not always move in the intended direction due to the slippery nature of the frozen lake.


### Action Space
The agent takes a 1-element vector for actions.
The action space is `(dir)`, where `dir` decides direction to move in which can be:

- 0: LEFT
- 1: DOWN
- 2: RIGHT
- 3: UP

### Observation Space
The observation is a value representing the agent's current position as
current_row * nrows + current_col (where both the row and col start at 0).
For example, the goal position in the 4x4 map can be calculated as follows: 3 * 4 + 3 = 15.
The number of possible observations is dependent on the size of the map.
For example, the 4x4 map has 16 possible observations.

### Rewards

Reward schedule:
- Reach goal(G): +1
- Reach hole(H): 0
- Reach frozen(F): 0

### Arguments

```
gym.make('FrozenLake-v1', desc=None,map_name="4x4", is_slippery=True)
```

`desc`: Used to specify custom map for frozen lake. For example,

desc=["SFFF", "FHFH", "FFFH", "HFFG"].

`map_name`: ID to use any of the preloaded maps.

"4x4":[
"SFFF",
"FHFH",
"FFFH",
"HFFG"
]

"8x8": [
"SFFFFFFF",
"FFFFFFFF",
Expand All @@ -116,13 +130,16 @@ class FrozenLakeEnv(Env):
"FHFFHFHF",
"FFFHFFFG",
]

`is_slippery`: True/False. If True will move in intended direction with
probability of 1/3 else will move in either perpendicular direction with
equal probability of 1/3 in both directions.

For example, if action is left and is_slippery is True, then:
- P(move left)=1/3
- P(move up)=1/3
- P(move down)=1/3

### Version History
* v1: Bug fixes to rewards
* v0: Initial versions release (1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion gym/wrappers/pixel_observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import collections
import copy
from collections.abc import MutableMapping
from typing import Any, List, Optional
from typing import Any, Dict, List, Optional, Tuple

import numpy as np

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.