pub struct CausalMemory { /* private fields */ }Expand description
Causal memory store.
Implementations§
Source§impl CausalMemory
impl CausalMemory
Sourcepub fn add_node(&mut self, node: CausalNode) -> Uuid
pub fn add_node(&mut self, node: CausalNode) -> Uuid
Add a node.
Sourcepub fn add_edge(&mut self, edge: CausalEdge)
pub fn add_edge(&mut self, edge: CausalEdge)
Add an edge.
Sourcepub fn add_hyperedge(&mut self, hyperedge: Hyperedge)
pub fn add_hyperedge(&mut self, hyperedge: Hyperedge)
Add a hyperedge.
Sourcepub fn get_node(&self, id: Uuid) -> Option<&CausalNode>
pub fn get_node(&self, id: Uuid) -> Option<&CausalNode>
Get a node by ID.
Sourcepub fn find_causes(
&self,
effect: Uuid,
) -> Vec<(&CausalEdge, Option<&CausalNode>)>
pub fn find_causes( &self, effect: Uuid, ) -> Vec<(&CausalEdge, Option<&CausalNode>)>
Find causes of a given effect.
Sourcepub fn find_effects(
&self,
cause: Uuid,
) -> Vec<(&CausalEdge, Option<&CausalNode>)>
pub fn find_effects( &self, cause: Uuid, ) -> Vec<(&CausalEdge, Option<&CausalNode>)>
Find effects of a given cause.
Sourcepub fn trace_chain(
&self,
start: Uuid,
max_depth: usize,
) -> Vec<(Uuid, usize, f32)>
pub fn trace_chain( &self, start: Uuid, max_depth: usize, ) -> Vec<(Uuid, usize, f32)>
Trace causal chain from cause to all reachable effects.
Sourcepub fn find_by_relationship(&self, relationship: &str) -> Vec<&CausalEdge>
pub fn find_by_relationship(&self, relationship: &str) -> Vec<&CausalEdge>
Find all edges of a specific relationship type.
Sourcepub fn strongest_relationships(&self, limit: usize) -> Vec<&CausalEdge>
pub fn strongest_relationships(&self, limit: usize) -> Vec<&CausalEdge>
Get strongest causal relationships.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Node count.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Edge count.
Sourcepub fn hyperedge_count(&self) -> usize
pub fn hyperedge_count(&self) -> usize
Hyperedge count.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CausalMemory
impl RefUnwindSafe for CausalMemory
impl Send for CausalMemory
impl Sync for CausalMemory
impl Unpin for CausalMemory
impl UnsafeUnpin for CausalMemory
impl UnwindSafe for CausalMemory
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> 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