Skip to content

Struct FBoxSpace

Struct FBoxSpace

  • Defined in File BoxSpace.h

Inheritance Relationships

Base Type

struct FBoxSpace : public FSpace

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

Dependencies: ConstSpaceVisitor, FBoxPoint, FBoxSpaceDimension, FPoint, SpaceVisitor

A struct representing a box (continuous) space of possible observations or actions.

A BoxSpace is a Cartesian product of BoxSpaceDimensions, where each dimension defines a continuous range with upper and lower bounds. This is commonly used for continuous control problems where actions or observations are real-valued vectors within specified ranges.


Public Functions

SymbolDetails
FBoxSpaceConstructs an empty BoxSpace with no dimensions.
FBoxSpaceConstructs a BoxSpace with the given bounds arrays.
FBoxSpaceConstructs a BoxSpace from an array of BoxSpaceDimensions.
FBoxSpaceConstructs a BoxSpace from initializer lists.
FBoxSpaceConstructs a BoxSpace with a specific shape and uninitialized dimensions.
CopyCopies the contents of another BoxSpace into this one.
GetNormalizedObservationSpaceGets a normalized version of this BoxSpace with all dimensions in [0, 1].
~FBoxSpaceVirtual destructor.
AddAdds a dimension to this BoxSpace.
AddAdds a dimension to this BoxSpace.
GetNumDimensionsGets the number of dimensions in this space.
GetFlattenedSizeGets the flattened size of this space.
IsEmptyChecks if this space is empty.
ValidateValidates that a point conforms to this space.
AcceptAccepts a mutable visitor for the visitor pattern.
AcceptAccepts a const visitor for the visitor pattern.
NormalizeObservationNormalizes an observation in this space to the range [0, 1].

FBoxSpace

FBoxSpace()

Constructs an empty BoxSpace with no dimensions.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

FBoxSpace

FBoxSpace(const TArray<float> &Low, const TArray<float> &High,
const TArray<int> &Shape = TArray<int>())

Constructs a BoxSpace with the given bounds arrays.

Parameters

  • Low – [in] Array representing the lower bound of each dimension.

  • High – [in] Array representing the upper bound of each dimension.

  • Shape – [in] Optional dimensional shape for multi-dimensional structure.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

FBoxSpace

FBoxSpace(const TArray<FBoxSpaceDimension> &Dimensions,
const TArray<int> &Shape = TArray<int>())

Constructs a BoxSpace from an array of BoxSpaceDimensions.

Parameters

  • Dimensions – [in] Array of BoxSpaceDimensions defining the space bounds.

  • Shape – [in] Optional dimensional shape for multi-dimensional structure.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

FBoxSpace

FBoxSpace(std::initializer_list<float> Low, std::initializer_list<float> High,
std::initializer_list<int> Shape = std::initializer_list<int>())

Constructs a BoxSpace from initializer lists.

Parameters

  • Low – [in] Initializer list of lower bounds.

  • High – [in] Initializer list of upper bounds.

  • Shape – [in] Optional initializer list defining the dimensional shape.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

FBoxSpace

FBoxSpace(const TArray<int> &Shape)

Constructs a BoxSpace with a specific shape and uninitialized dimensions.

Parameters

Shape – [in] The dimensional shape to preallocate.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

Copy

void Copy(const FBoxSpace &Other)

Copies the contents of another BoxSpace into this one.

Parameters

Other – [in] The BoxSpace to copy from.

#DirectionNameTypeDescription
1Otherconst FBoxSpace &The BoxSpace to copy from.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

GetNormalizedObservationSpace

FBoxSpace GetNormalizedObservationSpace() const

Gets a normalized version of this BoxSpace with all dimensions in [0, 1].

Returns:

A new BoxSpace with all dimensions normalized.

Attributes: const

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp


~FBoxSpace

virtual ~FBoxSpace()

Virtual destructor.

Attributes: virtual

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

Add

void Add(float Low, float High)

Adds a dimension to this BoxSpace.

Parameters

  • Low – [in] The lower bound of the new dimension.

  • High – [in] The upper bound of the new dimension.

#DirectionNameTypeDescription
1LowfloatThe lower bound of the new dimension.
2HighfloatThe upper bound of the new dimension.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

Add

void Add(const FBoxSpaceDimension &Dimension)

Adds a dimension to this BoxSpace.

Parameters

Dimension – [in] The BoxSpaceDimension to add.

#DirectionNameTypeDescription
1LowfloatThe lower bound of the new dimension.
2HighfloatThe upper bound of the new dimension.

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

GetNumDimensions

virtual int GetNumDimensions() const override

Gets the number of dimensions in this space.

Returns:

The number of dimensions.

Attributes: const, virtual

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

GetFlattenedSize

virtual int GetFlattenedSize() const override

Gets the flattened size of this space.

Returns:

The total number of scalar values.

Attributes: const, virtual

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

IsEmpty

virtual bool IsEmpty() const override

Checks if this space is empty.

Returns:

True if empty, false otherwise.

Attributes: const, virtual

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

Validate

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

Validates that a point conforms to this space.

Parameters

Point – [in] The point to validate.

Returns:

Validation result indicating success or failure reason.

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

Attributes: const, virtual

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp

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/BoxSpace.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/BoxSpace.h

NormalizeObservation

FBoxPoint NormalizeObservation(const FBoxPoint &Observation) const

Normalizes an observation in this space to the range [0, 1].

Parameters

Observation – [in] The observation to normalize.

Returns:

A new BoxPoint with the normalized observation.

#DirectionNameTypeDescription
1Observationconst FBoxPoint &The observation to normalize.

Attributes: const

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

Implementation: Source/Schola/Private/Common/Spaces/BoxSpace.cpp


Public Members

SymbolDetails
DimensionsThe dimensions of this BoxSpace.
ShapeThe shape of the Box Space.

Dimensions

TArray<FBoxSpaceDimension> Dimensions = TArray<FBoxSpaceDimension>()

The dimensions of this BoxSpace.

Each dimension defines a continuous range with low and high bounds.


Shape

TArray<int> Shape = TArray<int>()

The shape of the Box Space.

If empty, uses a 1D array for the Dimensions. Otherwise defines the multi-dimensional structure of the space.