rlmesh.spaces.Discrete
Discrete integer space.
Discrete(
n: int | SpaceSpec,
start: int = 0,
dtype: DiscreteDTypeLike = 'int64',
)Parameters
| Name | Type | Description |
|---|---|---|
n | int | SpaceSpec | Number of values, or an existing native SpaceSpec. |
start | int | First integer value in the space. |
dtype | DiscreteDTypeLike | Integer dtype name: "int64", "int32" or "uint8". |
Attributes
Methods
n
attribute[source]n: intstart
attribute[source]start: intspec
property[source]property spec: SpaceSpecNative space specification backing this wrapper.
kind
property[source]property kind: strNative RLMesh space kind.
shape
property[source]property shape: list[int]Native shape for tensor-like spaces.
dtype
property[source]property dtype: strElement dtype reported by the native spec.
seed
function[source]seed(seed: int | None = None) -> intSeed this space’s sampler and return the seed used.
seed=None draws a fresh seed from OS entropy, applies it and
returns it; an explicit seed restarts the sample stream.
sample
function[source]sample() -> OutputTSample a value from this space.
contains
function[source]contains(value: object) -> boolReturn whether a value is contained in this space.
to_gymnasium_space
function[source]to_gymnasium_space() -> objectConvert this wrapper into a Gymnasium space.