Transferable

Trait Transferable 

Source
pub trait Transferable {
    // Required method
    fn get_assumptions(&self) -> &Option<Arc<Vec<Assumption>>>;

    // Provided method
    fn verify_assumptions(
        &self,
        effect: &[PropagatingEffect<f64>],
    ) -> Result<(), AssumptionError> { ... }
}
Expand description

Trait for types that can verify their assumptions against propagating effects.

Assumptions are verified using PropagatingEffect<bool> where the boolean represents whether an assumption holds or not.

Required Methods§

Provided Methods§

Source

fn verify_assumptions( &self, effect: &[PropagatingEffect<f64>], ) -> Result<(), AssumptionError>

Verifies the model’s assumptions against a given PropagatingEffect.

The function iterates through all defined assumptions and checks them against the provided data. It short-circuits and returns immediately on the first failure or error.

Overwrite the default implementation if you need customization.

§Arguments
  • effect - Sample data to be tested. Details on sampling should be documented in each assumption.
§Returns
  • Ok(()) if all assumptions hold true.
  • Err(AssumptionError::AssumptionFailed(String)) if an assumption is not met.
  • Err(AssumptionError::NoAssumptionsDefined) if the model has no assumptions.
  • Err(AssumptionError::NoDataToTestDefined) if the effect slice is empty.
  • Err(AssumptionError::EvaluationError(...)) if an error occurs during evaluation.

Implementors§

Source§

impl<I, O, C> Transferable for Model<I, O, C>
where I: Default, O: Default + Debug, C: Clone,