pub struct CausalVariable {
pub name: String,
pub var_type: CausalVarType,
pub distribution: Option<String>,
pub params: HashMap<String, f64>,
}Expand description
A variable in the causal graph.
Fields§
§name: String§var_type: CausalVarType§distribution: Option<String>Base distribution for exogenous noise (e.g., “normal”, “lognormal”, “beta”).
params: HashMap<String, f64>Distribution parameters.
Implementations§
Source§impl CausalVariable
impl CausalVariable
pub fn new(name: impl Into<String>, var_type: CausalVarType) -> Self
pub fn with_distribution(self, dist: impl Into<String>) -> Self
pub fn with_param(self, key: impl Into<String>, value: f64) -> Self
Trait Implementations§
Source§impl Clone for CausalVariable
impl Clone for CausalVariable
Source§fn clone(&self) -> CausalVariable
fn clone(&self) -> CausalVariable
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 CausalVariable
impl Debug for CausalVariable
Source§impl<'de> Deserialize<'de> for CausalVariable
impl<'de> Deserialize<'de> for CausalVariable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CausalVariable
impl RefUnwindSafe for CausalVariable
impl Send for CausalVariable
impl Sync for CausalVariable
impl Unpin for CausalVariable
impl UnwindSafe for CausalVariable
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