Class ActionWrapper<TObs, TWAct, TAct>
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
TObsThe observation type, passed through.
TWActThe action type the wrapper takes.
TActThe env's action type.
- 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
envEnv<TObs, TAct>The env whose actions are transformed.
Exceptions
Methods
Action(TWAct)
The transformation (action(action)).
public abstract TAct Action(TWAct action)
Parameters
actionTWActThe 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
actionTWActThe wrapper's action.
Returns
- StepResult<TObs>
The env's transition.