FDiscreteSpace
A struct representing a discrete space of possible observations or actions.
A discrete space represents a single choice from a finite set of options, numbered from 0 to High-1. This is commonly used for discrete action spaces where an agent selects from a fixed set of actions (e.g., move left, move right, jump).
struct FDiscreteSpace : public FSpaceMethods
FDiscreteSpace
FDiscreteSpace()Constructs an empty DiscreteSpace with High=0.
FDiscreteSpace
inline FDiscreteSpace(int High)Constructs a DiscreteSpace with a specific upper bound.
Parameters
High(int)
Copy
void Copy(const FDiscreteSpace &Other)Copies the contents of another DiscreteSpace into this one.
Parameters
Other(const FDiscreteSpace)
GetMaxValue
int GetMaxValue(const TArray<float> &Vector) constGets the index of the maximum value in an array.
Parameters
Vector(const TArray<float>)
GetNumDimensions
virtual int GetNumDimensions() const overrideGets the number of dimensions in this space.
Validate
virtual ESpaceValidationResultValidate(const TInstancedStruct<FPoint> &InPoint) const overrideValidates that a point conforms to this space.
Parameters
InPoint(const TInstancedStruct<FPoint>)
GetFlattenedSize
virtual int GetFlattenedSize() const overrideGets the flattened size of this space.
IsEmpty
virtual bool IsEmpty() const overrideChecks if this space is empty.
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) constAccepts a const visitor for the visitor pattern.
Parameters
InVisitor(ConstSpaceVisitor)
Attributes
High
int High = 0The exclusive upper bound (maximum value + 1) for this discrete space.