solverforge_solver/manager/
mod.rs

1//! High-level solver management with zero-erasure API.
2//!
3//! # Zero-Erasure Design
4//!
5//! All types flow through generics - no Box, Arc, or dyn anywhere.
6//! Runtime configuration from TOML/YAML is handled by the macro layer
7//! which generates concrete types at compile time.
8
9mod builder;
10mod config;
11mod phase_factory;
12mod solution_manager;
13mod solver_factory;
14mod solver_manager;
15
16#[cfg(test)]
17mod builder_tests;
18#[cfg(test)]
19mod mod_tests;
20#[cfg(test)]
21mod mod_tests_integration;
22
23pub use builder::{SolverBuildError, SolverFactoryBuilder};
24pub use config::{ConstructionType, LocalSearchType, PhaseConfig};
25pub use phase_factory::{
26    ConstructionPhaseFactory, KOptPhase, KOptPhaseBuilder, ListConstructionPhase,
27    ListConstructionPhaseBuilder, LocalSearchPhaseFactory,
28};
29pub use solution_manager::{Analyzable, ConstraintAnalysis, ScoreAnalysis, SolutionManager};
30pub use solver_factory::{solver_factory_builder, SolverFactory};
31pub use solver_manager::{Solvable, SolverManager, SolverStatus};
32
33use solverforge_core::domain::PlanningSolution;
34use solverforge_scoring::ScoreDirector;
35
36use crate::phase::Phase;
37
38/// Factory trait for creating phases with zero type erasure.
39///
40/// Returns a concrete phase type via associated type, preserving
41/// full type information through the pipeline.
42///
43/// # Type Parameters
44///
45/// * `S` - The solution type
46/// * `D` - The score director type
47pub trait PhaseFactory<S, D>: Send + Sync
48where
49    S: PlanningSolution,
50    D: ScoreDirector<S>,
51{
52    /// The concrete phase type produced by this factory.
53    type Phase: Phase<S, D>;
54
55    /// Creates a new phase instance with concrete type.
56    fn create(&self) -> Self::Phase;
57}