habitat.core.env.RLEnv class

Reinforcement Learning (RL) environment class which subclasses gym.Env.

Contents

This is a wrapper over Env for RL users. To create custom RL environments users should subclass RLEnv and define the following methods: get_reward_range(), get_reward(), get_done(), get_info().

As this is a subclass of gym.Env, it implements reset() and step().

Methods

def close(self) -> None
def get_done(self, observations: simulator.Observations) -> bool
Returns boolean indicating whether episode is done after performing the last action.
def get_info(self, observations) -> typing.Dict[typing.Any, typing.Any]
def get_reward(self, observations: simulator.Observations) -> typing.Any
Returns reward after action has been performed.
def get_reward_range(self)
Get min, max range of reward.
def render(self, mode: str = 'rgb') -> numpy.ndarray
def reset(self) -> simulator.Observations
def seed(self, seed: typing.Optional[int] = None) -> None
def step(self, *args, **kwargs) -> typing.Tuple[simulator.Observations, typing.Any, bool, dict]
Perform an action in the environment.

Special methods

def __enter__(self)
def __exit__(self, exc_type, exc_val, exc_tb)
def __init__(self, config: habitat.config.default.Config, dataset: typing.Optional[dataset.Dataset] = None) -> None
Constructor
def __str__(self)

Properties

current_episode: dataset.Episode get
episodes: typing.List[dataset.Episode] get set
habitat_env: Env get
unwrapped get
Completely unwrap this env.

Data

action_space = None
metadata = {'render.modes': []}
observation_space = None
reward_range = (-inf, inf)
spec = None

Method documentation

def habitat.core.env.RLEnv.get_done(self, observations: simulator.Observations) -> bool

Returns boolean indicating whether episode is done after performing the last action.

Parameters
observations observations from simulator and task.
Returns done boolean after performing the last action.

This method is called inside the step method.

def habitat.core.env.RLEnv.get_info(self, observations) -> typing.Dict[typing.Any, typing.Any]

Parameters
observations observations from simulator and task.
Returns info after performing the last action.

def habitat.core.env.RLEnv.get_reward(self, observations: simulator.Observations) -> typing.Any

Returns reward after action has been performed.

Parameters
observations observations from simulator and task.
Returns reward after performing the last action.

This method is called inside the step() method.

def habitat.core.env.RLEnv.get_reward_range(self)

Get min, max range of reward.

Returns [min, max] range of reward.

def habitat.core.env.RLEnv.step(self, *args, **kwargs) -> typing.Tuple[simulator.Observations, typing.Any, bool, dict]

Perform an action in the environment.

Returns (observations, reward, done, info)

def habitat.core.env.RLEnv.__init__(self, config: habitat.config.default.Config, dataset: typing.Optional[dataset.Dataset] = None) -> None

Constructor

Parameters
config config to construct Env
dataset dataset to construct Env.

Property documentation

habitat.core.env.RLEnv.unwrapped get

Completely unwrap this env.

Returns:
gym.Env: The base non-wrapped gym.Env instance