pub struct CausalEdgeData {
pub strength: f32,
pub confidence: f32,
pub evidence_count: u32,
pub confounders: Vec<String>,
pub provenance: Option<String>,
pub mechanism: Option<String>,
pub direction: Option<CausalDirection>,
}Expand description
Data carried only on causal edges — boxed to keep GraphEdge small for
the common non-causal case.
Required numeric fields use concrete values rather than Option because a
CausalEdgeData that exists but has no strength/confidence/count is not
meaningful. Defaults are: strength = 0.0, confidence = 0.5,
evidence_count = 0, confounders = [].
Fields§
§strength: f32Causal effect magnitude [0.0, 1.0].
confidence: f32Certainty in the causal claim [0.0, 1.0].
evidence_count: u32Number of observations supporting this edge.
confounders: Vec<String>Known confounding variables.
provenance: Option<String>Provenance description (free text or JSON reference).
mechanism: Option<String>Described causal mechanism.
direction: Option<CausalDirection>Causal direction label.
Implementations§
Source§impl CausalEdgeData
impl CausalEdgeData
Sourcepub fn new(strength: f32, confidence: f32, evidence_count: u32) -> Self
pub fn new(strength: f32, confidence: f32, evidence_count: u32) -> Self
Construct with the three required numeric fields; all optional fields are initialised to their defaults.
Sourcepub fn with_mechanism(self, mechanism: impl Into<String>) -> Self
pub fn with_mechanism(self, mechanism: impl Into<String>) -> Self
Builder: set the causal mechanism description.
Sourcepub fn with_provenance(self, provenance: impl Into<String>) -> Self
pub fn with_provenance(self, provenance: impl Into<String>) -> Self
Builder: set the provenance reference.
Sourcepub fn with_direction(self, direction: CausalDirection) -> Self
pub fn with_direction(self, direction: CausalDirection) -> Self
Builder: set the causal direction label.
Sourcepub fn with_confounders(self, confounders: Vec<String>) -> Self
pub fn with_confounders(self, confounders: Vec<String>) -> Self
Builder: set known confounding variables.
Trait Implementations§
Source§impl Clone for CausalEdgeData
impl Clone for CausalEdgeData
Source§fn clone(&self) -> CausalEdgeData
fn clone(&self) -> CausalEdgeData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more