pub struct Solver<'t, P, T, S, D> { /* private fields */ }Expand description
The main solver that optimizes planning solutions.
Uses macro-generated tuple implementations for phases, preserving concrete types through the entire pipeline (zero-erasure architecture).
§Type Parameters
't- Lifetime of the termination flag referenceP- Tuple of phases to executeT- Termination condition (useOption<ConcreteTermination>)S- Solution typeD- Score director type
Implementations§
Source§impl<P, S, D> Solver<'static, P, NoTermination, S, D>where
S: PlanningSolution,
impl<P, S, D> Solver<'static, P, NoTermination, S, D>where
S: PlanningSolution,
Source§impl<'t, P, T, S, D> Solver<'t, P, T, S, D>where
S: PlanningSolution,
impl<'t, P, T, S, D> Solver<'t, P, T, S, D>where
S: PlanningSolution,
Sourcepub fn with_terminate(self, terminate: &AtomicBool) -> Solver<'_, P, T, S, D>
pub fn with_terminate(self, terminate: &AtomicBool) -> Solver<'_, P, T, S, D>
Sets the external termination flag.
The solver will check this flag periodically and terminate early if set.
Sourcepub fn with_time_limit(self, limit: Duration) -> Self
pub fn with_time_limit(self, limit: Duration) -> Self
Sets the time limit for solving.
Sourcepub fn with_config(self, config: SolverConfig) -> Self
pub fn with_config(self, config: SolverConfig) -> Self
Sets configuration.
Sourcepub fn config(&self) -> Option<&SolverConfig>
pub fn config(&self) -> Option<&SolverConfig>
Returns the configuration if set.
Source§impl<'t, S, T, P0> Solver<'t, (P0,), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0> Solver<'t, (P0,), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> S
pub fn solve_with_director<D>(self, director: D) -> S
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1> Solver<'t, (P0, P1), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1> Solver<'t, (P0, P1), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> S
pub fn solve_with_director<D>(self, director: D) -> S
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2> Solver<'t, (P0, P1, P2), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2> Solver<'t, (P0, P1, P2), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2, P3> Solver<'t, (P0, P1, P2, P3), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2, P3> Solver<'t, (P0, P1, P2, P3), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2, P3, P4> Solver<'t, (P0, P1, P2, P3, P4), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2, P3, P4> Solver<'t, (P0, P1, P2, P3, P4), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2, P3, P4, P5> Solver<'t, (P0, P1, P2, P3, P4, P5), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2, P3, P4, P5> Solver<'t, (P0, P1, P2, P3, P4, P5), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2, P3, P4, P5, P6> Solver<'t, (P0, P1, P2, P3, P4, P5, P6), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2, P3, P4, P5, P6> Solver<'t, (P0, P1, P2, P3, P4, P5, P6), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, T, P0, P1, P2, P3, P4, P5, P6, P7> Solver<'t, (P0, P1, P2, P3, P4, P5, P6, P7), T, S, ()>where
S: PlanningSolution,
T: Send,
impl<'t, S, T, P0, P1, P2, P3, P4, P5, P6, P7> Solver<'t, (P0, P1, P2, P3, P4, P5, P6, P7), T, S, ()>where
S: PlanningSolution,
T: Send,
Sourcepub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
P7: Phase<S, D>,
pub fn solve_with_director<D>(self, director: D) -> Swhere
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
P7: Phase<S, D>,
Solves using a provided score director.
Source§impl<'t, S, D, T, P0, P1> Solver<'t, (P0, P1), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
impl<'t, S, D, T, P0, P1> Solver<'t, (P0, P1), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2> Solver<'t, (P0, P1, P2), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2> Solver<'t, (P0, P1, P2), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2, P3> Solver<'t, (P0, P1, P2, P3), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2, P3> Solver<'t, (P0, P1, P2, P3), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2, P3, P4> Solver<'t, (P0, P1, P2, P3, P4), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2, P3, P4> Solver<'t, (P0, P1, P2, P3, P4), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2, P3, P4, P5> Solver<'t, (P0, P1, P2, P3, P4, P5), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2, P3, P4, P5> Solver<'t, (P0, P1, P2, P3, P4, P5), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2, P3, P4, P5, P6> Solver<'t, (P0, P1, P2, P3, P4, P5, P6), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2, P3, P4, P5, P6> Solver<'t, (P0, P1, P2, P3, P4, P5, P6), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
Source§impl<'t, S, D, T, P0, P1, P2, P3, P4, P5, P6, P7> Solver<'t, (P0, P1, P2, P3, P4, P5, P6, P7), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
P7: Phase<S, D>,
impl<'t, S, D, T, P0, P1, P2, P3, P4, P5, P6, P7> Solver<'t, (P0, P1, P2, P3, P4, P5, P6, P7), T, S, D>where
S: PlanningSolution,
D: ScoreDirector<S>,
T: MaybeTermination<S, D>,
P0: Phase<S, D>,
P1: Phase<S, D>,
P2: Phase<S, D>,
P3: Phase<S, D>,
P4: Phase<S, D>,
P5: Phase<S, D>,
P6: Phase<S, D>,
P7: Phase<S, D>,
Trait Implementations§
Auto Trait Implementations§
impl<'t, P, T, S, D> Freeze for Solver<'t, P, T, S, D>
impl<'t, P, T, S, D> RefUnwindSafe for Solver<'t, P, T, S, D>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<'t, P, T, S, D> Send for Solver<'t, P, T, S, D>
impl<'t, P, T, S, D> Sync for Solver<'t, P, T, S, D>
impl<'t, P, T, S, D> Unpin for Solver<'t, P, T, S, D>
impl<'t, P, T, S, D> UnwindSafe for Solver<'t, P, T, S, D>where
P: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more