Table of Contents

Class ActionWrapper<TObs, TWAct, TAct>

Namespace
Gym.Envs
Assembly
Gym.dll

Transforms every action through Action(TWAct) before the env sees it. If the wrapper takes actions from another space, assign it to ActionSpace in the constructor.

public abstract class ActionWrapper<TObs, TWAct, TAct> : Wrapper<TObs, TWAct, TObs, TAct>, IDynamicAttributes, IWrapper, IEnv, IDisposable

Type Parameters

TObs

The observation type, passed through.

TWAct

The action type the wrapper takes.

TAct

The env's action type.

Inheritance
Env<TObs, TWAct>
Wrapper<TObs, TWAct, TObs, TAct>
ActionWrapper<TObs, TWAct, TAct>
Implements
Derived
Inherited Members
Extension Methods

Remarks

Reference: gymnasium/core.py.

Constructors

ActionWrapper(Env<TObs, TAct>)

Wraps env.

protected ActionWrapper(Env<TObs, TAct> env)

Parameters

env Env<TObs, TAct>

The env whose actions are transformed.

Exceptions

TypeError

Thrown when env is null.

Methods

Action(TWAct)

The transformation (action(action)).

public abstract TAct Action(TWAct action)

Parameters

action TWAct

The wrapper's action.

Returns

TAct

The action for the env, an element of the env's action space.

Step(TWAct)

Steps the env with the transformed action (self.env.step(self.action(action))).

public override StepResult<TObs> Step(TWAct action)

Parameters

action TWAct

The wrapper's action.

Returns

StepResult<TObs>

The env's transition.