pub struct MathEngine { /* private fields */ }Expand description
Main mathematical engine for memory consolidation calculations
Implementations§
Source§impl MathEngine
impl MathEngine
Sourcepub fn with_config(config: MathEngineConfig) -> Self
pub fn with_config(config: MathEngineConfig) -> Self
Create a new math engine with custom configuration
Sourcepub fn config(&self) -> &MathEngineConfig
pub fn config(&self) -> &MathEngineConfig
Get the current configuration
Sourcepub fn update_config(&mut self, config: MathEngineConfig)
pub fn update_config(&mut self, config: MathEngineConfig)
Update the configuration
Sourcepub fn calculate_recall_probability(
&self,
params: &MemoryParameters,
) -> Result<RecallCalculationResult>
pub fn calculate_recall_probability( &self, params: &MemoryParameters, ) -> Result<RecallCalculationResult>
Sourcepub fn update_consolidation_strength(
&self,
current_strength: f64,
recall_interval: PgInterval,
) -> Result<ConsolidationUpdateResult>
pub fn update_consolidation_strength( &self, current_strength: f64, recall_interval: PgInterval, ) -> Result<ConsolidationUpdateResult>
Sourcepub fn calculate_decay_rate(&self, params: &MemoryParameters) -> Result<f64>
pub fn calculate_decay_rate(&self, params: &MemoryParameters) -> Result<f64>
Calculate decay rate based on access patterns
This function calculates an adaptive decay rate based on access frequency, importance score, and memory age. More important and frequently accessed memories have lower decay rates.
§Arguments
params- Memory parameters for calculation
§Returns
Result<f64>- Calculated decay rate
Sourcepub fn batch_calculate_recall_probability(
&self,
memory_params: &[MemoryParameters],
) -> Result<BatchProcessingResult>
pub fn batch_calculate_recall_probability( &self, memory_params: &[MemoryParameters], ) -> Result<BatchProcessingResult>
Batch process multiple memories for recall probability calculation
This function optimizes performance by processing multiple memories in a single operation, reducing overhead and improving throughput.
§Arguments
memory_params- Vector of memory parameters
§Returns
Result<BatchProcessingResult>- Batch processing results
Sourcepub fn should_migrate(
&self,
recall_probability: f64,
current_tier: &str,
) -> bool
pub fn should_migrate( &self, recall_probability: f64, current_tier: &str, ) -> bool
Trait Implementations§
Source§impl Clone for MathEngine
impl Clone for MathEngine
Source§fn clone(&self) -> MathEngine
fn clone(&self) -> MathEngine
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 MathEngine
impl Debug for MathEngine
Auto Trait Implementations§
impl Freeze for MathEngine
impl RefUnwindSafe for MathEngine
impl Send for MathEngine
impl Sync for MathEngine
impl Unpin for MathEngine
impl UnwindSafe for MathEngine
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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