rlstructures.env_wrappers package

OpenAI Gym Wrappers

class rlstructures.env_wrappers.gymenv.GymEnv(gym_env=None, seed=None)[source]

Bases: rlstructures.env.VecEnv

A wrapper for gym env

close()[source]

Terminate the environment

n_envs()[source]

Returns the number of environment instances contained in this env :rtype: int

reset(env_info=<rlstructures.core.DictTensor object>)[source]

reset the environments instances

Parameters

env_info (DictTensor, optional) – a DictTensor of size n_envs, such that each value will be transmitted to each environment instance

specs_input()[source]
step(policy_output)[source]

Execute one step over alll the running environment instances

Parameters

policy_output (DictTensor) – the output given by the policy

Returns

see general description

Return type

[[DictTensor,torch.Tensor],[DictTensor,torch.Tensor]]

class rlstructures.env_wrappers.gymenv.GymEnvInf(gym_env=None, seed=None)[source]

Bases: rlstructures.env.VecEnv

A wrapper for gym env that automaitcally reset each stopping instance

close()[source]

Terminate the environment

n_envs()[source]

Returns the number of environment instances contained in this env :rtype: int

reset(env_info=<rlstructures.core.DictTensor object>)[source]

reset the environments instances

Parameters

env_info (DictTensor, optional) – a DictTensor of size n_envs, such that each value will be transmitted to each environment instance

specs_input()[source]
step(policy_output)[source]

Execute one step over alll the running environment instances

Parameters

policy_output (DictTensor) – the output given by the policy

Returns

see general description

Return type

[[DictTensor,torch.Tensor],[DictTensor,torch.Tensor]]

rlstructures.env_wrappers.gymenv.format_frame(frame)[source]