garage.envs.point_env module

Simple 2D environment containing a point and a goal location.

class PointEnv(goal=array([1., 1.], dtype=float32), arena_size=5.0, done_bonus=0.0, never_done=False)[source]

Bases: gym.core.Env

A simple 2D point environment.

observation_space

The observation space

Type:gym.spaces.Box
action_space

The action space

Type:gym.spaces.Box
Parameters:
  • goal (np.ndarray) – A 2D array representing the goal position
  • arena_size (float) – The size of arena where the point is constrained within (-arena_size, arena_size) in each dimension
  • done_bonus (float) – A numerical bonus added to the reward once the point as reached the goal
  • never_done (bool) – Never send a done signal, even if the agent achieves the goal
action_space

The action space.

Type:gym.spaces.Box
observation_space

The observation space.

Type:gym.spaces.Box
render(mode='human')[source]

Draw the environment.

Not implemented.

Parameters:mode (str) – Ignored.
reset()[source]

Reset the environment.

Returns:Observation of the environment.
Return type:np.ndarray
sample_tasks(num_tasks)[source]

Sample a list of num_tasks tasks.

Parameters:num_tasks (int) – Number of tasks to sample.
Returns:
A list of “tasks”, where each task is
a dictionary containing a single key, “goal”, mapping to a point in 2D space.
Return type:list[dict[str, np.ndarray]]
set_task(task)[source]

Reset with a task.

Parameters:task (dict[str, np.ndarray]) – A task (a dictionary containing a single key, “goal”, which should be a point in 2D space).
step(action)[source]

Step the environment state.

Parameters:action (np.ndarray) – The action to take in the environment.
Returns:Observation. The observation of the environment. float: Reward. The reward acquired at this time step. boolean: Done. Whether the environment was completed at this
time step. Always False for this environment.
Return type:np.ndarray