garage.envs.point_env
¶
Simple 2D environment containing a point and a goal location.
- class PointEnv(goal=np.array((1.0, 1.0), dtype=np.float32), arena_size=5.0, done_bonus=0.0, never_done=False, max_episode_length=math.inf)¶
Bases:
garage.Environment
A simple 2D point environment.
- 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
max_episode_length (int) – The maximum steps allowed for an episode.
- property action_space¶
The action space specification.
- Type
akro.Space
- property observation_space¶
The observation space specification.
- Type
akro.Space
- reset()¶
Reset 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)¶
Step the environment.
- Parameters
action (np.ndarray) – An action provided by the agent.
- 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.
- render(mode)¶
Renders the environment.
- visualize()¶
Creates a visualization of the environment.
- close()¶
Close the env.
- sample_tasks(num_tasks)¶
Sample a list of num_tasks tasks.