run_solver

Function run_solver 

Source
pub fn run_solver<S, C>(
    solution: S,
    finalize_fn: fn(&mut S),
    constraints_fn: fn() -> C,
    get_variable: fn(&S, usize) -> Option<usize>,
    set_variable: fn(&mut S, usize, Option<usize>),
    value_count: fn(&S) -> usize,
    entity_count_fn: fn(&S) -> usize,
    _descriptor: fn() -> SolutionDescriptor,
    _entity_count: fn(&S, usize) -> usize,
    _variable_field: &'static str,
    _descriptor_index: usize,
) -> S
where S: PlanningSolution, S::Score: Score, C: ConstraintSet<S, S::Score>,
Expand description

Solves a basic variable problem using construction heuristic + late acceptance local search.

This function is called by macro-generated solve() methods for solutions using #[basic_variable_config].

§Type Parameters

  • S - The solution type (must implement PlanningSolution)
  • C - The constraint set type

§Arguments

  • solution - The initial solution to solve
  • finalize_fn - Function to prepare derived fields before solving
  • constraints_fn - Function that creates the constraint set
  • get_variable - Gets the planning variable value for an entity
  • set_variable - Sets the planning variable value for an entity
  • value_count - Returns the number of valid values
  • entity_count_fn - Returns the number of entities
  • _descriptor - Solution descriptor (unused, for future extensions)
  • _entity_count - Entity count function (unused, for future extensions)
  • _variable_field - Variable field name (unused, for future extensions)
  • _descriptor_index - Descriptor index (unused, for future extensions)