Class ClipAction<TObs, TAct>
Clips every action into the env's Box bounds before the env sees it, as Gymnasium's ClipAction does;
the wrapper's own action space is unbounded (Box(-inf, inf) of the same shape and dtype), since any action
is accepted.
public class ClipAction<TObs, TAct> : TransformAction<TObs, NDArray, TAct>, IDynamicAttributes, IWrapper, IEnv, IDisposable, IRecordConstructorArgs
Type Parameters
TObsThe observation type, passed through.
TActThe env's action type: arrays (NDArray, or object holding them).
- Inheritance
-
ActionWrapper<TObs, NDArray, TAct>TransformAction<TObs, NDArray, TAct>ClipAction<TObs, TAct>
- Implements
- Inherited Members
- Extension Methods
Remarks
The clip is NumPy's np.clip(action, low, high) with the env's bounds, so its dtype follows NumPy's promotion
of the action with the bounds. Each step's action is a new array.
Reference: gymnasium/wrappers/transform_action.py.
Constructors
ClipAction(Env<TObs, TAct>)
Wraps env.
public ClipAction(Env<TObs, TAct> env)
Parameters
envEnv<TObs, TAct>The env; its action space must be a
Box.
Exceptions
ClipAction(Env<TObs, TAct>, ClipActionOptions)
Builds the instance from its options record: the properties set, the constructor's defaults for the rest.
public ClipAction(Env<TObs, TAct> env, ClipActionOptions options)
Parameters
envEnv<TObs, TAct>The env to wrap.
optionsClipActionOptionsThe options.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.