pub struct CausalChain {
pub cause: EntityId,
pub effect: EntityId,
pub steps: Vec<CausalStep>,
pub total_confidence: f32,
pub temporal_consistency: bool,
pub time_span: Option<i64>,
}Expand description
A complete causal chain from cause to effect
Represents a series of causal steps connecting two entities. All steps must be temporally ordered (earlier causes → later effects).
Fields§
§cause: EntityIdStarting entity (the cause)
effect: EntityIdEnding entity (the effect)
steps: Vec<CausalStep>Intermediate causal steps
total_confidence: f32Overall confidence of the chain (product of step confidences)
temporal_consistency: boolWhether the chain is temporally consistent (all steps ordered correctly)
time_span: Option<i64>Total time span of the chain (if temporal data available)
Implementations§
Source§impl CausalChain
impl CausalChain
Sourcepub fn calculate_confidence(&self) -> f32
pub fn calculate_confidence(&self) -> f32
Calculate the total confidence of the chain
Uses product of step confidences, weighted by causal strengths
Sourcepub fn check_temporal_consistency(&self) -> bool
pub fn check_temporal_consistency(&self) -> bool
Check temporal consistency of the chain
Returns true if all steps are temporally ordered (t1 < t2 < t3…)
Sourcepub fn calculate_time_span(&self) -> Option<i64>
pub fn calculate_time_span(&self) -> Option<i64>
Calculate the time span of the chain
Trait Implementations§
Source§impl Clone for CausalChain
impl Clone for CausalChain
Source§fn clone(&self) -> CausalChain
fn clone(&self) -> CausalChain
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 moreAuto Trait Implementations§
impl Freeze for CausalChain
impl RefUnwindSafe for CausalChain
impl Send for CausalChain
impl Sync for CausalChain
impl Unpin for CausalChain
impl UnsafeUnpin for CausalChain
impl UnwindSafe for CausalChain
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