Module manager

Module manager 

Source
Expand description

High-level solver management with ergonomic API.

The SolverManager provides a simplified interface for configuring and running solvers. It stores configuration and can create solvers on demand.

§Overview

The manager module provides:

§Example

use solverforge_solver::manager::{SolverManager, LocalSearchType};
use solverforge_core::domain::PlanningSolution;
use solverforge_core::score::SimpleScore;
use std::time::Duration;

#[derive(Clone)]
struct Schedule { score: Option<SimpleScore> }

impl PlanningSolution for Schedule {
    type Score = SimpleScore;
    fn score(&self) -> Option<Self::Score> { self.score }
    fn set_score(&mut self, score: Option<Self::Score>) { self.score = score; }
}

// Create a manager with score calculator and termination
let manager = SolverManager::<Schedule>::builder(|_| SimpleScore::of(0))
    .with_construction_heuristic()
    .with_local_search(LocalSearchType::HillClimbing)
    .with_time_limit(Duration::from_secs(30))
    .build()
    .expect("Failed to build manager");

// Create a solver from the manager
let solver = manager.create_solver();

Structs§

CloneablePhaseFactory
A simple phase factory that clones a prototype phase.
ClosurePhaseFactory
A phase factory using a closure.
ConstructionPhaseFactory
Factory for creating construction heuristic phases.
LocalSearchPhaseFactory
Factory for creating local search phases.
SolverManager
High-level solver manager for ergonomic solving.
SolverManagerBuilder
Builder for creating a SolverManager with fluent configuration.

Enums§

ConstructionType
Type of construction heuristic to use.
LocalSearchType
Type of local search algorithm to use.
PhaseConfig
Configuration for a phase.

Traits§

SolverPhaseFactory
Factory trait for creating phases.