Class VectorizeTransformAction<TObs, TWAct, TAct>
Vectorizes a single-env action transform (Gymnasium's VectorizeTransformAction): the wrapper class is built
over a stand-in env of the single action space, and its function is applied to each sub-env's action.
public class VectorizeTransformAction<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>VectorizeTransformAction<TObs, TWAct, TAct>
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
When the wrapper's batched space equals the env's (same_out), the results are written into the caller's
action batch in place, as in Gymnasium; otherwise into the wrapper's buffer, and a deep copy is passed on.
Reference: gymnasium/wrappers/vector/vectorize_action.py.
Constructors
VectorizeTransformAction(VectorEnv<TObs, TAct>, Type, object?)
Wraps env, building wrapper over its single action space.
public VectorizeTransformAction(VectorEnv<TObs, TAct> env, Type wrapper, object? kwargs = null)
Parameters
envVectorEnv<TObs, TAct>The vector env.
wrapperTypeThe single-env transform wrapper class (
typeof(ClipAction<,>)).kwargsobjectThe wrapper's other arguments by Python name, or null.
Exceptions
- TypeError
Thrown when the class cannot be vectorized or built, or a space does not hold
TWAct.- ValueError
Thrown for what the wrapper's constructor refuses.
Properties
SameOut
Whether the wrapper's batched space equals the env's (same_out).
public bool SameOut { get; }
Property Value
Wrapper
The single-env wrapper whose function is applied (wrapper); owned.
public IEnv Wrapper { get; }
Property Value
Methods
Actions(TWAct)
Each sub-env's action through the wrapper's function, stacked again.
public override TAct Actions(TWAct actions)
Parameters
actionsTWActThe wrapper's batched actions.
Returns
- TAct
The caller's batch filled in place (SameOut), or a deep copy of the wrapper's buffer.
Dispose(bool)
Releases the buffer and the single-env wrapper, then disposes as every vector wrapper does.
protected override void Dispose(bool disposing)