Class AntInfoV4
- Namespace
- Gym.Environments.Envs.MuJoCo
- Assembly
- Gym.Environments.dll
Ant-v4's info (AntEnvV4), typed (DR-91): a step's nine keys; a v4 reset sends {}, so every member is nullable.
public sealed record AntInfoV4 : MujocoInfo, IEquatable<EnvInfo>, IEquatable<MujocoInfo>, IEquatable<AntInfoV4>
- Inheritance
-
AntInfoV4
- Implements
- Inherited Members
- Extension Methods
Constructors
AntInfoV4(double?, double?, double?, double?, double?, double?, double?, double?, double?)
Ant-v4's info (AntEnvV4), typed (DR-91): a step's nine keys; a v4 reset sends {}, so every member is nullable.
public AntInfoV4(double? RewardForward, double? RewardCtrl, double? RewardSurvive, double? XPosition, double? YPosition, double? DistanceFromOrigin, double? XVelocity, double? YVelocity, double? ForwardReward)
Parameters
RewardForwarddouble?The forward term of the reward, the weighted x velocity (
reward_forward).RewardCtrldouble?The control term, the negative weighted squared action, or the negative contact cost with
use_contact_forces(reward_ctrl, as v4 overwrites it).RewardSurvivedouble?The healthy term (
reward_survive), given every step in v4.XPositiondouble?The torso's x position after the step (
x_position).YPositiondouble?The torso's y position after the step (
y_position).DistanceFromOrigindouble?The torso's distance from the origin in the x-y plane (
distance_from_origin).XVelocitydouble?The torso's x velocity over the step (
x_velocity).YVelocitydouble?The torso's y velocity over the step (
y_velocity).ForwardRewarddouble?The forward term again (
forward_reward), the value ofRewardForward; v5 drops it.
Properties
DistanceFromOrigin
The torso's distance from the origin in the x-y plane (distance_from_origin).
public double? DistanceFromOrigin { get; init; }
Property Value
ForwardReward
The forward term again (forward_reward), the value of RewardForward; v5 drops it.
public double? ForwardReward { get; init; }
Property Value
RewardCtrl
The control term, the negative weighted squared action, or the negative contact cost with use_contact_forces (reward_ctrl, as v4 overwrites it).
public double? RewardCtrl { get; init; }
Property Value
RewardForward
The forward term of the reward, the weighted x velocity (reward_forward).
public double? RewardForward { get; init; }
Property Value
RewardSurvive
The healthy term (reward_survive), given every step in v4.
public double? RewardSurvive { get; init; }
Property Value
XPosition
The torso's x position after the step (x_position).
public double? XPosition { get; init; }
Property Value
XVelocity
The torso's x velocity over the step (x_velocity).
public double? XVelocity { get; init; }
Property Value
YPosition
The torso's y position after the step (y_position).
public double? YPosition { get; init; }
Property Value
YVelocity
The torso's y velocity over the step (y_velocity).
public double? YVelocity { get; init; }
Property Value
Methods
Equals(AntInfoV4?)
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(AntInfoV4? other)
Parameters
otherAntInfoV4The 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(AntInfoV4)
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(AntInfoV4 value)
Parameters
valueAntInfoV4The record.
Returns
- Info
A new dict; array values are shared, not copied.
Exceptions
- ArgumentNullException
Thrown when
valueis null.
implicit operator AntInfoV4(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 AntInfoV4(Info value)
Parameters
valueInfoThe info dict, typically
step.Info; the record shares it.
Returns
- AntInfoV4
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.