garage.envs.grid_world_env
¶
Simple 2D Grid environment.
- MAPS¶
- class GridWorldEnv(desc='4x4', max_episode_length=None)¶
Bases:
garage.Environment
A simply 2D grid environment.
‘S’ : starting point‘F’ or ‘.’: free space‘W’ or ‘x’: wall‘H’ or ‘o’: hole (terminates episode)‘G’ : goal- property action_space¶
The action space specification.
- Type
akro.Space
- property observation_space¶
The observation space specification.
- Type
akro.Space
- reset()¶
Resets the environment.
- Returns
- The first observation conforming to
observation_space.
- dict: The episode-level information.
Note that this is not part of env_info provided in step(). It contains information of he entire episode, which could be needed to determine the first action (e.g. in the case of goal-conditioned or MTRL.)
- Return type
numpy.ndarray
- step(action)¶
Steps the environment.
action map: 0: left 1: down 2: right 3: up
- Parameters
action (int) – an int encoding the action
- Returns
The environment step resulting from the action.
- Return type
- Raises
RuntimeError – if step() is called after the environment has been constructed and reset() has not been called.
NotImplementedError – if a next step in self._desc does not match known state type.
- render(mode)¶
Renders the environment.
- Parameters
mode (str) – the mode to render with. The string must be present in Environment.render_modes.
- visualize()¶
Creates a visualization of the environment.
- close()¶
Close the env.