Struct FDictSpace
- struct FDictSpace
-
A struct representing a dictionary of possible observations or actions.
Public Functions
- int Num()
-
Get the number of spaces in this dictionary.
- Returns:
-
The number of spaces in this dictionary
- int GetFlattenedSize() const
-
Get the number of dimensions, of all spaces in this dictionary after flattening.
- Returns:
-
The number of dimensions
- ESpaceValidationResult Validate(FDictPoint &PointMap) const
-
Validate a point in this space, by checking if all of it’s dimensions pass validation.
- Parameters:
-
PointMap – [in] The point to validate
- Returns:
-
An enum indicating the result of the validation
- void NormalizeObservation(FDictPoint &Observations) const
-
Normalize an observation in this space, by normalizing each of it’s dimensions.
- Parameters:
-
Observations – [inout] The observation to normalize
- TSpace &Add(const FString &Key)
-
Create a new empty space in place in this dictionary.
- Parameters:
-
Key – [in] The label of the space
- Returns:
-
A reference to the newly added space
- void Add(const FString &Key, TSpace &Value)
-
Add a preallocated space from a reference to this dictionary.
- Parameters:
-
-
Key – [in] The label of the space
-
Value – [in] The BoxSpace to add
-
- void Add(const FString &Key, FBoxSpace &Value)
-
Add a BoxSpace to this dictionary from a reference.
- Parameters:
-
-
Key – [in] The label of the space
-
Value – [in] The BoxSpace to add
-
- void Add(const FString &Key, FDiscreteSpace &Value)
-
Add a DiscreteSpace to this dictionary from a reference.
- Parameters:
-
-
Key – [in] The label of the space
-
Value – [in] The DiscreteSpace to add
-
- void Add(const FString &Key, FBinarySpace &Value)
-
Add a BinarySpace to this dictionary from a reference.
- Parameters:
-
-
Key – [in] The label of the space
-
Value – [in] The BinarySpace to add
-
- void Append(const FDictSpace &Other)
-
Append another DictSpace to this one.
- Parameters:
-
Other – [in] The DictSpace to append
- DictSpace *ToProtobuf() const
-
Convert this DictSpace to a protobuf message.
- Returns:
-
A protobuf message representing this DictSpace
- void FillProtobuf(DictSpace *Msg) const
-
Fill a protobuf message with the data from this DictSpace.
- Parameters:
-
Msg – [in] The protobuf message to fill
- void InitializeEmptyDictPoint(FDictPoint &EmptyPoint)
-
Configure an empty DictPoint with the correct entries corresponding to this space.
- Parameters:
-
EmptyPoint – [inout] The point to initialize
- FDictPoint UnflattenPoint(TArray<float> &FlattenedPoint)
-
Create an empty DictPoint from a flattened point.
- Parameters:
-
FlattenedPoint – [in] The flattened point buffer to unflatten
- Returns:
-
The unflattened point
- FGenericTensorBinding CreateTensorBinding(TArray<float> &Buffer) const
-
Create an empty Tensor Binding with correct size to hold a point from this DictSpace.
- Parameters:
-
Buffer – [in] The buffer that will contain the memory in the tensor binding
- Returns:
-
The empty tensor binding
- FGenericTensorBinding CreateTensorBinding(TArray<float> &Buffer, const FDictPoint &Point) const
-
Create a Tensor Binding containing a point from this DictSpace.
- Parameters:
-
-
Buffer – [inout] The buffer that will contain the memory in the tensor binding
-
Point – [in] The point to create a tensor from
-
- Returns:
-
The tensor binding