Skip to content

FDictSpace

A struct representing a dictionary of named sub-spaces.

A dictionary space contains multiple named sub-spaces, allowing for complex hierarchical structures. This is useful when observations or actions have multiple distinct components that need to be organized by name, such as “camera”, “velocity”, “position”, etc.

struct FDictSpace : public FSpace

Methods

FDictSpace

FDictSpace()

Constructs an empty DictSpace.


FDictSpace

inline FDictSpace(const TMap<FString, TInstancedStruct<FSpace>> &InSpaces)

Constructs a DictSpace with the given map of sub-spaces.

Parameters

  • InSpaces (const TMap<FString, TInstancedStruct<FSpace>>)

Num

int Num()

Gets the number of sub-spaces in this dictionary.


GetNumDimensions

virtual int GetNumDimensions() const override

Gets the number of dimensions in this dictionary space.


IsEmpty

virtual bool IsEmpty() const override

Checks if this space is empty.


GetFlattenedSize

virtual int GetFlattenedSize() const override

Gets the total flattened size of all sub-spaces.


Validate

virtual ESpaceValidationResult
Validate(const TInstancedStruct<FPoint> &InPoint) const override

Validates that a point conforms to this space.

Parameters

  • InPoint (const TInstancedStruct<FPoint>)

Accept

inline virtual void Accept(SpaceVisitor &InVisitor)

Accepts a mutable visitor for the visitor pattern.

Parameters

  • InVisitor (SpaceVisitor)

Accept

inline virtual void Accept(ConstSpaceVisitor &InVisitor) const

Accepts a const visitor for the visitor pattern.

Parameters

  • InVisitor (ConstSpaceVisitor)

Attributes

Spaces

TMap<FString, TInstancedStruct<FSpace>> Spaces

The map of named sub-spaces in this dictionary.

Source: Source/Schola/Public/Spaces/DictSpace.h