[][src]Struct ddo::core::implementation::solver::sequential::SequentialSolver

pub struct SequentialSolver<T, DD> where
    T: Hash + Eq + Clone,
    DD: MDD<T>, 
{ /* fields omitted */ }

This is the structure implementing an single-threaded MDD solver.

Example Usage

let problem    = MockProblem;
let relaxation = MockRelax;
let mdd        = mdd_builder_ref(&problem, relaxation).build();
// the solver is created using an mdd.
let mut solver = SequentialSolver::new(mdd);
// val is the optimal value of the objective function,
// sol is the sequence of decision yielding that optimal value (if sol exists, `sol != None`)
let (val, sol) = solver.maximize();

Methods

impl<T, DD> SequentialSolver<T, DD> where
    T: Hash + Eq + Clone,
    DD: MDD<T>, 
[src]

pub fn new(mdd: DD) -> Self[src]

This creates a solver that will find the best solution in the problem described by the given mdd (mdd is not expanded yet). This solver will return the optimal solution from what would be an exact expansion of mdd.

pub fn with_verbosity(mdd: DD, verbosity: u8) -> Self[src]

This creates a solver that will find the best solution in the problem described by the given mdd (mdd is not expanded yet) and configure that solver to be more or less verbose.

Return value

This solver will return the optimal solution from what would be an exact expansion of mdd.

Verbosity

So far, there are three levels of verbosity:

  • 0 which prints nothing
  • 1 which only prints the final statistics when the problem is solved
  • 2 which prints progress information every 100 explored nodes.

pub fn customized(mdd: DD, verbosity: u8) -> Self[src]

This constructor lets you specify all the configurable elements of this solver as parameters. So far, the functionality of this constructor is exactly the same as that of with_verbosity. The latter is considered clearer, and thus you are encouraged to use that one.

This constructor creates a solver that will find the best solution in the problem described by the given mdd (mdd is not expanded yet) and configure that solver to be more or less verbose.

Return value

This solver will return the optimal solution from what would be an exact expansion of mdd.

Verbosity

So far, there are three levels of verbosity:

  • 0 which prints nothing
  • 1 which only prints the final statistics when the problem is solved
  • 2 which prints progress information every 100 explored nodes.

Trait Implementations

impl<T, DD> Solver for SequentialSolver<T, DD> where
    T: Hash + Eq + Clone,
    DD: MDD<T>, 
[src]

fn maximize(&mut self) -> (i32, &Option<Vec<Decision>>)[src]

Applies the branch and bound algorithm proposed by Bergman et al. to solve the problem to optimality.

Auto Trait Implementations

impl<T, DD> RefUnwindSafe for SequentialSolver<T, DD> where
    DD: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, DD> Send for SequentialSolver<T, DD> where
    DD: Send,
    T: Send

impl<T, DD> Sync for SequentialSolver<T, DD> where
    DD: Sync,
    T: Sync

impl<T, DD> Unpin for SequentialSolver<T, DD> where
    DD: Unpin,
    T: Unpin

impl<T, DD> UnwindSafe for SequentialSolver<T, DD> where
    DD: UnwindSafe,
    T: 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, 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.