[−][src]Struct ddo::core::implementation::mdd::builder::MDDBuilder
This is the structure used to build an MDD configuration. There is very little
logic to it: it only uses the type system to adapt to its configurations and
return a config which may be used efficiently (and stack allocated).
Concretely, an MDD builder lets you specify all the parameters of a candidate
configuration to build. Namely:
+ a problem (mandatory)
+ a relaxation (mandatory)
+ a load variable heuristic (Defaults to FromLongestPath
)
+ a variable selection heuristic (select the next var to branch on. Defaults to NaturalOrder
.)
+ a maximum width heuristic to limit the memory usage of each layer. (Defaults to NbUnassigned
.)
+ a node selection heuritic (Ordering to chose the nodes to drop/merge. Defaults to MinLP
).
Such a builder should not be manually created: it would be cumbersome and
bring no usage benefit. Instead, it should be instantiated using the
associated mdd_builder
function which is much simpler and does the exact
same job. Here is an example of how one is supposed to use the builder to
create an MDD with a fixed width (all other parameters can be tuned).
Example:
let problem = MockProblem; let relax = MockRelax; let mdd = mdd_builder(problem, relax) .with_max_width(FixedWidth(100)) .build();
Methods
impl<T, PB, RLX, LV, VS, WIDTH, NS> MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
T: Eq + Hash + Clone,
PB: Problem<T>,
RLX: Relaxation<T>,
LV: LoadVars<T>,
VS: VariableHeuristic<T>,
WIDTH: WidthHeuristic,
NS: Compare<Node<T>>,
[src]
T: Eq + Hash + Clone,
PB: Problem<T>,
RLX: Relaxation<T>,
LV: LoadVars<T>,
VS: VariableHeuristic<T>,
WIDTH: WidthHeuristic,
NS: Compare<Node<T>>,
The following methods define the behavior of an mdd builder.
pub fn with_load_vars<H>(self, h: H) -> MDDBuilder<T, PB, RLX, H, VS, WIDTH, NS>
[src]
This is how you specify the load variable heuristic to use.
pub fn with_branch_heuristic<H>(
self,
h: H
) -> MDDBuilder<T, PB, RLX, LV, H, WIDTH, NS>
[src]
self,
h: H
) -> MDDBuilder<T, PB, RLX, LV, H, WIDTH, NS>
This is how you specify the branch heuristic to use (the variable selection heuristic).
pub fn with_max_width<H>(self, h: H) -> MDDBuilder<T, PB, RLX, LV, VS, H, NS>
[src]
This is how you specify the maximum width heuristic to use (to constrain the max width of MDD layers).
pub fn with_nodes_selection_heuristic<H>(
self,
h: H
) -> MDDBuilder<T, PB, RLX, LV, VS, WIDTH, H>
[src]
self,
h: H
) -> MDDBuilder<T, PB, RLX, LV, VS, WIDTH, H>
This is how you specify the nodes selection heuristic to use (to decide what nodes to merge/drop in case the layer width is too large).
pub fn config(self) -> MDDConfig<T, PB, RLX, LV, VS, WIDTH, NS>
[src]
This is how you instantiate a configuration object. This is not really useful per-se, unless you decide to implement your own kind of MDD and want to be able to reuse a single configuration object.
pub fn build(self) -> FlatMDD<T, MDDConfig<T, PB, RLX, LV, VS, WIDTH, NS>>
[src]
This is how you instantiate an MDD (using the default MDD implementation) configured with the parameters you specified.
pub fn into_flat(self) -> FlatMDD<T, MDDConfig<T, PB, RLX, LV, VS, WIDTH, NS>>
[src]
This is how you instantiate a pooled MDD from using your desired configuration. Note: Unless you have a specific reason to use a pooled MDD, you are probably better off using the default implem (flat mdd). Chances are high that it will perform better.
pub fn into_pooled(
self
) -> PooledMDD<T, MDDConfig<T, PB, RLX, LV, VS, WIDTH, NS>>
[src]
self
) -> PooledMDD<T, MDDConfig<T, PB, RLX, LV, VS, WIDTH, NS>>
This is how you instantiate a pooled MDD from using your desired configuration.
Auto Trait Implementations
impl<T, PB, RLX, LV, VS, WIDTH, NS> RefUnwindSafe for MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
LV: RefUnwindSafe,
NS: RefUnwindSafe,
PB: RefUnwindSafe,
RLX: RefUnwindSafe,
T: RefUnwindSafe,
VS: RefUnwindSafe,
WIDTH: RefUnwindSafe,
LV: RefUnwindSafe,
NS: RefUnwindSafe,
PB: RefUnwindSafe,
RLX: RefUnwindSafe,
T: RefUnwindSafe,
VS: RefUnwindSafe,
WIDTH: RefUnwindSafe,
impl<T, PB, RLX, LV, VS, WIDTH, NS> Send for MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
LV: Send,
NS: Send,
PB: Send,
RLX: Send,
T: Send,
VS: Send,
WIDTH: Send,
LV: Send,
NS: Send,
PB: Send,
RLX: Send,
T: Send,
VS: Send,
WIDTH: Send,
impl<T, PB, RLX, LV, VS, WIDTH, NS> Sync for MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
LV: Sync,
NS: Sync,
PB: Sync,
RLX: Sync,
T: Sync,
VS: Sync,
WIDTH: Sync,
LV: Sync,
NS: Sync,
PB: Sync,
RLX: Sync,
T: Sync,
VS: Sync,
WIDTH: Sync,
impl<T, PB, RLX, LV, VS, WIDTH, NS> Unpin for MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
LV: Unpin,
NS: Unpin,
PB: Unpin,
RLX: Unpin,
T: Unpin,
VS: Unpin,
WIDTH: Unpin,
LV: Unpin,
NS: Unpin,
PB: Unpin,
RLX: Unpin,
T: Unpin,
VS: Unpin,
WIDTH: Unpin,
impl<T, PB, RLX, LV, VS, WIDTH, NS> UnwindSafe for MDDBuilder<T, PB, RLX, LV, VS, WIDTH, NS> where
LV: UnwindSafe,
NS: UnwindSafe,
PB: UnwindSafe,
RLX: UnwindSafe,
T: UnwindSafe,
VS: UnwindSafe,
WIDTH: UnwindSafe,
LV: UnwindSafe,
NS: UnwindSafe,
PB: UnwindSafe,
RLX: UnwindSafe,
T: UnwindSafe,
VS: UnwindSafe,
WIDTH: UnwindSafe,
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<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,