[−][src]Struct ddo::core::implementation::dp::Minimize
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]
fn nb_vars(&self) -> usize
[src]
fn initial_state(&self) -> T
[src]
fn initial_value(&self) -> i32
[src]
fn domain_of<'a>(&self, state: &'a T, var: Variable) -> Domain<'a>
[src]
fn transition(&self, state: &T, vars: &VarSet, d: Decision) -> T
[src]
fn transition_cost(&self, state: &T, vars: &VarSet, d: Decision) -> i32
[src]
fn impacted_by(&self, state: &T, variable: Variable) -> bool
[src]
fn root_node(&self) -> Node<T>
[src]
fn all_vars(&self) -> VarSet
[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for Minimize<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for Minimize<P> where
P: Send,
P: Send,
impl<P> Sync for Minimize<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Minimize<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for Minimize<P> where
P: UnwindSafe,
P: 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> 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>,