pub struct Solver<S: PlanningSolution> { /* private fields */ }Expand description
The main solver that optimizes planning solutions.
The solver executes phases in sequence, checking termination conditions between phases and potentially within phases.
Implementations§
Source§impl<S: PlanningSolution> Solver<S>
impl<S: PlanningSolution> Solver<S>
Sourcepub fn from_config(config: SolverConfig) -> Self
pub fn from_config(config: SolverConfig) -> Self
Creates a solver from configuration (phases must be added separately).
Sourcepub fn with_phase(self, phase: Box<dyn Phase<S>>) -> Self
pub fn with_phase(self, phase: Box<dyn Phase<S>>) -> Self
Adds a phase to the solver.
Sourcepub fn with_phases(self, phases: Vec<Box<dyn Phase<S>>>) -> Self
pub fn with_phases(self, phases: Vec<Box<dyn Phase<S>>>) -> Self
Adds phases to the solver.
Sourcepub fn with_termination(self, termination: Box<dyn Termination<S>>) -> Self
pub fn with_termination(self, termination: Box<dyn Termination<S>>) -> Self
Sets the termination condition.
Sourcepub fn solve_with_director(
&mut self,
score_director: Box<dyn ScoreDirector<S>>,
) -> S
pub fn solve_with_director( &mut self, score_director: Box<dyn ScoreDirector<S>>, ) -> S
Solves using the provided score director.
This is the main solving method that executes all phases.
Sourcepub fn terminate_early(&self) -> bool
pub fn terminate_early(&self) -> bool
Requests early termination of the solving process.
This method is thread-safe and can be called from another thread.
Sourcepub fn is_solving(&self) -> bool
pub fn is_solving(&self) -> bool
Returns true if the solver is currently solving.
Sourcepub fn config(&self) -> Option<&SolverConfig>
pub fn config(&self) -> Option<&SolverConfig>
Returns the configuration if set.
Auto Trait Implementations§
impl<S> Freeze for Solver<S>
impl<S> !RefUnwindSafe for Solver<S>
impl<S> Send for Solver<S>
impl<S> !Sync for Solver<S>
impl<S> Unpin for Solver<S>
impl<S> !UnwindSafe for Solver<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more