Class Walker2dInfoV4
- Namespace
- Gym.Environments.Envs.MuJoCo
- Assembly
- Gym.Environments.dll
Walker2d-v4's info (Walker2dEnvV4), typed (DR-91): a step's two keys; a v4 reset sends {}.
public sealed record Walker2dInfoV4 : MujocoInfo, IEquatable<EnvInfo>, IEquatable<MujocoInfo>, IEquatable<Walker2dInfoV4>
- Inheritance
-
Walker2dInfoV4
- Implements
- Inherited Members
- Extension Methods
Constructors
Walker2dInfoV4(double?, double?)
Walker2d-v4's info (Walker2dEnvV4), typed (DR-91): a step's two keys; a v4 reset sends {}.
public Walker2dInfoV4(double? XPosition, double? XVelocity)
Parameters
XPositiondouble?The torso's x position after the step (
x_position).XVelocitydouble?The x velocity over the step (
x_velocity).
Properties
XPosition
The torso's x position after the step (x_position).
public double? XPosition { get; init; }
Property Value
XVelocity
The x velocity over the step (x_velocity).
public double? XVelocity { get; init; }
Property Value
Methods
Equals(Walker2dInfoV4?)
Record equality (DR-92): the members compare as Python's == compares them (PyEquality), arrays by value; the dict inside takes no part.
public bool Equals(Walker2dInfoV4? other)
Parameters
otherWalker2dInfoV4The other record.
Returns
GetHashCode()
A hash consistent with Equals(object): the member count, as array members have no value hash.
public override int GetHashCode()
Returns
- int
The hash.
ToInfoCore()
The members as a new dict by Python name, in declaration order, a null member's key left out.
protected override Info ToInfoCore()
Returns
- Info
A new dict.
ToString()
Python's repr of the info dict (ToInfo()): {'x_position': np.float64(0.1), ...}.
public override string ToString()
Returns
- string
The text.
Operators
implicit operator Info(Walker2dInfoV4)
The record as an info dict (EnvInfo.ToInfo): the dict it was read from, the env's values kept, else its members by Python name.
public static implicit operator Info(Walker2dInfoV4 value)
Parameters
valueWalker2dInfoV4The record.
Returns
- Info
A new dict; array values are shared, not copied.
Exceptions
- ArgumentNullException
Thrown when
valueis null.
implicit operator Walker2dInfoV4(Info)
The typed record of an env's info dict (DR-91): each member read with InfoExtensions.Get<T>'s conversions,
a nullable member null when its key is absent; the record keeps the dict, whose values its indexer reads.
public static implicit operator Walker2dInfoV4(Info value)
Parameters
valueInfoThe info dict, typically
step.Info; the record shares it.
Returns
- Walker2dInfoV4
The record.
Exceptions
- ArgumentNullException
Thrown when
valueis null.- KeyError
Thrown, with Python's message, when the key of a member that is not nullable is missing.
- InvalidCastException
Thrown when a value cannot be read as its member's type.
- OverflowException
Thrown when an integer does not fit its member's type.