[][src]Struct ddo::core::implementation::heuristics::NaturalOrder

pub struct NaturalOrder;

This is the default variable branching heuristic This strategy branches on the variables in their ''natural'' order. That is, it will first pick Variable(0) then Variable(1), Variable(2), etc... until there are no variables left to branch on.

Example


let mut variables = VarSet::all(3);
assert_eq!(Some(Variable(0)), NaturalOrder.next_var(&variables, current_layer, next_layer));

variables.remove(Variable(0)); // move on to the next layer
assert_eq!(Some(Variable(1)), NaturalOrder.next_var(&variables, current_layer, next_layer));

variables.remove(Variable(1)); // move on to the next layer
assert_eq!(Some(Variable(2)), NaturalOrder.next_var(&variables, current_layer, next_layer));

variables.remove(Variable(2)); // move on to the last layer, no more var to branch on
assert_eq!(None, NaturalOrder.next_var(&variables, current_layer, next_layer));

Note:

Even though any variable heuristic may access the current and next layers of the mdd being developed, the natural ordering heuristic does not use that access.

Trait Implementations

impl Clone for NaturalOrder[src]

impl Debug for NaturalOrder[src]

impl Default for NaturalOrder[src]

impl<T> VariableHeuristic<T> for NaturalOrder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.