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
TObsThe observation type.
- Implements
-
IEquatable<DoneStepResult<TObs>>
- Inherited Members
- Extension Methods
Remarks
Equality follows StepResult<TObs>'s. Reference: gymnasium/utils/step_api_compatibility.py (DoneStepType).
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
ObservationTObsThe observation after the action.
RewarddoubleThe reward as float64.
DoneboolWhether the episode ended, for either reason.
InfoInfoDiagnostics;
"TimeLimit.truncated"is true when a time limit, not the MDP, ended it.
Remarks
Equality follows StepResult<TObs>'s. Reference: gymnasium/utils/step_api_compatibility.py (DoneStepType).
Properties
Done
Whether the episode ended, for either reason.
public bool Done { get; init; }
Property Value
Info
Diagnostics; "TimeLimit.truncated" is true when a time limit, not the MDP, ended it.
public Info Info { get; init; }
Property Value
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
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
otherDoneStepResult<TObs>The other transition.
Returns
GetHashCode()
A hash consistent with Equals(DoneStepResult<TObs>).
public override int GetHashCode()
Returns
- int
The hash.