garage.envs.task_name_wrapper
¶
Wrapper for adding an environment info to track task ID.
- class TaskNameWrapper(env, *, task_name=None, task_id=None)¶
Bases:
garage.Wrapper
Add task_name or task_id to env infos.
- Parameters
- property action_space¶
The action space specification.
- Type
akro.Space
- property observation_space¶
The observation space specification.
- Type
akro.Space
- property unwrapped¶
The inner environment.
- Type
- step(action)¶
gym.Env step for the active task env.
- Parameters
action (np.ndarray) – Action performed by the agent in the environment.
- Returns
np.ndarray: Agent’s observation of the current environment. float: Amount of reward yielded by previous action. bool: True iff the episode has ended. dict[str, np.ndarray]: Contains auxiliary diagnostic
information about this time-step.
- Return type
- reset()¶
Reset the wrapped env.
- 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
- render(mode)¶
Render the wrapped environment.
- visualize()¶
Creates a visualization of the wrapped environment.
- close()¶
Close the wrapped env.