mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-20 09:39:38 +01:00
Add missing doc comments to lib
This commit is contained in:
parent
20cd5d3f06
commit
e16ed3a2f6
@ -32,8 +32,11 @@ use self::heuristics::Heuristic;
|
||||
///
|
||||
/// Please note that due to the nature of the underlying reduced and ordered Bdd the concept of a [`Term`][crate::datatypes::Term] represents one (sub) formula as well as truth-values.
|
||||
pub struct Adf {
|
||||
/// The ordering or the variables in the ADF including a dictionary for the statements
|
||||
pub ordering: VarContainer,
|
||||
/// The underlying binary decision diagram that respresents the ADF
|
||||
pub bdd: Bdd,
|
||||
/// Acceptance Conditions for the ADF
|
||||
pub ac: Vec<Term>,
|
||||
#[serde(skip, default = "Adf::default_rng")]
|
||||
rng: RefCell<StdRng>,
|
||||
@ -63,6 +66,7 @@ impl Default for Adf {
|
||||
}
|
||||
|
||||
impl Adf {
|
||||
/// Instntiates an ADF based on the publically available data
|
||||
pub fn from_ord_nodes_and_ac(
|
||||
ordering: VarContainer,
|
||||
bdd_nodes: Vec<BddNode>,
|
||||
|
||||
@ -26,6 +26,7 @@ impl Default for VarContainer {
|
||||
}
|
||||
|
||||
impl VarContainer {
|
||||
/// Create [VarContainer] from its components
|
||||
pub fn from_parser(
|
||||
names: Arc<RwLock<Vec<String>>>,
|
||||
mapping: Arc<RwLock<HashMap<String, usize>>>,
|
||||
@ -51,10 +52,12 @@ impl VarContainer {
|
||||
.and_then(|name| name.get(var.value()).cloned())
|
||||
}
|
||||
|
||||
/// Return ordered names from [VarContainer]
|
||||
pub fn names(&self) -> Arc<RwLock<Vec<String>>> {
|
||||
Arc::clone(&self.names)
|
||||
}
|
||||
|
||||
/// Return map from names to indices in [VarContainer]
|
||||
pub fn mappings(&self) -> Arc<RwLock<HashMap<String, usize>>> {
|
||||
Arc::clone(&self.mapping)
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ use std::{cell::RefCell, cmp::min, collections::HashMap, fmt::Display};
|
||||
/// Each roBDD is identified by its corresponding [`Term`], which implicitly identifies the root node of a roBDD.
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Bdd {
|
||||
/// The nodes of the [Bdd] with their edges
|
||||
pub nodes: Vec<BddNode>,
|
||||
#[cfg(feature = "variablelist")]
|
||||
#[serde(skip)]
|
||||
@ -100,6 +101,7 @@ impl Bdd {
|
||||
RefCell::new(HashMap::new())
|
||||
}
|
||||
|
||||
/// Construct [Bdd] from a list of nodes by adding one after the other
|
||||
pub fn from_nodes(nodes: Vec<BddNode>) -> Self {
|
||||
let mut bdd = Self::new();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user