Struct snowcap::optimizers::TreeOptimizer[][src]

pub struct TreeOptimizer<P> where
    P: SoftPolicy + Clone
{ /* fields omitted */ }

Tree Optimizer

Optimizer that builds a tree of possible modifiers (based on the hard hard_policy), and traverses it by minimizing the soft policies in each step. To achieve this, this optimizer will, at each step of the tree traversal, compute the cost of all possible next choices (modifiers), and take the one with the lowest cost associated with it. During this, we immediately discard modifiers which would lead to an invalid state, with respect to the given hard hard_policy.

This optimizer is very similar to the TreeStrategy. Hence, this algorithm also works very well with problems consisting only of dependency groups with an immediate effect. In this case, this algorithm is extremely fast. However, when the problems have no immedaite effect, this algorithm will have problems if the number of modidfiers is too large.

Implementations

impl<P> TreeOptimizer<P> where
    P: SoftPolicy + Clone
[src]

pub fn set_max_backtrack(&mut self, max_backtrack: usize)[src]

Set the maximum backtrack level. If this level is reached, then the strategy will return Err(ReachedMaxBacktrack). The backtrack level will always be reset if we enter a new leaf. As an example, if we set the backtrack level to 3, and we need to backtrack twice, but find another branch to enter, then it will be reset back to 0.

Trait Implementations

impl<P: Debug> Debug for TreeOptimizer<P> where
    P: SoftPolicy + Clone
[src]

impl<P> Optimizer<P> for TreeOptimizer<P> where
    P: SoftPolicy + Clone
[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for TreeOptimizer<P> where
    P: RefUnwindSafe
[src]

impl<P> Send for TreeOptimizer<P> where
    P: Send
[src]

impl<P> !Sync for TreeOptimizer<P>[src]

impl<P> Unpin for TreeOptimizer<P> where
    P: Unpin
[src]

impl<P> UnwindSafe for TreeOptimizer<P> where
    P: UnwindSafe
[src]

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]