pub struct NDArrayCollector<F> { /* private fields */ }Expand description
Collects replay frames into a dense 2D feature matrix.
Implementations§
Source§impl<F> NDArrayCollector<F>
impl<F> NDArrayCollector<F>
Sourcepub fn new(
feature_adders: FeatureAdders<F>,
player_feature_adders: PlayerFeatureAdders<F>,
) -> Self
pub fn new( feature_adders: FeatureAdders<F>, player_feature_adders: PlayerFeatureAdders<F>, ) -> Self
Creates a collector from explicit global and per-player feature adders.
Sourcepub fn get_column_headers(&self) -> NDArrayColumnHeaders
pub fn get_column_headers(&self) -> NDArrayColumnHeaders
Returns the column headers implied by the configured feature adders.
Sourcepub fn get_ndarray(self) -> SubtrActorResult<Array2<F>>
pub fn get_ndarray(self) -> SubtrActorResult<Array2<F>>
Finalizes collection and returns only the ndarray payload.
Sourcepub fn get_meta_and_ndarray(
self,
) -> SubtrActorResult<(ReplayMetaWithHeaders, Array2<F>)>
pub fn get_meta_and_ndarray( self, ) -> SubtrActorResult<(ReplayMetaWithHeaders, Array2<F>)>
Finalizes collection and returns replay metadata alongside the ndarray.
Sourcepub fn process_and_get_meta_and_headers(
&mut self,
replay: &Replay,
) -> SubtrActorResult<ReplayMetaWithHeaders>
pub fn process_and_get_meta_and_headers( &mut self, replay: &Replay, ) -> SubtrActorResult<ReplayMetaWithHeaders>
Processes enough of a replay to determine metadata and column headers.
Source§impl<F> NDArrayCollector<F>
impl<F> NDArrayCollector<F>
Sourcepub fn from_strings_typed(
fa_names: &[&str],
pfa_names: &[&str],
) -> SubtrActorResult<Self>
pub fn from_strings_typed( fa_names: &[&str], pfa_names: &[&str], ) -> SubtrActorResult<Self>
Builds a collector from the registered string names of feature adders.
Source§impl NDArrayCollector<f32>
impl NDArrayCollector<f32>
Sourcepub fn from_strings(
fa_names: &[&str],
pfa_names: &[&str],
) -> SubtrActorResult<Self>
pub fn from_strings( fa_names: &[&str], pfa_names: &[&str], ) -> SubtrActorResult<Self>
Builds an f32 collector from the registered string names of feature adders.
Trait Implementations§
Source§impl<F> Collector for NDArrayCollector<F>
impl<F> Collector for NDArrayCollector<F>
Source§fn process_frame(
&mut self,
processor: &ReplayProcessor<'_>,
frame: &Frame,
frame_number: usize,
current_time: f32,
) -> SubtrActorResult<TimeAdvance>
fn process_frame( &mut self, processor: &ReplayProcessor<'_>, frame: &Frame, frame_number: usize, current_time: f32, ) -> SubtrActorResult<TimeAdvance>
Process a single frame from a replay. Read more
Source§fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>where
Self: Sized,
fn process_replay(self, replay: &Replay) -> SubtrActorResult<Self>where
Self: Sized,
Process an entire replay. Read more
Source§fn finish_replay(
&mut self,
_processor: &ReplayProcessor<'_>,
) -> SubtrActorResult<()>
fn finish_replay( &mut self, _processor: &ReplayProcessor<'_>, ) -> SubtrActorResult<()>
Finalize replay-derived state after the last frame has been processed. Read more
Auto Trait Implementations§
impl<F> Freeze for NDArrayCollector<F>
impl<F> !RefUnwindSafe for NDArrayCollector<F>
impl<F> Send for NDArrayCollector<F>where
F: Send,
impl<F> Sync for NDArrayCollector<F>where
F: Sync,
impl<F> Unpin for NDArrayCollector<F>where
F: Unpin,
impl<F> UnsafeUnpin for NDArrayCollector<F>
impl<F> !UnwindSafe for NDArrayCollector<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more