pub trait BN {
type CPD;
type Evidence;
type Sample;
type Samples;
// Required methods
fn new<I>(graph: DiGraph, cpds: I) -> Self
where I: IntoIterator<Item = Self::CPD>;
fn name(&self) -> Option<&str>;
fn description(&self) -> Option<&str>;
fn graph(&self) -> &DiGraph;
fn cpds(&self) -> &Map<String, Self::CPD>;
fn parameters_size(&self) -> usize;
fn topological_order(&self) -> &[usize];
fn with_optionals<I>(
name: Option<String>,
description: Option<String>,
graph: DiGraph,
cpds: I,
) -> Self
where I: IntoIterator<Item = Self::CPD>;
}Expand description
A trait for Bayesian networks.
Required Associated Types§
Required Methods§
Sourcefn new<I>(graph: DiGraph, cpds: I) -> Selfwhere
I: IntoIterator<Item = Self::CPD>,
fn new<I>(graph: DiGraph, cpds: I) -> Selfwhere
I: IntoIterator<Item = Self::CPD>,
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Sourcefn parameters_size(&self) -> usize
fn parameters_size(&self) -> usize
Sourcefn topological_order(&self) -> &[usize]
fn topological_order(&self) -> &[usize]
Sourcefn with_optionals<I>(
name: Option<String>,
description: Option<String>,
graph: DiGraph,
cpds: I,
) -> Selfwhere
I: IntoIterator<Item = Self::CPD>,
fn with_optionals<I>(
name: Option<String>,
description: Option<String>,
graph: DiGraph,
cpds: I,
) -> Selfwhere
I: IntoIterator<Item = Self::CPD>,
Creates a new Bayesian network with optional fields.
§Arguments
name- The name of the model.description- The description of the model.graph- The underlying graph.cpds- The conditional probability distributions.
§Panics
- Panics if
nameis an empty string. - Panics if
descriptionis an empty string.
§Returns
A new Bayesian network instance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.