interface#
Classes#
- class prt_rl.env.adapters.interface.AdapterInterface(env: EnvironmentInterface)[source]#
Interface class for environment adapters that adapt an environment to a different interface.
- Parameters:
env (EnvironmentInterface) – The environment to adapt
- get_num_envs() int#
Returns the number of environments in the interface.
- Returns:
Number of environments
- Return type:
- get_parameters()[source]#
Returns the EnvParams object which contains information about the sizes of observations and actions needed for setting up RL agents.
- Returns:
environment parameters object
- Return type:
- reset(*args, **kwargs)[source]#
Resets the environment to the initial state and returns the initial observation.
- Parameters:
seed (int | None) – Sets the random seed.
- Returns:
Tuple of tensors containing the initial observation and info dictionary
- Return type:
Tuple
- step(action)[source]#
Steps the simulation using the action tensor and returns the new trajectory.
- Parameters:
action (torch.Tensor) – Tensor with “action” key that is a tensor with shape (# env, # actions)
- Returns:
Tuple of tensors containing the next state, reward, done, and info dictionary
- Return type:
Tuple