Class TransformActionVector<TObs, TWAct, TAct>
Applies one function to the whole batch of actions, as Gymnasium's vector TransformAction does; give the
spaces when the function's input differs from the env's actions.
[PyName("TransformAction")]
public class TransformActionVector<TObs, TWAct, TAct> : VectorActionWrapper<TObs, TWAct, TAct>, IVectorEnv, IDisposable
Type Parameters
TObsThe batched observation type, passed through.
TWActThe wrapper's batched action type.
TActThe env's batched action type.
- Inheritance
-
VectorEnv<TObs, TWAct>VectorWrapper<TObs, TWAct, TObs, TAct>VectorActionWrapper<TObs, TWAct, TAct>TransformActionVector<TObs, TWAct, TAct>
- Implements
- Inherited Members
- Extension Methods
Remarks
Reference: gymnasium/wrappers/vector/vectorize_action.py.
Constructors
TransformActionVector(VectorEnv<TObs, TAct>, Func<TWAct, TAct>, Space<TWAct>?, Space?)
Wraps env.
public TransformActionVector(VectorEnv<TObs, TAct> env, Func<TWAct, TAct> func, Space<TWAct>? actionSpace = null, Space? singleActionSpace = null)
Parameters
envVectorEnv<TObs, TAct>The vector env.
funcFunc<TWAct, TAct>The function from the wrapper's actions to the env's.
actionSpaceSpace<TWAct>The wrapper's batched space, or null.
singleActionSpaceSpaceThe wrapper's single space, or null.
Exceptions
Properties
Func
The function of the batched actions (func).
public Func<TWAct, TAct> Func { get; set; }
Property Value
- Func<TWAct, TAct>
Methods
Actions(TWAct)
Applies Func to the batch.
public override TAct Actions(TWAct actions)
Parameters
actionsTWActThe wrapper's batched actions.
Returns
- TAct
The env's batched actions.