pub struct SolveConfig {
pub pruning: Pruning,
pub ordering: Ordering,
pub max_solutions: usize,
pub backjumping: bool,
pub optimization_mode: OptimizationMode,
pub node_budget: Option<u64>,
}Expand description
Solve configuration, isomorphic to Python’s CSP constructor arguments.
Fields§
§pruning: Pruning§ordering: Ordering§max_solutions: usize§backjumping: boolWhether to use conflict-directed backjumping instead of chronological backtracking.
optimization_mode: OptimizationModeOptimization mode. Defaults to Feasibility (pure constraint satisfaction).
node_budget: Option<u64>Maximum number of search nodes (backtrack / branch-and-bound
recursions) before the solver aborts early and returns whatever
solutions it has found so far. None disables the budget.
Defaults to Some(1_000_000) so an unbounded pathological
search cannot hang a caller. When the budget is hit,
SolveStats::budget_exceeded is set to true on the
returning Csp::stats(). Callers that care about optimality
should branch on this flag and either accept the best-so-far
solution or fall back to a trivial per-variable pick.
Trait Implementations§
Source§impl Clone for SolveConfig
impl Clone for SolveConfig
Source§fn clone(&self) -> SolveConfig
fn clone(&self) -> SolveConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SolveConfig
impl Debug for SolveConfig
Auto Trait Implementations§
impl Freeze for SolveConfig
impl RefUnwindSafe for SolveConfig
impl Send for SolveConfig
impl Sync for SolveConfig
impl Unpin for SolveConfig
impl UnsafeUnpin for SolveConfig
impl UnwindSafe for SolveConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more