[−][src]Struct ddo::ParallelSolver
Implementations
impl<T, C, DD> ParallelSolver<T, C, SimpleFrontier<T>, DD> where
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
DD: MDD<T, C> + From<C>, [src]
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
DD: MDD<T, C> + From<C>,
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.
All the other parameters will use their default value.
+ nb_threads will be the number of hardware threads
+ verbosity will be 0
Warning
By passing the given MDD, you are effectively only passing the type of the mdd to use while developing the restricted and relaxed representations. Each thread will instantiate its own fresh copy using a clone of the configuration you provided. However, it will not clone your mdd. The latter will be dropped as soon as the constructor ends. However, clean copies are created when maximizing the objective function.
pub fn customized(mdd: DD, verbosity: u8, nb_threads: usize) -> Self[src]
This constructor lets you specify all the configuration parameters of the solver.
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.
Nb Threads
The nb_threads argument lets you customize the number of threads to
spawn in order to solve the problem. We advise you to use the number of
hardware threads on your machine.
Warning
By passing the given MDD, you are effectively only passing the type of the mdd to use while developing the restricted and relaxed representations. Each thread will instantiate its own fresh copy using a clone of the configuration you provided. However, it will not clone your mdd. The latter will be dropped as soon as the constructor ends. However, clean copies are created when maximizing the objective function.
impl<T, C, F, DD> ParallelSolver<T, C, F, DD> where
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
F: Send + Sync + Frontier<T>,
DD: MDD<T, C> + From<C>, [src]
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
F: Send + Sync + Frontier<T>,
DD: MDD<T, C> + From<C>,
private interface of the parallel solver
pub fn with_verbosity(self, verbosity: u8) -> Self[src]
Sets the verbosity of the solver
pub fn with_nb_threads(self, nb_threads: usize) -> Self[src]
Sets the number of threads used by the solver
pub fn with_frontier<FF: Frontier<T> + Send + Sync>(
self,
ff: FF
) -> ParallelSolver<T, C, FF, DD>[src]
self,
ff: FF
) -> ParallelSolver<T, C, FF, DD>
Sets the kind of frontier to use
Trait Implementations
impl<T, C, F, DD> Solver for ParallelSolver<T, C, F, DD> where
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
F: Send + Sync + Frontier<T>,
DD: MDD<T, C> + From<C>, [src]
T: Send + Sync + Hash + Eq + Clone,
C: Send + Sync + Clone + Config<T>,
F: Send + Sync + Frontier<T>,
DD: MDD<T, C> + From<C>,
pub fn maximize(&mut self) -> Completion[src]
Applies the branch and bound algorithm proposed by Bergman et al. to
solve the problem to optimality. To do so, it spawns nb_threads workers
(long running threads); each of which will continually get a workload
and process it until the problem is solved.
pub fn best_solution(&self) -> Option<Solution>[src]
Returns the best solution that has been identified for this problem.
pub fn best_value(&self) -> Option<isize>[src]
Returns the value of the best solution that has been identified for this problem.
pub fn set_primal(&mut self, value: isize, best_sol: Solution)[src]
Sets the best known value and/or solution. This solution and value may be obtained from any other available means (LP relax for instance).
Auto Trait Implementations
impl<T, C, F, DD> !RefUnwindSafe for ParallelSolver<T, C, F, DD>
impl<T, C, F, DD> Send for ParallelSolver<T, C, F, DD> where
DD: Send,
DD: Send,
impl<T, C, F, DD> Sync for ParallelSolver<T, C, F, DD> where
DD: Sync,
DD: Sync,
impl<T, C, F, DD> Unpin for ParallelSolver<T, C, F, DD> where
C: Unpin,
DD: Unpin,
C: Unpin,
DD: Unpin,
impl<T, C, F, DD> !UnwindSafe for ParallelSolver<T, C, F, DD>
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,
pub 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, 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.
pub 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>,