This reference describes unreleased code on main; no release documents it yet.

rlmesh::spaces::Space

classExperimental#include <rlmesh.hpp>[source]

A space: a spec plus its sampler. Copies share the handle, so two copies drive one RNG.

class Space

Space

constructor[source]
Space(const Space& other)

Space

constructor[source]
Space(Space&& other) noexcept

Space

constructor[source]
explicit Space(const SpaceSpec& spec)

from_spec

static method[source]
static Space from_spec(const SpaceSpec& spec)

Space(spec).

adopt

static method[source]
static Space adopt(RLMeshSpace* ptr)

Adopt an owned handle.

raw

method[source]
const RLMeshSpace* raw() const

spec

method[source]
SpaceSpec spec() const

kind

method[source]
SpaceKind kind() const

A space converts to its spec (Dict’s children are specs).

shape

method[source]
std::vector<int64_t> shape() const

A space converts to its spec (Dict’s children are specs).

dtype

method[source]
DType dtype() const

A space converts to its spec (Dict’s children are specs).

seed

method[source]
uint64_t seed(std::optional<uint64_t> seed = std::nullopt) const

Restart the stream from seed (OS entropy when empty); returns the seed.

sample

method[source]
Value sample() const

Restart the stream from seed (OS entropy when empty); returns the seed.

contains

method[source]
bool contains(const Value& value) const

Restart the stream from seed (OS entropy when empty); returns the seed.

to_string

method[source]
std::string to_string() const

as_box

method[source]
inline std::optional<Box> as_box() const

as_discrete

method[source]
inline std::optional<Discrete> as_discrete() const

as_dict

method[source]
inline std::optional<Dict> as_dict() const

operator SpaceSpec

operator[source]
operator SpaceSpec() const

A space converts to its spec (Dict’s children are specs).