pub struct SpreadingActivation { /* private fields */ }Expand description
Spreading activation engine parameterized from SpreadingActivationParams.
Implementations§
Source§impl SpreadingActivation
impl SpreadingActivation
Sourcepub fn new(params: SpreadingActivationParams) -> Self
pub fn new(params: SpreadingActivationParams) -> Self
Create a new spreading activation engine from explicit parameters.
params.temporal_decay_rate is taken from GraphConfig.temporal_decay_rate so that
recency weighting reuses the same parameter as BFS recall (SA-INV-05).
Sourcepub async fn spread(
&self,
store: &GraphStore,
seeds: HashMap<i64, f32>,
edge_types: &[EdgeType],
) -> Result<(Vec<ActivatedNode>, Vec<ActivatedFact>), MemoryError>
pub async fn spread( &self, store: &GraphStore, seeds: HashMap<i64, f32>, edge_types: &[EdgeType], ) -> Result<(Vec<ActivatedNode>, Vec<ActivatedFact>), MemoryError>
Run spreading activation from seeds over the graph.
Returns activated nodes sorted by activation score descending, along with edges collected during propagation.
§Parameters
store: graph database accessorseeds:HashMap<entity_id, initial_activation>— nodes to start fromedge_types: MAGMA subgraph filter; when non-empty, only edges of these types are traversed (mirrorsbfs_typedbehaviour; SA-INV-08)
§Errors
Returns an error if any database query fails.
Auto Trait Implementations§
impl Freeze for SpreadingActivation
impl RefUnwindSafe for SpreadingActivation
impl Send for SpreadingActivation
impl Sync for SpreadingActivation
impl Unpin for SpreadingActivation
impl UnsafeUnpin for SpreadingActivation
impl UnwindSafe for SpreadingActivation
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request