pub enum Strategy {
BottomLeftFill,
NfpGuided,
GeneticAlgorithm,
Brkga,
SimulatedAnnealing,
ExtremePoint,
Gdrr,
Alns,
MilpExact,
HybridExact,
}Expand description
Optimization strategy.
Variants§
BottomLeftFill
Bottom-Left Fill (fast, lower quality).
NfpGuided
NFP-guided placement (balanced).
GeneticAlgorithm
Genetic Algorithm (slower, higher quality).
Brkga
Biased Random-Key Genetic Algorithm (balanced, robust).
SimulatedAnnealing
Simulated Annealing.
ExtremePoint
Extreme Point heuristic (3D only).
Gdrr
Goal-Driven Ruin and Recreate (GDRR).
Alns
Adaptive Large Neighborhood Search (ALNS).
MilpExact
MILP-based exact solver (small instances, optimal solution).
HybridExact
Hybrid: Try exact first, fallback to heuristic on timeout.
Implementations§
Source§impl Strategy
impl Strategy
Sourcepub const ALL: [Self; 10]
pub const ALL: [Self; 10]
Every strategy, in the order of Strategy::NAMES.
Sourcepub const NAMES: [&'static str; 10]
pub const NAMES: [&'static str; 10]
The short name of each strategy – what a refusal of an unknown name
lists as expected. Strategy::parse reads these and the longer
forms in Strategy::SPELLINGS.
Sourcepub const SPELLINGS: [(&'static str, Self); 18]
pub const SPELLINGS: [(&'static str, Self); 18]
Every spelling Strategy::parse reads, with the strategy it names:
the Strategy::NAMES and their longer forms.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The strategy’s short name – its entry in Strategy::NAMES.
Sourcepub fn is_offered(self, dimension: Dimension) -> bool
pub fn is_offered(self, dimension: Dimension) -> bool
Whether dimension offers this strategy in this build. 2D nesting
offers every strategy but extreme point; the exact strategies only in a
build with the milp feature. 3D packing offers bottom-left (layer)
fill, extreme point and the three population/annealing searches.
Sourcepub fn offered(dimension: Dimension) -> Vec<Self>
pub fn offered(dimension: Dimension) -> Vec<Self>
The strategies dimension offers in this build, in
Strategy::NAMES order.
Sourcepub fn reads_setting(self, dimension: Dimension, setting: &str) -> bool
pub fn reads_setting(self, dimension: Dimension, setting: &str) -> bool
Whether this strategy, run in dimension, reads setting (one of
SETTINGS). This is the one table both the refusal of a setting the
strategy does not read (ConfigRequest::to_config) and the published
description of each strategy (Strategy::reads) come from.
spacing,margin,time_limit_ms: every strategy.multi_sheet: every 2D strategy (3D packing has no sheets).crossover_rate,mutation_rate: the genetic algorithm.population_size,max_generations: the two population searches.max_iterations: the single-solution searches (SA, GDRR, ALNS, and the hybrid’s ALNS fallback).seed: the stochastic searches (and the hybrid’s ALNS fallback).target_utilization: the searches that stop on a target (GA, BRKGA, SA).
A name outside SETTINGS is read by nothing.
Sourcepub fn reads(self, dimension: Dimension) -> Vec<&'static str>
pub fn reads(self, dimension: Dimension) -> Vec<&'static str>
The settings this strategy reads in dimension, in SETTINGS order
(see Self::reads_setting).
Sourcepub fn readers_of(dimension: Dimension, setting: &str) -> Vec<&'static str>
pub fn readers_of(dimension: Dimension, setting: &str) -> Vec<&'static str>
The names of the strategies dimension offers that read setting.
Sourcepub fn parse(name: &str) -> Option<Self>
pub fn parse(name: &str) -> Option<Self>
Parses a strategy name (case-insensitive, whitespace-trimmed).
Returns None for unrecognized names so callers surface an explicit
error instead of silently falling back to a default strategy (which
hides typos from consumers). This is the single source of truth for
strategy-name parsing across all bindings (C FFI, Python, WASM).
Trait Implementations§
impl Copy for Strategy
impl Eq for Strategy
impl StructuralPartialEq for Strategy
Auto Trait Implementations§
impl Freeze for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnsafeUnpin for Strategy
impl UnwindSafe for Strategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.