Navigation
API > API/Plugins > API/Plugins/Learning
A FFrameRangeSet represents a set of ranges within a set of sequences. This can be useful for encoding things like a collection of tags or labels for different parts of some database of animations, replays, or recordings.
This data structure stores that information in a way that makes performing operations such as union, intersection, difference etc, efficient.
The way it works is by storing a sorted array of "entries", where each entry has a corresponding sequence, the number of ranges in the set for that sequence, and an index into three large arrays of range starts, lengths, and offsets. The sub-ranges of the large arrays of range starts and lengths are also sorted, while the offsets arrays stores the offset that would be used if you had to take a slice of a large flat array of frame data.
Having the entries sorted by sequence, and the ranges sorted, allows for efficient set operations via tape-merge algorithms.
This data-structure is related to the FrameSet data-structure, which essentially acts the same way but stores individual frames instead of frame ranges.
| Name | FFrameRangeSet |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/LearningFrameRangeSet.h |
| Include Path | #include "LearningFrameRangeSet.h" |
Syntax
struct FFrameRangeSet
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| EntryRangeNums | TLearningArray< 1, int32 > | Array of the number of ranges associated with each entry | LearningFrameRangeSet.h | |
| EntryRangeOffsets | TLearningArray< 1, int32 > | Array of offsets into the RangeStarts, RangeLengths, RangeOffsets arrays associated with each entry | LearningFrameRangeSet.h | |
| EntrySequences | TLearningArray< 1, int32 > | Array of sequences associated with each entry | LearningFrameRangeSet.h | |
| RangeLengths | TLearningArray< 1, int32 > | Large array of all range lengths for all entries, indexed using offsets from EntryRangeOffsets | LearningFrameRangeSet.h | |
| RangeOffsets | TLearningArray< 1, int32 > | Large array of all range frame offsets for all entries, indexed using offsets from EntryRangeOffsets | LearningFrameRangeSet.h | |
| RangeStarts | TLearningArray< 1, int32 > | Large array of all range starts for all entries, indexed using offsets from EntryRangeOffsets | LearningFrameRangeSet.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddEntry
(
const int32 InSequence, |
Adds the given ranges associated with the given sequence to the set. | LearningFrameRangeSet.h | |
void Check() |
Check if the FrameRangeSet is well-formed (i.e. correctly sorted without duplicate entries) | LearningFrameRangeSet.h | |
bool Contains
(
const int32 Sequence, |
Checks if this FrameRangeSet contains a given sequence and frame in that sequence | LearningFrameRangeSet.h | |
bool ContainsSequence
(
const int32 Sequence |
Checks if this FrameRangeSet contains a given sequence | LearningFrameRangeSet.h | |
bool ContainsTime
(
const int32 Sequence, |
Checks if this FrameRangeSet contains a given sequence and time in that sequence | LearningFrameRangeSet.h | |
void Empty() |
Empties the FrameRangeSet | LearningFrameRangeSet.h | |
bool Find
(
int32& OutEntryIdx, |
Finds the entry index and range index associated with a given sequence and frame in that sequence | LearningFrameRangeSet.h | |
bool FindOffset
(
int32& OutEntryIdx, |
Finds entry index, frame index, and frame in that range, associated with some offset | LearningFrameRangeSet.h | |
int32 FindSequenceEntry
(
const int32 Sequence |
Finds the entry index associated with a given sequence | LearningFrameRangeSet.h | |
bool FindTime
(
int32& OutEntryIdx, |
Finds the entry index and range index associated with a given sequence and time in that sequence | LearningFrameRangeSet.h | |
bool FindTotalRange
(
int32& OutEntryIdx, |
Finds the entry index and range index associated with a range index into all ranges | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetAllRangeLengths() |
Gets an array of the range lengths for all ranges | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetAllRangeOffsets() |
Gets an array of the range offsets for all ranges | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetAllRangeStarts() |
Gets an array of the range starts for all ranges | LearningFrameRangeSet.h | |
int32 GetEntryNum() |
Gets the number of entries in the FrameRangeSet | LearningFrameRangeSet.h | |
float GetEntryRangeDuration
(
const int32 EntryIdx, |
Gets the range duration associated with a given entry and range index | LearningFrameRangeSet.h | |
float GetEntryRangeEndTime
(
const int32 EntryIdx, |
Gets the range end time associated with a given entry and range index | LearningFrameRangeSet.h | |
int32 GetEntryRangeLength
(
const int32 EntryIdx, |
Gets the range length associated with a given entry and range index | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetEntryRangeLengths
(
const int32 EntryIdx |
Gets all the range lengths associated with a given entry | LearningFrameRangeSet.h | |
int32 GetEntryRangeNum
(
const int32 EntryIdx |
Gets the number of ranges for a given entry | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetEntryRangeNums() |
Returns an array for the number of ranges in each entry | LearningFrameRangeSet.h | |
int32 GetEntryRangeOffset
(
const int32 EntryIdx, |
Computes the offset associated with a given entry and range index | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetEntryRangeOffsets
(
const int32 EntryIdx |
Gets all the range offsets associated with a given entry | LearningFrameRangeSet.h | |
int32 GetEntryRangeStart
(
const int32 EntryIdx, |
Gets the range start associated with a given entry and range index | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetEntryRangeStarts
(
const int32 EntryIdx |
Gets all the range starts associated with a given entry | LearningFrameRangeSet.h | |
float GetEntryRangeStartTime
(
const int32 EntryIdx, |
Gets the range start time associated with a given entry and range index | LearningFrameRangeSet.h | |
int32 GetEntrySequence
(
const int32 EntryIdx |
Gets the sequence associated with a given entry | LearningFrameRangeSet.h | |
TLearningArrayView< 1, const int32 > GetEntrySequences() |
Returns an array of sequences for each entry | LearningFrameRangeSet.h | |
int32 GetEntryTotalFrameNum
(
const int32 EntryIdx |
Computes the total number of frames given by all ranges in an entry | LearningFrameRangeSet.h | |
int32 GetTotalFrameNum() |
Computes the total number of frames across all entries and ranges | LearningFrameRangeSet.h | |
int32 GetTotalRangeNum() |
Computes the total number of ranges across all entries | LearningFrameRangeSet.h | |
bool IsEmpty() |
True if the FrameRangeSet is Empty, otherwise false | LearningFrameRangeSet.h |