pub struct TrajectoryRecorder { /* private fields */ }Expand description
Records agent trajectories for learning and pattern extraction.
Maintains a bounded FIFO buffer of TrajectoryRecords. When the
buffer is full the oldest record is evicted. Callers can query by
agent and extract frequency patterns from successful actions.
Implementations§
Source§impl TrajectoryRecorder
impl TrajectoryRecorder
Sourcepub fn record(&mut self, record: TrajectoryRecord)
pub fn record(&mut self, record: TrajectoryRecord)
Record a trajectory point. Evicts the oldest record on overflow.
Sourcepub fn agent_trajectory(&self, agent_id: &str) -> Vec<&TrajectoryRecord>
pub fn agent_trajectory(&self, agent_id: &str) -> Vec<&TrajectoryRecord>
Get all records for a specific agent.
Sourcepub fn extract_patterns(&self) -> Vec<(String, usize)>
pub fn extract_patterns(&self) -> Vec<(String, usize)>
Extract patterns: returns (action, count) pairs for successful
actions, sorted by frequency descending.
Auto Trait Implementations§
impl Freeze for TrajectoryRecorder
impl RefUnwindSafe for TrajectoryRecorder
impl Send for TrajectoryRecorder
impl Sync for TrajectoryRecorder
impl Unpin for TrajectoryRecorder
impl UnsafeUnpin for TrajectoryRecorder
impl UnwindSafe for TrajectoryRecorder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more