Table of Contents

Struct DoneStepResult<TObs>

Namespace
Gym.Observations
Assembly
Gym.dll

A transition in the pre-0.26 "done" step API, (observation, reward, done, info), which StepApiCompatibility converts to and from StepResult<TObs>. done merges termination and truncation; info["TimeLimit.truncated"] tells them apart.

public readonly record struct DoneStepResult<TObs> : INDArrayCarrier, IDisposable, IEquatable<DoneStepResult<TObs>>

Type Parameters

TObs

The observation type.

Implements
Inherited Members
Extension Methods

Remarks

Constructors

DoneStepResult(TObs, double, bool, Info)

A transition in the pre-0.26 "done" step API, (observation, reward, done, info), which StepApiCompatibility converts to and from StepResult<TObs>. done merges termination and truncation; info["TimeLimit.truncated"] tells them apart.

public DoneStepResult(TObs Observation, double Reward, bool Done, Info Info)

Parameters

Observation TObs

The observation after the action.

Reward double

The reward as float64.

Done bool

Whether the episode ended, for either reason.

Info Info

Diagnostics; "TimeLimit.truncated" is true when a time limit, not the MDP, ended it.

Remarks

Properties

Done

Whether the episode ended, for either reason.

public bool Done { get; init; }

Property Value

bool

Info

Diagnostics; "TimeLimit.truncated" is true when a time limit, not the MDP, ended it.

public Info Info { get; init; }

Property Value

Info

Observation

The observation after the action.

public TObs Observation { get; init; }

Property Value

TObs

Reward

The reward as float64.

public double Reward { get; init; }

Property Value

double

Methods

Dispose()

Releases the observation's and the info's arrays, as Dispose() does.

public void Dispose()

Remarks

Footgun: copies share the arrays; dispose once, after their last use.

Equals(DoneStepResult<TObs>)

Exact equality (see StepResult<TObs>'s remarks).

public bool Equals(DoneStepResult<TObs> other)

Parameters

other DoneStepResult<TObs>

The other transition.

Returns

bool

true when the transitions are equal.

GetHashCode()

A hash consistent with Equals(DoneStepResult<TObs>).

public override int GetHashCode()

Returns

int

The hash.