Navigation
API > API/Plugins > API/Plugins/Learning
A FrameSet represents a set of frames within a set of sequences. This can be useful for encoding things like a collection of single-frame events.
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 frames in the set for that sequence, and an offset into a large array of frames. The sub-ranges of the large array of frames corresponding to each entry is also sorted.
Having the entries sorted by sequence, and the frames sorted, allows for efficient set operations via tape-merge algorithms.
Also provided are some algorithms for getting "offsets", which correspond to the index associated with a particular thing if you were to flatten this data-structure into one large array of frames.
This data-structure is related to the FrameRangeSet data-structure, which essentially acts the same way but stores frame ranges instead of individual frames.
| Name | FFrameSet |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/LearningFrameSet.h |
| Include Path | #include "LearningFrameSet.h" |
Syntax
struct FFrameSet
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| EntryFrameNums | TLearningArray< 1, int32 > | Array of the number of frames associated with each entry | LearningFrameSet.h | |
| EntryFrameOffsets | TLearningArray< 1, int32 > | Array of offsets into the Frames array associated with each entry | LearningFrameSet.h | |
| EntrySequences | TLearningArray< 1, int32 > | Array of sequences associated with each entry | LearningFrameSet.h | |
| Frames | TLearningArray< 1, int32 > | Large array of all frames for all entries, indexed using offsets from EntryFrameOffsets | LearningFrameSet.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddEntry
(
const int32 InSequence, |
Adds the given frames associated with the given sequence to the set. | LearningFrameSet.h | |
void Check() |
Check if the FrameSet is well-formed (i.e. correctly sorted without duplicate entries) | LearningFrameSet.h | |
bool Contains
(
const int32 Sequence, |
Checks if this FrameSet contains a given sequence and frame in that sequence | LearningFrameSet.h | |
bool ContainsSequence
(
const int32 Sequence |
Checks if this FrameSet contains a given sequence | LearningFrameSet.h | |
void Empty() |
Empties the FrameSet | LearningFrameSet.h | |
bool Find
(
int32& OutEntryIdx, |
Finds the entry index and frame index associated with a given sequence and frame in that sequence | LearningFrameSet.h | |
bool FindNearest
(
int32& OutEntryIdx, |
Finds the nearest entry index, frame index, and the frame difference, for some given sequence and frame in that sequence | LearningFrameSet.h | |
bool FindNearestInRange
(
int32& OutEntryIdx, |
Finds the nearest entry index, frame index, and the frame difference, for some given sequence and frame in that sequence, limited to a given range | LearningFrameSet.h | |
bool FindOffset
(
int32& OutEntryIdx, |
Finds entry index and frame index associated with some flat offset | LearningFrameSet.h | |
int32 FindSequenceEntry
(
const int32 Sequence |
Finds the entry index associated with a given sequence | LearningFrameSet.h | |
int32 GetEntryFrame
(
const int32 EntryIdx, |
Gets the frame number for an entry and entry frame index | LearningFrameSet.h | |
int32 GetEntryFrameNum
(
const int32 EntryIdx |
Gets the number of frames for a given entry | LearningFrameSet.h | |
TLearningArrayView< 1, const int32 > GetEntryFrameNums() |
Returns an array containing the number of frames corresponding in each entry | LearningFrameSet.h | |
TLearningArrayView< 1, const int32 > GetEntryFrames
(
const int32 EntryIdx |
Gets the array of frames associated with a given entry | LearningFrameSet.h | |
float GetEntryFrameTime
(
const int32 EntryIdx, |
Gets the frame time associated with an entry and entry frame index | LearningFrameSet.h | |
int32 GetEntryNum() |
Gets the number of entries in the FrameSet | LearningFrameSet.h | |
int32 GetEntryOffset
(
const int32 EntryIdx |
Gets the flat offset associated with a particular entry if you were to flatten this data structure | LearningFrameSet.h | |
int32 GetEntrySequence
(
const int32 EntryIdx |
Gets the sequence associated with a given entry | LearningFrameSet.h | |
TLearningArrayView< 1, const int32 > GetEntrySequences() |
Returns and array of sequences corresponding to each entry | LearningFrameSet.h | |
int32 GetTotalFrameNum() |
Gets the total number of frames if you were to flatten this data structure | LearningFrameSet.h | |
bool IsEmpty() |
True if the FrameSet is Empty, otherwise false | LearningFrameSet.h |