Class PusherEnvV4
- Namespace
- Gym.Environments.Envs.MuJoCo
- Assembly
- Gym.Environments.dll
Pusher-v4: refuses to be built, with Gymnasium's ImportError. Gymnasium supports this version only on MuJoCo
below 3 (Gymnasium issue #950), so on MuJoCo 3 and later its constructor raises before anything else, and Gym.NET's
engine follows MuJoCo 4.0.0 (DR-64). Pusher-v5 is the pusher to use.
[PyName("PusherEnv")]
public class PusherEnvV4 : MujocoEnv, IEnv, IDisposable, IDynamicAttributes
- Inheritance
-
PusherEnvV4
- Implements
- Inherited Members
- Extension Methods
Remarks
The class is an env so that Pusher-v4 registers and make("Pusher-v4") fails exactly as
Gymnasium's does, at construction (DR-61).
Reference: gymnasium/envs/mujoco/pusher_v4.py.
Constructors
PusherEnvV4(PusherEnvV4Options)
Builds the instance from its options record: the properties set, the constructor's defaults for the rest.
public PusherEnvV4(PusherEnvV4Options options)
Parameters
optionsPusherEnvV4OptionsThe options.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.
PusherEnvV4(RenderMode, int, int, int?, string?, int, IReadOnlyDictionary<int, bool>?, EnvViewerFactory?)
Builds the env with the render mode given as the RenderMode enum (DR-84, DR-93), as
PusherEnvV4(string?, int, int, int?, string?, int, IReadOnlyDictionary<int, bool>?, EnvViewerFactory?)
builds it from the mode's string: new PusherEnvV4(RenderMode.RgbArray) builds what
new PusherEnvV4(renderMode: "rgb_array") builds, the member reaching the env as Gymnasium's string
(Name(RenderMode)), which its RenderMode property then holds.
public PusherEnvV4(RenderMode renderMode, int width = 480, int height = 480, int? cameraId = null, string? cameraName = null, int maxGeom = 1000, IReadOnlyDictionary<int, bool>? visualOptions = null, EnvViewerFactory? viewerFactory = null)
Parameters
renderModeRenderModeThe render mode, which the env must list in its
metadata["render_modes"]as for the string; it behaves exactly as its Gymnasium string does in the other constructor.widthintThe rendered frame's width; never used.
heightintThe rendered frame's height; never used.
cameraIdint?The camera id; never used.
cameraNamestringThe camera name; never used.
maxGeomintThe most geoms a frame draws; never used.
visualOptionsIReadOnlyDictionary<int, bool>MuJoCo visual flags; never used.
viewerFactoryEnvViewerFactoryGym.NET's
viewer_factory; never used.
Remarks
The mode is required and comes first, so new PusherEnvV4() keeps meaning the other constructor, without a
mode; leave the mode out there for no rendering. Every other parameter means what it means there.
Exceptions
- ArgumentOutOfRangeException
Thrown for a value RenderMode does not declare (a cast integer such as
(RenderMode)99).- ImportError
Always, with Gymnasium's message.
PusherEnvV4(string?, int, int, int?, string?, int, IReadOnlyDictionary<int, bool>?, EnvViewerFactory?)
Always refuses (Gymnasium's PusherEnv.init on MuJoCo 3 and later), before any model is loaded.
public PusherEnvV4(string? renderMode = null, int width = 480, int height = 480, int? cameraId = null, string? cameraName = null, int maxGeom = 1000, IReadOnlyDictionary<int, bool>? visualOptions = null, EnvViewerFactory? viewerFactory = null)
Parameters
renderModestringGymnasium's
render_mode; never used.widthintThe rendered frame's width; never used.
heightintThe rendered frame's height; never used.
cameraIdint?The camera id; never used.
cameraNamestringThe camera name; never used.
maxGeomintThe most geoms a frame draws; never used.
visualOptionsIReadOnlyDictionary<int, bool>MuJoCo visual flags; never used.
viewerFactoryEnvViewerFactoryGym.NET's
viewer_factory; never used.
Exceptions
- ImportError
Always, with Gymnasium's message.
Properties
ClassMetadata
Gymnasium's class attribute metadata: the four render modes at 20 frames per second. A new dict on every read.
public static Metadata ClassMetadata { get; }
Property Value
Methods
ResetModel()
Never runs: no instance can exist.
protected override NDArray ResetModel()
Returns
- NDArray
Never returns.
Exceptions
- ImportError
Always, with Gymnasium's message.
Step(NDArray)
Never runs: no instance can exist.
public override StepResult<NDArray> Step(NDArray action)
Parameters
actionNDArrayThe action.
Returns
- StepResult<NDArray>
Never returns.
Exceptions
- ImportError
Always, with Gymnasium's message.