Table of Contents

Class TransformActionVector<TObs, TWAct, TAct>

Namespace
Gym.Wrappers.Vector
Assembly
Gym.dll

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

TObs

The batched observation type, passed through.

TWAct

The wrapper's batched action type.

TAct

The 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

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

env VectorEnv<TObs, TAct>

The vector env.

func Func<TWAct, TAct>

The function from the wrapper's actions to the env's.

actionSpace Space<TWAct>

The wrapper's batched space, or null.

singleActionSpace Space

The wrapper's single space, or null.

Exceptions

TypeError

Thrown when env is null, or a space does not hold TWAct.

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

actions TWAct

The wrapper's batched actions.

Returns

TAct

The env's batched actions.