Skip to content

FSpace

Base structure for all space types in the Schola framework.

A space defines the valid structure and range of values for observations or actions in a reinforcement learning system. Spaces specify constraints such as dimensionality, valid value ranges, and data types. This base structure defines the common interface that all concrete space types must implement.

Subclassed by FBoxSpace, FDictSpace, FDiscreteSpace, FMultiBinarySpace, FMultiDiscreteSpace

struct FSpace

Methods

GetNumDimensions

inline virtual int GetNumDimensions() const

Gets the number of dimensions in this space.


IsEmpty

inline virtual bool IsEmpty() const

Checks if this space is empty.


Validate

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

Tests if a point is valid for this space.

Parameters

  • InPoint (const TInstancedStruct<FPoint>)

Contains

inline bool Contains(const TInstancedStruct<FPoint> &InPoint) const

Checks if a point is contained in this space.

Parameters

  • InPoint (const TInstancedStruct<FPoint>)

GetFlattenedSize

inline virtual int GetFlattenedSize() const

Gets the size of the flattened representation of this space.


FSpace

virtual ~FSpace() = default

Virtual destructor.


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)

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