pub struct SolverFactoryBuilder<S, D, C, P, T>where
S: PlanningSolution,{ /* private fields */ }Expand description
Builder for SolverFactory with zero type erasure.
Accumulates configuration and produces a fully typed SolverFactory.
Type bounds are only checked at build() time.
Implementations§
Source§impl<S, D, C> SolverFactoryBuilder<S, D, C, (), NoTermination>
impl<S, D, C> SolverFactoryBuilder<S, D, C, (), NoTermination>
Source§impl<S, D, C, P, T> SolverFactoryBuilder<S, D, C, P, T>where
S: PlanningSolution,
impl<S, D, C, P, T> SolverFactoryBuilder<S, D, C, P, T>where
S: PlanningSolution,
Sourcepub fn with_phase<P2>(
self,
phase: P2,
) -> SolverFactoryBuilder<S, D, C, (P, P2), T>
pub fn with_phase<P2>( self, phase: P2, ) -> SolverFactoryBuilder<S, D, C, (P, P2), T>
Adds a phase, returning a new builder with updated phase tuple.
Sourcepub fn with_phase_factory<F>(
self,
factory: F,
) -> SolverFactoryBuilder<S, D, C, (P, F::Phase), T>where
D: ScoreDirector<S>,
F: PhaseFactory<S, D>,
pub fn with_phase_factory<F>(
self,
factory: F,
) -> SolverFactoryBuilder<S, D, C, (P, F::Phase), T>where
D: ScoreDirector<S>,
F: PhaseFactory<S, D>,
Adds a phase from a factory, returning a new builder with updated phase tuple.
The factory’s create() method is called to produce the phase.
Sourcepub fn with_config(
self,
config: SolverConfig,
) -> SolverFactoryBuilder<S, D, C, P, TimeTermination>
pub fn with_config( self, config: SolverConfig, ) -> SolverFactoryBuilder<S, D, C, P, TimeTermination>
Applies configuration from a SolverConfig.
Currently applies termination settings from the config.
Sourcepub fn with_time_limit(
self,
duration: Duration,
) -> SolverFactoryBuilder<S, D, C, P, TimeTermination>
pub fn with_time_limit( self, duration: Duration, ) -> SolverFactoryBuilder<S, D, C, P, TimeTermination>
Sets time limit termination.
Sourcepub fn with_step_limit(
self,
steps: u64,
) -> SolverFactoryBuilder<S, D, C, P, StepCountTermination>
pub fn with_step_limit( self, steps: u64, ) -> SolverFactoryBuilder<S, D, C, P, StepCountTermination>
Sets step limit termination.
Sourcepub fn with_time_limit_or(
self,
duration: Duration,
) -> SolverFactoryBuilder<S, D, C, P, OrTermination<(T, TimeTermination), S, D>>where
D: ScoreDirector<S>,
pub fn with_time_limit_or(
self,
duration: Duration,
) -> SolverFactoryBuilder<S, D, C, P, OrTermination<(T, TimeTermination), S, D>>where
D: ScoreDirector<S>,
Combines current termination with time limit.
Source§impl<S, D, C, P, T> SolverFactoryBuilder<S, D, C, P, T>where
S: PlanningSolution,
D: ScoreDirector<S>,
C: Fn(&S) -> S::Score + Send + Sync,
P: Phase<S, D>,
T: Termination<S, D>,
impl<S, D, C, P, T> SolverFactoryBuilder<S, D, C, P, T>where
S: PlanningSolution,
D: ScoreDirector<S>,
C: Fn(&S) -> S::Score + Send + Sync,
P: Phase<S, D>,
T: Termination<S, D>,
Sourcepub fn build(self) -> Result<SolverFactory<S, D, C, P, T>, SolverBuildError>
pub fn build(self) -> Result<SolverFactory<S, D, C, P, T>, SolverBuildError>
Builds the SolverFactory.
Returns Ok(SolverFactory) on success, or Err if configuration is invalid.
Currently always succeeds as validation happens at compile time via type bounds.
Auto Trait Implementations§
impl<S, D, C, P, T> Freeze for SolverFactoryBuilder<S, D, C, P, T>
impl<S, D, C, P, T> RefUnwindSafe for SolverFactoryBuilder<S, D, C, P, T>
impl<S, D, C, P, T> Send for SolverFactoryBuilder<S, D, C, P, T>
impl<S, D, C, P, T> Sync for SolverFactoryBuilder<S, D, C, P, T>
impl<S, D, C, P, T> Unpin for SolverFactoryBuilder<S, D, C, P, T>
impl<S, D, C, P, T> UnwindSafe for SolverFactoryBuilder<S, D, C, P, T>
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