Table of Contents

Class TaxiInfo

Namespace
Gym.Environments.Envs.ToyText
Assembly
Gym.Environments.dll

Taxi's info (TaxiEnv, Taxi-v4), typed (DR-91): {"prob": ..., "action_mask": ...} on every reset and step.

public sealed record TaxiInfo : ToyTextInfo, IEquatable<EnvInfo>, IEquatable<ToyTextInfo>, IEquatable<TaxiInfo>
Inheritance
TaxiInfo
Implements
Inherited Members
Extension Methods

Constructors

TaxiInfo(double, NDArray)

Taxi's info (TaxiEnv, Taxi-v4), typed (DR-91): {"prob": ..., "action_mask": ...} on every reset and step.

public TaxiInfo(double Prob, NDArray ActionMask)

Parameters

Prob double

The probability of the transition just taken (prob), a Python float, 1.0 unless the taxi is rainy or the passenger fickle.

ActionMask NDArray

Which of the six actions change the state (action_mask): an int8 array of six 0s and 1s, the step result's own array (disposed with it).

Properties

ActionMask

Which of the six actions change the state (action_mask): an int8 array of six 0s and 1s, the step result's own array (disposed with it).

public NDArray ActionMask { get; init; }

Property Value

NDArray

Methods

Equals(TaxiInfo?)

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(TaxiInfo? other)

Parameters

other TaxiInfo

The other record.

Returns

bool

true when the members are equal.

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(TaxiInfo)

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(TaxiInfo value)

Parameters

value TaxiInfo

The record.

Returns

Info

A new dict; array values are shared, not copied.

Exceptions

ArgumentNullException

Thrown when value is null.

implicit operator TaxiInfo(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 TaxiInfo(Info value)

Parameters

value Info

The info dict, typically step.Info; the record shares it.

Returns

TaxiInfo

The record.

Exceptions

ArgumentNullException

Thrown when value is 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.