rlmesh::spaces::Space
A space: a spec plus its sampler. Copies share the handle, so two copies drive one RNG.
class SpaceConstructors
Static methods
Methods
- raw()
const RLMeshSpace* raw() const - spec()
SpaceSpec spec() const - kind()A space converts to its spec (Dict's children are specs).
- shape()A space converts to its spec (Dict's children are specs).
- dtype()A space converts to its spec (Dict's children are specs).
- seed()Restart the stream from
seed(OS entropy when empty); returns the seed. - sample()Restart the stream from
seed(OS entropy when empty); returns the seed. - contains()Restart the stream from
seed(OS entropy when empty); returns the seed. - to_string()
std::string to_string() const - as_box()
inline std::optional<Box> as_box() const - as_discrete()
inline std::optional<Discrete> as_discrete() const - as_dict()
inline std::optional<Dict> as_dict() const
Operators
Space
constructor[source]Space(const Space& other)Space
constructor[source]Space(Space&& other) noexceptSpace
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() constspec
method[source]SpaceSpec spec() constkind
method[source]SpaceKind kind() constA space converts to its spec (Dict’s children are specs).
shape
method[source]std::vector<int64_t> shape() constA space converts to its spec (Dict’s children are specs).
dtype
method[source]DType dtype() constA space converts to its spec (Dict’s children are specs).
seed
method[source]uint64_t seed(std::optional<uint64_t> seed = std::nullopt) constRestart the stream from seed (OS entropy when empty); returns the seed.
sample
method[source]Value sample() constRestart the stream from seed (OS entropy when empty); returns the seed.
contains
method[source]bool contains(const Value& value) constRestart the stream from seed (OS entropy when empty); returns the seed.
to_string
method[source]std::string to_string() constas_box
method[source]inline std::optional<Box> as_box() constas_discrete
method[source]inline std::optional<Discrete> as_discrete() constas_dict
method[source]inline std::optional<Dict> as_dict() constoperator SpaceSpec
operator[source]operator SpaceSpec() constA space converts to its spec (Dict’s children are specs).