Struct FBoxSpace
- struct FBoxSpace : public FSpace
-
A struct representing a box(continuous) space of possible observations or actions.
A BoxSpace is a Cartesian product of BoxSpaceDimensions. Each dimension is a continuous space.
Public Functions
- FBoxSpace(TArray<float> &Low, TArray<float> &High, const TArray<int> &Shape = TArray<int>())
-
Construct a BoxSpace with the given bounds.
Note
Low and High must have the same length
- Parameters:
-
-
Low – [in] An array representing the the lower bound of each dimension
-
High – [in] An array representing the the upper bound of each dimension
-
- FBoxSpace(TArray<FBoxSpaceDimension> &Dimensions, const TArray<int> &Shape = TArray<int>())
-
Construct a BoxSpace with the given bounds.
- Parameters:
-
Dimensions – [in] An array of BoxSpaceDimensions
- FBoxSpace(std::initializer_list<float> Low, std::initializer_list<float> High, std::initializer_list<int> Shape = std::initializer_list<int>())
-
Construct a BoxSpace from an initializer list of Low, and an initializer list of High values.
- Parameters:
-
-
Low – [in] The initializer list of lower bounds
-
High – [in] The initializer list of upper bounds
-
- FBoxSpace(const TArray<int> &Shape)
-
Construct an empty BoxSpace with a preallocated number of uninitialized dimensions.
- Parameters:
-
Shape – [in] The shape of the BoxSpace, preallocated with uninitialized dimensions
- void Copy(const FBoxSpace &Other)
-
Copy constructor.
- Parameters:
-
Other – [in] The BoxSpace to copy
- FBoxSpace GetNormalizedObservationSpace() const
-
Get the normalized version of this BoxSpace.
- Returns:
-
A BoxSpace with all dimensions normalized to [0, 1]
- void FillProtobuf(BoxSpace *Msg) const
-
Fill a protobuf message with the data from this BoxSpace.
- Parameters:
-
Msg – [in] A ptr to the protobuf message to fill
- void FillProtobuf(BoxSpace &Msg) const
-
Fill a protobuf message with the data from this BoxSpace.
- Parameters:
-
Msg – [in] A ref to the protobuf message to fill
- void Add(float Low, float High)
-
Add a dimension to this BoxSpace.
- Parameters:
-
-
Low – [in] The lower bound of the dimension
-
High – [in] The upper bound of the dimension
-
- void Add(const FBoxSpaceDimension &Dimension)
-
Add a dimension to this BoxSpace.
- Parameters:
-
Dimension – [in] The BoxSpaceDimension to add
- virtual void FillProtobuf(FundamentalSpace *Msg) const override
-
Fill a protobuf message with the data from this space.
- Parameters:
-
Msg – [in] The protobuf message to fill
- virtual int GetNumDimensions() const override
-
Get the number of dimensions in this space.
- Returns:
-
The number of dimensions in this space
- virtual ESpaceValidationResult Validate(TPoint &Observation) const override
-
Test if an observation is in this space.
- Parameters:
-
Observation – [in] The observation to validate
- Returns:
-
An enum indicating the result of the validation
- virtual int GetFlattenedSize() const override
-
Get the size of the flattened representation of this space.
- Returns:
-
The size of the flattened representation of this space
- virtual bool IsEmpty() const override
-
Check if this space is empty.
- Returns:
-
True if this space is empty, false otherwise
- virtual TPoint MakeTPoint() const override
-
Create a TPoint from this space.
- Returns:
-
A TPoint belonging to this space, with correctly set variant type.
- FBoxPoint NormalizeObservation(const FBoxPoint &Observation) const
-
Convert an observation in this space to one in the normalized equivalent space.
- Parameters:
-
Observation – [inout] The observation to normalize
- Returns:
-
A Box point in the normalized space.
Public Members
- TArray<FBoxSpaceDimension> Dimensions = TArray<FBoxSpaceDimension>()
-
The dimensions of this BoxSpace.