Solver

Struct Solver 

Source
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 reference
  • P - Tuple of phases to execute
  • T - Termination condition (use Option<ConcreteTermination>)
  • S - Solution type
  • D - Score director type

Implementations§

Source§

impl<P, S, D> Solver<'static, P, NoTermination, S, D>

Source

pub fn new(phases: P) -> Self

Creates a new solver with the given phases tuple and no termination.

Source

pub fn with_termination<T>( self, termination: T, ) -> Solver<'static, P, Option<T>, S, D>

Sets the termination condition.

Source§

impl<'t, P, T, S, D> Solver<'t, P, T, S, D>

Source

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.

Source

pub fn with_time_limit(self, limit: Duration) -> Self

Sets the time limit for solving.

Source

pub fn with_config(self, config: SolverConfig) -> Self

Sets configuration.

Source

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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where D: ScoreDirector<S>, T: MaybeTermination<S, D>, P0: Phase<S, D>,

Solves using a provided score director.

Source§

impl<'t, S, T, P0, P1> Solver<'t, (P0, P1), T, S, ()>
where S: PlanningSolution, T: Send,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where D: ScoreDirector<S>, T: MaybeTermination<S, D>, P0: Phase<S, D>, P1: Phase<S, D>,

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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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,

Source

pub fn solve_with_director<D>(self, director: D) -> S
where 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> Solver<'t, (P0,), T, S, D>
where S: PlanningSolution, D: ScoreDirector<S>, T: MaybeTermination<S, D>, P0: Phase<S, D>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the 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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

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>,

Source

pub fn solve(&mut self, score_director: D) -> S

Solves using the provided score director.

Trait Implementations§

Source§

impl<P: Debug, T: Debug, S, D> Debug for Solver<'_, P, T, S, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'t, P, T, S, D> Freeze for Solver<'t, P, T, S, D>
where P: Freeze, T: Freeze,

§

impl<'t, P, T, S, D> RefUnwindSafe for Solver<'t, P, T, S, D>

§

impl<'t, P, T, S, D> Send for Solver<'t, P, T, S, D>
where P: Send, T: Send,

§

impl<'t, P, T, S, D> Sync for Solver<'t, P, T, S, D>
where P: Sync, T: Sync,

§

impl<'t, P, T, S, D> Unpin for Solver<'t, P, T, S, D>
where P: Unpin, T: Unpin,

§

impl<'t, P, T, S, D> UnwindSafe for Solver<'t, P, T, S, D>
where P: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more