Class AutoresetModes
Python's view of AutoresetMode's members (DR-84): their .name, .value, str and
repr, Gymnasium's AutoresetMode(value) call, and the reading of a vector env's autoreset_mode
argument. A C# enum cannot carry members of its own, so they live here, beside it.
public static class AutoresetModes
- Inheritance
-
AutoresetModes
- Inherited Members
Remarks
Reference: gymnasium/vector/vector_env.py.
Properties
All
Every member, in Gymnasium's order: NEXT_STEP, SAME_STEP, DISABLED (list(AutoresetMode)).
public static IReadOnlyList<AutoresetMode> All { get; }
Property Value
Remarks
A shared, read-only list.
Methods
From(object?)
The member an argument stands for, as Gymnasium's vector envs read their autoreset_mode
(mode if isinstance(mode, AutoresetMode) else AutoresetMode(mode)).
public static AutoresetMode From(object? mode)
Parameters
Returns
- AutoresetMode
The member.
Exceptions
- ValueError
Thrown for a string no member has as its value, a member the enum does not declare (a cast integer), or another kind of value (Python's
Enumlookup fails for it too):'x' is not a valid AutoresetMode.
Name(AutoresetMode)
Python's .name: NEXT_STEP, SAME_STEP or DISABLED.
public static string Name(AutoresetMode mode)
Parameters
modeAutoresetModeThe member.
Returns
- string
The name.
Exceptions
- ArgumentOutOfRangeException
Thrown for a value the enum does not declare.
Of(string?)
Python's AutoresetMode(value): the member with that value. Only the value is accepted ("NextStep"),
not the Python name ("NEXT_STEP") nor the C# one, as Python's Enum call accepts values only.
public static AutoresetMode Of(string? value)
Parameters
valuestringThe value.
Returns
- AutoresetMode
The member.
Exceptions
- ValueError
Thrown for any other value:
'x' is not a valid AutoresetMode.
Repr(AutoresetMode)
Python's repr(mode): <AutoresetMode.NEXT_STEP: 'NextStep'>, what a printed metadata dict shows.
public static string Repr(AutoresetMode mode)
Parameters
modeAutoresetModeThe member.
Returns
- string
The text.
Exceptions
- ArgumentOutOfRangeException
Thrown for a value the enum does not declare.
Str(AutoresetMode)
Python's str(mode), what an f-string shows: AutoresetMode.SAME_STEP. It differs from the
repr (Repr(AutoresetMode)), which a printed dict shows, so messages that Gymnasium formats with an f-string
use this one.
public static string Str(AutoresetMode mode)
Parameters
modeAutoresetModeThe member.
Returns
- string
The text.
Exceptions
- ArgumentOutOfRangeException
Thrown for a value the enum does not declare.
Value(AutoresetMode)
Python's .value: "NextStep", "SameStep" or "Disabled", what a make_vec spec's kwargs may hold.
public static string Value(AutoresetMode mode)
Parameters
modeAutoresetModeThe member.
Returns
- string
The value.
Exceptions
- ArgumentOutOfRangeException
Thrown for a value the enum does not declare.