mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-01 06:07:08 +00:00
Fixes the documentation through ignoring tabular/CliffWalking (#443)
This commit is contained in:
@@ -17,6 +17,7 @@ exclude_env_names = [
|
|||||||
"phys2d/CartPole",
|
"phys2d/CartPole",
|
||||||
"phys2d/Pendulum",
|
"phys2d/Pendulum",
|
||||||
"tabular/Blackjack",
|
"tabular/Blackjack",
|
||||||
|
"tabular/CliffWalking",
|
||||||
]
|
]
|
||||||
for env_spec in gym.registry.values():
|
for env_spec in gym.registry.values():
|
||||||
if get_env_id(env_spec.namespace, env_spec.name, None) not in exclude_env_names:
|
if get_env_id(env_spec.namespace, env_spec.name, None) not in exclude_env_names:
|
||||||
|
@@ -20,7 +20,6 @@ from gymnasium.wrappers import HumanRendering
|
|||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import numpy
|
|
||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ class RenderStateType(NamedTuple):
|
|||||||
shape: tuple[int, int]
|
shape: tuple[int, int]
|
||||||
nS: int
|
nS: int
|
||||||
cell_size: tuple[int, int]
|
cell_size: tuple[int, int]
|
||||||
cliff: numpy.ndarray
|
cliff: np.ndarray
|
||||||
elf_images: tuple[pygame.Surface, pygame.Surface, pygame.Surface, pygame.Surface]
|
elf_images: tuple[pygame.Surface, pygame.Surface, pygame.Surface, pygame.Surface]
|
||||||
start_img: pygame.Surface
|
start_img: pygame.Surface
|
||||||
goal_img: pygame.Surface
|
goal_img: pygame.Surface
|
||||||
@@ -176,12 +175,11 @@ class CliffWalkingFunctional(
|
|||||||
|
|
||||||
return new_state
|
return new_state
|
||||||
|
|
||||||
def initial(self, rng: PRNGKey):
|
def initial(self, rng: PRNGKey) -> EnvState:
|
||||||
"""Cliffwalking initial observation function."""
|
"""Cliffwalking initial observation function."""
|
||||||
player_position = jnp.array([3, 0])
|
player_position = jnp.array([3, 0])
|
||||||
|
|
||||||
state = EnvState(player_position=player_position, last_action=-1, fallen=False)
|
state = EnvState(player_position=player_position, last_action=-1, fallen=False)
|
||||||
|
|
||||||
return state
|
return state
|
||||||
|
|
||||||
def observation(self, state: EnvState) -> int:
|
def observation(self, state: EnvState) -> int:
|
||||||
|
Reference in New Issue
Block a user