[][src]Struct ddo::core::implementation::dp::Minimize

pub struct Minimize<P>(pub P);

This structure provides a simple adapter to express a minimization intent on the objective function instead of the assumed maximization.

Warning

The Minimize() api is still subject to change. Minimize implements the Problem trait by delgating all calls to the target but it flips the signs of the transition costs and initial value. Hence, the the sign of the final 'best' solution should be flipped in order to get the actual solution value.

Example Usage

use ddo::core::implementation::dp::Minimize;
let problem    = Minimize(MockProblem);
let relaxation = MockRelax;
let mdd        = mdd_builder_ref(&problem, relaxation).build();
let mut solver = ParallelSolver::new(mdd);
// val is the optimal value of the objective function. However, because
// the signs of all transition costs and initial values have been flipped,
// the sign of that optimal value should be flipped too.
let (val, sol) = solver.maximize();
// This is the 'true' value obtained by taking the best decisions in the
// original problem
let actual_val = -val;

Trait Implementations

impl<P: Clone> Clone for Minimize<P>[src]

impl<P: Debug> Debug for Minimize<P>[src]

impl<T, P: Problem<T>> Problem<T> for Minimize<P>[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for Minimize<P> where
    P: RefUnwindSafe

impl<P> Send for Minimize<P> where
    P: Send

impl<P> Sync for Minimize<P> where
    P: Sync

impl<P> Unpin for Minimize<P> where
    P: Unpin

impl<P> UnwindSafe for Minimize<P> where
    P: UnwindSafe

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.