Class HumanoidStandupEnvV4
- Namespace
- Gym.Environments.Envs.MuJoCo
- Assembly
- Gym.Environments.dll
HumanoidStandup-v4: the lying humanoid of HumanoidStandupEnvV5 with v4's fixed model, frame skip and weights, every body's rows observed (the world's included) and v4's three-entry info. Byte for byte what Gymnasium's HumanoidStandup-v4 computes on MuJoCo 4.0.0 (DR-61, DR-64).
[PyName("HumanoidStandupEnv")]
public class HumanoidStandupEnvV4 : MujocoEnv, IEnv, IDisposable, IDynamicAttributes
- Inheritance
-
HumanoidStandupEnvV4
- Implements
- Inherited Members
- Extension Methods
Remarks
Observation (float64): qpos[2:], the velocities, and the whole cinert, cvel,
qfrc_actuator and cfrc_ext arrays, 376 values. Reward: z / timestep - 0.1 * sum(ctrl**2) -
min(0.5e-6 * sum(cfrc_ext**2), 10) + 1; Python's min returns the int 10 when the impact cost exceeds
it, so the info's reward_impact is then the Python int -10 (a long) instead of an
np.float64, as in Gymnasium. Info: reward_linup, reward_quadctrl, reward_impact;
the reset's info is empty; make warns that the id is out of date.
Not thread-safe. Reference: gymnasium/envs/mujoco/humanoidstandup_v4.py.
Its info reads typed (DR-91): HumanoidStandupInfoV4 info = step.Info; (HumanoidStandupInfoV4), with the dict's own values still behind the indexer.
Constructors
HumanoidStandupEnvV4(HumanoidStandupEnvV4Options)
Builds the instance from its options record: the properties set, the constructor's defaults for the rest.
public HumanoidStandupEnvV4(HumanoidStandupEnvV4Options options)
Parameters
optionsHumanoidStandupEnvV4OptionsThe options.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.
HumanoidStandupEnvV4(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
HumanoidStandupEnvV4(string?, int, int, int?, string?, int, IReadOnlyDictionary<int, bool>?, EnvViewerFactory?)
builds it from the mode's string: new HumanoidStandupEnvV4(RenderMode.RgbArray) builds what
new HumanoidStandupEnvV4(renderMode: "rgb_array") builds, the member reaching the env as Gymnasium's string
(Name(RenderMode)), which its RenderMode property then holds.
public HumanoidStandupEnvV4(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 (
width).heightintThe rendered frame's height (
height).cameraIdint?The camera to render from (
camera_id).cameraNamestringThe camera to render from by name (
camera_name).maxGeomintThe most geoms a frame draws (
max_geom).visualOptionsIReadOnlyDictionary<int, bool>MuJoCo visual flags to switch (
visual_options).viewerFactoryEnvViewerFactoryGym.NET's
viewer_factory(DR-20) forhumanmode.
Remarks
The mode is required and comes first, so new HumanoidStandupEnvV4() 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).- ValueError
Both a camera id and a camera name.
HumanoidStandupEnvV4(string?, int, int, int?, string?, int, IReadOnlyDictionary<int, bool>?, EnvViewerFactory?)
Creates the env (Gymnasium's HumanoidStandupEnv.init): humanoidstandup.xml with a frame skip of 5.
public HumanoidStandupEnvV4(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:human,rgb_array,depth_array,rgbd_tupleor null.widthintThe rendered frame's width (
width).heightintThe rendered frame's height (
height).cameraIdint?The camera to render from (
camera_id).cameraNamestringThe camera to render from by name (
camera_name).maxGeomintThe most geoms a frame draws (
max_geom).visualOptionsIReadOnlyDictionary<int, bool>MuJoCo visual flags to switch (
visual_options).viewerFactoryEnvViewerFactoryGym.NET's
viewer_factory(DR-20) forhumanmode.
Exceptions
- ValueError
Both a camera id and a camera name.
Properties
ClassMetadata
Gymnasium's class attribute metadata: the four render modes at 67 frames per second. A new dict on every read.
public static Metadata ClassMetadata { get; }
Property Value
Methods
ResetModel()
The episode's start (reset_model): positions init_qpos + uniform(-0.01, 0.01, nq), then velocities
init_qvel + uniform(-0.01, 0.01, nv), drawn in that order.
protected override NDArray ResetModel()
Returns
- NDArray
The first observation.
Step(NDArray)
Applies action (Gymnasium's a) for 5 physics steps and reports the transition (step).
public override StepResult<NDArray> Step(NDArray action)
Parameters
actionNDArrayThe 17 controls, any real dtype (stored as float64).
Returns
- StepResult<NDArray>
The observation, the float64 reward,
terminated=False,truncated=Falseand the info.
Exceptions
- ArgumentNullException
actionis null.- ValueError
The action is not of shape
(17,), with Gymnasium's message.