pub struct PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution,
D: ScoreDirector<S>,
PD: ScoreDirector<S>,
Part: SolutionPartitioner<S>,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD>,{ /* private fields */ }Expand description
Partitioned search phase that solves partitions in parallel.
This phase:
- Partitions the solution using the provided partitioner
- Creates a solver for each partition
- Runs child phases on each partition in parallel
- Merges the solved partitions back together
Each partition runs independently with its own solver scope.
§Type Parameters
S- The solution typeD- The main solver’s score director typePD- The score director type for partition solversPart- The partitioner type (implementsSolutionPartitioner<S>)SDF- The score director factory function typePF- The phase factory function typeCP- The child phases type (tuple of phases)
Implementations§
Source§impl<S, D, PD, Part, SDF, PF, CP> PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution,
D: ScoreDirector<S>,
PD: ScoreDirector<S>,
Part: SolutionPartitioner<S>,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD>,
impl<S, D, PD, Part, SDF, PF, CP> PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution,
D: ScoreDirector<S>,
PD: ScoreDirector<S>,
Part: SolutionPartitioner<S>,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD>,
Sourcepub fn new(
partitioner: Part,
score_director_factory: SDF,
phase_factory: PF,
) -> Self
pub fn new( partitioner: Part, score_director_factory: SDF, phase_factory: PF, ) -> Self
Creates a new partitioned search phase.
Sourcepub fn with_config(
partitioner: Part,
score_director_factory: SDF,
phase_factory: PF,
config: PartitionedSearchConfig,
) -> Self
pub fn with_config( partitioner: Part, score_director_factory: SDF, phase_factory: PF, config: PartitionedSearchConfig, ) -> Self
Creates a partitioned search phase with custom configuration.
Trait Implementations§
Source§impl<S, D, PD, Part, SDF, PF, CP> Debug for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution,
D: ScoreDirector<S>,
PD: ScoreDirector<S>,
Part: SolutionPartitioner<S> + Debug,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD>,
impl<S, D, PD, Part, SDF, PF, CP> Debug for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution,
D: ScoreDirector<S>,
PD: ScoreDirector<S>,
Part: SolutionPartitioner<S> + Debug,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD>,
Source§impl<S, D, PD, Part, SDF, PF, CP> Phase<S, D> for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution + 'static,
D: ScoreDirector<S>,
PD: ScoreDirector<S> + 'static,
Part: SolutionPartitioner<S>,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD> + Send,
impl<S, D, PD, Part, SDF, PF, CP> Phase<S, D> for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>where
S: PlanningSolution + 'static,
D: ScoreDirector<S>,
PD: ScoreDirector<S> + 'static,
Part: SolutionPartitioner<S>,
SDF: Fn(S) -> PD + Send + Sync,
PF: Fn() -> CP + Send + Sync,
CP: ChildPhases<S, PD> + Send,
Source§fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>)
fn solve(&mut self, solver_scope: &mut SolverScope<'_, S, D>)
Executes this phase. Read more
Source§fn phase_type_name(&self) -> &'static str
fn phase_type_name(&self) -> &'static str
Returns the name of this phase type.
Auto Trait Implementations§
impl<S, D, PD, Part, SDF, PF, CP> Freeze for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
impl<S, D, PD, Part, SDF, PF, CP> RefUnwindSafe for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
impl<S, D, PD, Part, SDF, PF, CP> Send for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
impl<S, D, PD, Part, SDF, PF, CP> Sync for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
impl<S, D, PD, Part, SDF, PF, CP> Unpin for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
impl<S, D, PD, Part, SDF, PF, CP> UnwindSafe for PartitionedSearchPhase<S, D, PD, Part, SDF, PF, CP>
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