Fixes the documentation through ignoring tabular/CliffWalking (#443)

This commit is contained in:
Mark Towers
2023-04-09 11:40:12 +01:00
committed by GitHub
parent 51a735e752
commit f0e5a2e6c3
2 changed files with 3 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ exclude_env_names = [
"phys2d/CartPole",
"phys2d/Pendulum",
"tabular/Blackjack",
"tabular/CliffWalking",
]
for env_spec in gym.registry.values():
if get_env_id(env_spec.namespace, env_spec.name, None) not in exclude_env_names:

View File

@@ -20,7 +20,6 @@ from gymnasium.wrappers import HumanRendering
if TYPE_CHECKING:
import numpy
import pygame
@@ -31,7 +30,7 @@ class RenderStateType(NamedTuple):
shape: tuple[int, int]
nS: int
cell_size: tuple[int, int]
cliff: numpy.ndarray
cliff: np.ndarray
elf_images: tuple[pygame.Surface, pygame.Surface, pygame.Surface, pygame.Surface]
start_img: pygame.Surface
goal_img: pygame.Surface
@@ -176,12 +175,11 @@ class CliffWalkingFunctional(
return new_state
def initial(self, rng: PRNGKey):
def initial(self, rng: PRNGKey) -> EnvState:
"""Cliffwalking initial observation function."""
player_position = jnp.array([3, 0])
state = EnvState(player_position=player_position, last_action=-1, fallen=False)
return state
def observation(self, state: EnvState) -> int: