solverforge_solver/phase/construction/
mod.rs

1//! Construction heuristic phase
2//!
3//! Builds an initial solution by assigning values to uninitialized
4//! planning variables one at a time.
5
6mod forager;
7mod phase;
8mod placer;
9
10pub use forager::{
11    BestFitForager, ConstructionForager, FirstFeasibleForager, FirstFitForager,
12    StrongestFitForager, WeakestFitForager,
13};
14pub use phase::ConstructionHeuristicPhase;
15pub use placer::{EntityPlacer, Placement, QueuedEntityPlacer, SortedEntityPlacer};
16
17/// Construction heuristic phase configuration.
18#[derive(Debug, Clone)]
19pub struct ConstructionHeuristicConfig {
20    /// The forager type to use.
21    pub forager_type: ForagerType,
22}
23
24impl Default for ConstructionHeuristicConfig {
25    fn default() -> Self {
26        Self {
27            forager_type: ForagerType::FirstFit,
28        }
29    }
30}
31
32/// Type of forager to use in construction.
33#[derive(Debug, Clone, Copy, PartialEq, Eq)]
34pub enum ForagerType {
35    /// Accept the first feasible move.
36    FirstFit,
37    /// Evaluate all moves and pick the best.
38    BestFit,
39}