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_by_descriptor: fn(&S, usize) -> usize,
terminate: Option<&AtomicBool>,
sender: UnboundedSender<(S, S::Score)>,
variable_field: &'static str,
descriptor_index: usize,
) -> SExpand description
Solves a basic variable problem using construction heuristic + local search.
This function is called by macro-generated solve() methods for solutions
using #[basic_variable_config]. When phases are configured in solver.toml,
the acceptor, forager, and move selectors are built from config; otherwise
defaults are used.
§Type Parameters
S- The solution type (must implementPlanningSolution)C- The constraint set type
§Arguments
solution- The initial solution to solvefinalize_fn- Function to prepare derived fields before solvingconstraints_fn- Function that creates the constraint setget_variable- Gets the planning variable value for an entityset_variable- Sets the planning variable value for an entityvalue_count- Returns the number of valid valuesentity_count_fn- Returns the number of entitiesdescriptor- Solution descriptor for solver infrastructureentity_count_by_descriptor- Returns entity count for a given descriptor indexterminate- Optional external termination flagsender- Channel for streaming best solutions as they are foundvariable_field- Variable field namedescriptor_index- Descriptor index