Table of Contents

Class RecordConstructorArgs

Namespace
Gym.Utils
Assembly
Gym.dll

The recording half of Python's RecordConstructorArgs.init, for IRecordConstructorArgs implementers.

public static class RecordConstructorArgs
Inheritance
RecordConstructorArgs
Inherited Members

Methods

Record(IEnumerable<KeyValuePair<string, object?>>, bool)

Builds the record a wrapper stores as SavedKwargs: the arguments, deep-copied unless disabled, so later changes to an argument object do not change the record. Gymnasium's equivalent is RecordConstructorArgs.init(self, *, _disable_deepcopy=False, **kwargs).

public static Info Record(IEnumerable<KeyValuePair<string, object?>> kwargs, bool disableDeepcopy = false)

Parameters

kwargs IEnumerable<KeyValuePair<string, object>>

The arguments by parameter name, in Python spelling and order.

disableDeepcopy bool

Store the argument values as they are (Python's _disable_deepcopy).

Returns

Info

The record to assign.

Remarks

Python keeps the first call's record ("always call RecordConstructorArgs.init before the Class.init"), so a subclass that records before calling its base's init wins. C# runs the base constructor first, so the equivalent rule is that every constructor assigns the record and the most derived one, running last, overwrites the others: assign unconditionally. Reference: gymnasium/utils/record_constructor.py.

Exceptions

ArgumentNullException

Thrown when kwargs is null.