Struct ddo::Pooled

source ·
pub struct Pooled<T>
where T: Eq + PartialEq + Hash + Clone,
{ /* private fields */ }
Expand description

The decision diagram in itself. This structure essentially keeps track of the nodes composing the diagram as well as the edges connecting these nodes in two vectors (enabling preallocation and good cache locality). In addition to that, it also keeps track of the path (root_pa) from the problem root to the root of this decision diagram (explores a sub problem). The prev_l comprises information about the nodes that are currently being expanded, next_l stores the information about the nodes from the next layer and cut-set stores an exact cut-set of the DD. Depending on the type of DD compiled, different cut-set types will be used:

  • Exact: no cut-set is needed since the DD is exact
  • Restricted: the last exact layer is used as cut-set
  • Relaxed: either the last exact layer of the frontier cut-set can be chosen within the CompilationInput

Implementations§

source§

impl<T> Pooled<T>
where T: Eq + PartialEq + Hash + Clone,

source

pub fn new() -> Self

source§

impl<T> Pooled<T>
where T: Debug + Eq + PartialEq + Hash + Clone,

source

pub fn as_graphviz(&self, config: &VizConfig) -> String

This is the method you will want to use in order to create the output image you would like. Note: the output is going to be a string of (not compiled) ‘dot’. This makes it easier for me to code and gives you the freedom to fiddle with the graph if needed.

Trait Implementations§

source§

impl<T> Clone for Pooled<T>
where T: Eq + PartialEq + Hash + Clone + Clone,

source§

fn clone(&self) -> Pooled<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Pooled<T>
where T: Eq + PartialEq + Hash + Clone + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> DecisionDiagram for Pooled<T>
where T: Eq + PartialEq + Hash + Clone,

§

type State = T

This associated type corresponds to the State type of the problems that can be solved when using this DD.
source§

fn compile( &mut self, input: &CompilationInput<'_, Self::State> ) -> Result<Completion, Reason>

This method provokes the compilation of the DD based on the given compilation input (compilation type, and root subproblem)
source§

fn is_exact(&self) -> bool

Returns true iff the DD which has been compiled is an exact DD.
source§

fn best_value(&self) -> Option<isize>

Returns the optimal value of the objective function or None when no feasible solution has been identified (no r-t path) either because the subproblem at the root of this DD is infeasible or because restriction has removed all feasible paths that could potentially have been found.
source§

fn best_solution(&self) -> Option<Solution>

Returns the best solution of this subproblem as a sequence of decision maximizing the objective value. When no feasible solution exists in the approximate DD, it returns the value None instead.
source§

fn best_exact_value(&self) -> Option<isize>

Returns the value of the objective function for the best exact node in the DD or None when no feasible solution has been identified (no r-t path) either because the subproblem at the root of this DD is infeasible or because restriction/relaxation has removed all feasible paths that could potentially have been found.
source§

fn best_exact_solution(&self) -> Option<Solution>

Returns the best exact solution of this subproblem as a sequence of decision maximizing the objective value. When no feasible solution exists in the approximate DD, it returns the value None instead.
source§

fn drain_cutset<F>(&mut self, func: F)
where F: FnMut(SubProblem<Self::State>),

Iteratively applies the given function func to each element of the exact cut-set that was computed during DD compilation. Read more
source§

impl<T> Default for Pooled<T>
where T: Eq + PartialEq + Hash + Clone,

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Pooled<T>
where T: RefUnwindSafe,

§

impl<T> Send for Pooled<T>
where T: Sync + Send,

§

impl<T> Sync for Pooled<T>
where T: Sync + Send,

§

impl<T> Unpin for Pooled<T>

§

impl<T> UnwindSafe for Pooled<T>
where T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.