[−][src]Struct ddo::implementation::mdd::shallow::pooled::PooledMDD
This structure implements a pooled MDD. This is a kind of bounded width MDD which cannot offer a strong guarantees wrt to the maximum amount of used memory. However, this structure is perfectly suited for problems like MISP, where one decision can affect more than one variable, and expanding a node is expensive but checkinig if a node is going to be impacted by a decision is cheap.
Note
The behavior of this MDD is heavily dependent on the configuration you
provide. Therefore, and although a public constructor exists for this
structure, it it recommended that you build this type of mdd using the
mdd_builder
functionality as shown in the following examples.
Example
let problem = MockProblem; let relaxation = MockRelax; // Following line configure and builds a pooled mdd. let pooled_mdd = mdd_builder(&problem, relaxation).into_pooled(); // Naturally, you can also provide configuration parameters to customize // the behavior of your MDD. For instance, you can use a custom max width // heuristic as follows (below, a fixed width) let problem = MockProblem; let relaxation = MockRelax; let pooled_mdd = mdd_builder(&problem, relaxation) .with_max_width(FixedWidth(100)) .into_pooled();
Implementations
impl<T, C> PooledMDD<T, C> where
T: Eq + Hash + Clone,
C: Config<T> + Clone,
[src]
T: Eq + Hash + Clone,
C: Config<T> + Clone,
pub fn new(config: C) -> Self
[src]
Constructor, uses the given config to parameterize the mdd's behavior
pub fn clear(&mut self)
[src]
Resets the state of the mdd to make it reusable and ready to explore an other subproblem-space.
Trait Implementations
impl<T: Clone, C: Clone> Clone for PooledMDD<T, C> where
T: Eq + Hash + Clone,
C: Config<T> + Clone,
[src]
T: Eq + Hash + Clone,
C: Config<T> + Clone,
impl<T: Debug, C: Debug> Debug for PooledMDD<T, C> where
T: Eq + Hash + Clone,
C: Config<T> + Clone,
[src]
T: Eq + Hash + Clone,
C: Config<T> + Clone,
impl<T, C> From<C> for PooledMDD<T, C> where
T: Eq + Hash + Clone,
C: Config<T> + Clone,
[src]
T: Eq + Hash + Clone,
C: Config<T> + Clone,
impl<T, C> MDD<T, C> for PooledMDD<T, C> where
T: Eq + Hash + Clone,
C: Config<T> + Clone,
[src]
T: Eq + Hash + Clone,
C: Config<T> + Clone,
As the name suggests, PooledMDD
is an implementation of the MDD
trait.
See the trait definiton for the documentation related to these methods.
fn config(&self) -> &C
[src]
fn is_exact(&self) -> bool
[src]
fn best_value(&self) -> isize
[src]
fn best_solution(&self) -> Option<Solution>
[src]
fn for_each_cutset_node<F>(&self, func: F) where
F: FnMut(FrontierNode<T>),
[src]
F: FnMut(FrontierNode<T>),
fn exact(&mut self, root: &FrontierNode<T>, best_lb: isize)
[src]
fn restricted(&mut self, root: &FrontierNode<T>, best_lb: isize)
[src]
fn relaxed(&mut self, root: &FrontierNode<T>, best_lb: isize)
[src]
Auto Trait Implementations
impl<T, C> !RefUnwindSafe for PooledMDD<T, C>
impl<T, C> !Send for PooledMDD<T, C>
impl<T, C> !Sync for PooledMDD<T, C>
impl<T, C> Unpin for PooledMDD<T, C> where
C: Unpin,
C: Unpin,
impl<T, C> !UnwindSafe for PooledMDD<T, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,