pub struct LearnedPattern {
pub id: u64,
pub centroid: Vec<f32>,
pub cluster_size: usize,
pub total_weight: f32,
pub avg_quality: f32,
pub created_at: u64,
pub last_accessed: u64,
pub access_count: u32,
pub pattern_type: PatternType,
}Expand description
Learned pattern from trajectory clustering
Fields§
§id: u64Pattern identifier
centroid: Vec<f32>Cluster centroid embedding
cluster_size: usizeNumber of trajectories in cluster
total_weight: f32Sum of trajectory weights
avg_quality: f32Average quality of member trajectories
created_at: u64Creation timestamp (Unix seconds)
last_accessed: u64Last access timestamp
access_count: u32Total access count
pattern_type: PatternTypePattern type/category
Implementations§
Source§impl LearnedPattern
impl LearnedPattern
Sourcepub fn should_prune(
&self,
min_quality: f32,
min_accesses: u32,
max_age_secs: u64,
) -> bool
pub fn should_prune( &self, min_quality: f32, min_accesses: u32, max_age_secs: u64, ) -> bool
Check if pattern should be pruned
Sourcepub fn similarity(&self, query: &[f32]) -> f32
pub fn similarity(&self, query: &[f32]) -> f32
Compute cosine similarity with query
Trait Implementations§
Source§impl Clone for LearnedPattern
impl Clone for LearnedPattern
Source§fn clone(&self) -> LearnedPattern
fn clone(&self) -> LearnedPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LearnedPattern
impl Debug for LearnedPattern
Source§impl<'de> Deserialize<'de> for LearnedPattern
impl<'de> Deserialize<'de> for LearnedPattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LearnedPattern
impl RefUnwindSafe for LearnedPattern
impl Send for LearnedPattern
impl Sync for LearnedPattern
impl Unpin for LearnedPattern
impl UnwindSafe for LearnedPattern
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