rlmesh.spaces.Dict

classfrom rlmesh.spaces import Dict[source]

Mapping of named child spaces.

Dict(spaces: Mapping[str, Space[Any] | SpaceSpec] | SpaceSpec)

Exposes read-only mapping access over its children, mirroring gymnasium.spaces.Dict: index a child by name (space["obs"]), iterate names (for name in space), test membership ("obs" in space), take len(space), and read keys() / values() / items(). The children are immutable (a MappingProxyType); build a new Dict to change them.

Parameters

NameTypeDescription
spacesMapping[str, Space[Any] | SpaceSpec] | SpaceSpecMapping of child spaces, or an existing native SpaceSpec.

spaces

attribute[source]
spaces: Mapping[str, Space[Value]]

keys

function[source]
keys() -> KeysView[str]

The subspace names.

values

function[source]
values() -> ValuesView[Space[Value]]

The subspaces, in key order.

items

function[source]
items() -> ItemsView[str, Space[Value]]

The (name, subspace) pairs.

spec

property[source]
property spec: SpaceSpec

Native space specification backing this wrapper.

kind

property[source]
property kind: str

Native RLMesh space kind.

shape

property[source]
property shape: list[int]

Native shape for tensor-like spaces.

dtype

property[source]
property dtype: str

Element dtype reported by the native spec.

seed

function[source]
seed(seed: int | None = None) -> int | None

Seed the native sampler for this space.

sample

function[source]
sample() -> OutputT

Sample a value from this space.

contains

function[source]
contains(value: object) -> bool

Return whether a value is contained in this space.

to_gymnasium_space

function[source]
to_gymnasium_space() -> object

Convert this wrapper into a Gymnasium space.