Skip to content

Struct FSpace

Struct FSpace

  • Defined in File Space.h

Inheritance Relationships

Derived Types

struct FSpace

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

Dependencies: ConstSpaceVisitor, FPoint, SpaceVisitor

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


Public Functions

SymbolDetails
GetNumDimensionsGets the number of dimensions in this space.
IsEmptyChecks if this space is empty.
ValidateTests if a point is valid for this space.
GetFlattenedSizeGets the size of the flattened representation of this space.
~FSpaceVirtual destructor.
AcceptAccepts a mutable visitor for the visitor pattern.
AcceptAccepts a const visitor for the visitor pattern.

GetNumDimensions

inline virtual int GetNumDimensions() const

Gets the number of dimensions in this space.

Returns:

The number of dimensions.

Attributes: inline, const, virtual

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

IsEmpty

inline virtual bool IsEmpty() const

Checks if this space is empty.

Returns:

True if the space is empty, false otherwise.

Attributes: inline, const, virtual

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

Validate

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

Tests if a point is valid for this space.

Validates that the point conforms to all constraints defined by this space, including correct dimensions, value ranges, and data type.

Parameters

InPoint – [in] The point to validate.

Returns:

A validation result indicating success or the type of failure.

#DirectionNameTypeDescription
1InPointconst TInstancedStruct< FPoint > &The point to validate.

Attributes: inline, const, virtual

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

GetFlattenedSize

inline virtual int GetFlattenedSize() const

Gets the size of the flattened representation of this space.

Returns the total number of scalar values when all dimensions are flattened into a single vector.

Returns:

The flattened size.

Attributes: inline, const, virtual

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


~FSpace

virtual ~FSpace() = default

Virtual destructor.

Attributes: virtual

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

Accept

inline virtual void Accept(SpaceVisitor &InVisitor)

Accepts a mutable visitor for the visitor pattern.

Parameters

InVisitor – [inout] The visitor to accept.

#DirectionNameTypeDescription
1InVisitorSpaceVisitor &The visitor to accept.

Attributes: inline, virtual

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

Accept

inline virtual void Accept(ConstSpaceVisitor &InVisitor) const

Accepts a const visitor for the visitor pattern.

Parameters

InVisitor – [inout] The const visitor to accept.

#DirectionNameTypeDescription
1InVisitorSpaceVisitor &The visitor to accept.

Attributes: inline, virtual

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