Skip to main content

Crate u_nesting_core

Crate u_nesting_core 

Source
Expand description

§U-Nesting Core

Core traits and abstractions for the U-Nesting spatial optimization engine.

This crate provides the foundational types and traits that are shared between the 2D nesting and 3D bin packing modules.

§Core Components

§Optimization Strategies

The Strategy enum defines available optimization algorithms:

StrategySpeedQualityDescription
BottomLeftFillFastBasicGreedy bottom-left placement
NfpGuidedMediumGoodNFP-based optimal positioning (2D)
GeneticAlgorithmSlowHighGA with permutation encoding
BrkgaMediumHighBiased Random-Key GA
SimulatedAnnealingMediumHighTemperature-based optimization
ExtremePointFastGoodEP heuristic (3D only)

§Configuration

Use Config to configure solver behavior:

use u_nesting_core::{Config, Strategy};

let config = Config::new()
    .with_strategy(Strategy::GeneticAlgorithm)
    .with_spacing(2.0)
    .with_margin(5.0)
    .with_time_limit(30000);

§Feature Flags

  • serde: Enable serialization/deserialization support

Re-exports§

pub use alns::AlnsConfig;
pub use alns::AlnsProblem;
pub use alns::AlnsProgress;
pub use alns::AlnsResult;
pub use alns::AlnsRunner;
pub use alns::AlnsSolution;
pub use alns::DestroyOperatorId;
pub use alns::DestroyResult;
pub use alns::OperatorStats;
pub use alns::RepairOperatorId;
pub use alns::RepairResult;
pub use brkga::BrkgaConfig;
pub use brkga::BrkgaProblem;
pub use brkga::BrkgaProgress;
pub use brkga::BrkgaResult;
pub use brkga::BrkgaRunner;
pub use brkga::RandomKeyChromosome;
pub use error::Error;
pub use error::Result;
pub use exact::ExactConfig;
pub use exact::ExactResult;
pub use exact::SolutionStatus;
pub use ga::GaConfig;
pub use ga::GaProblem;
pub use ga::GaProgress;
pub use ga::GaResult;
pub use ga::GaRunner;
pub use ga::Individual;
pub use gdrr::GdrrConfig;
pub use gdrr::GdrrProblem;
pub use gdrr::GdrrProgress;
pub use gdrr::GdrrResult;
pub use gdrr::GdrrRunner;
pub use gdrr::GdrrSolution;
pub use gdrr::RecreateResult;
pub use gdrr::RuinResult;
pub use gdrr::RuinType;
pub use gdrr::RuinedItem;
pub use geometry::check_quantity;
pub use geometry::Boundary;
pub use geometry::Boundary2DExt;
pub use geometry::Boundary3DExt;
pub use geometry::Geometry;
pub use geometry::Geometry2DExt;
pub use geometry::Geometry3DExt;
pub use geometry::GeometryId;
pub use geometry::RotationConstraint;
pub use placement::Placement;
pub use result::SolveResult;
pub use result::SolveSummary;
pub use sa::CoolingSchedule;
pub use sa::NeighborhoodOperator;
pub use sa::PermutationSolution;
pub use sa::SaConfig;
pub use sa::SaProblem;
pub use sa::SaProgress;
pub use sa::SaResult;
pub use sa::SaRunner;
pub use sa::SaSolution;
pub use solver::Config;
pub use solver::ProgressCallback;
pub use solver::ProgressInfo;
pub use solver::Solver;
pub use solver::Strategy;
pub use transform::Transform2D;
pub use transform::Transform3D;
pub use transform::AABB2D;
pub use transform::AABB3D;

Modules§

alns
Adaptive Large Neighborhood Search (ALNS) Framework
brkga
Biased Random-Key Genetic Algorithm (BRKGA) framework.
error
Error types for U-Nesting.
exact
Exact solver configuration and result types.
ga
Genetic Algorithm framework for optimization.
gdrr
Goal-Driven Ruin and Recreate (GDRR) Framework
geom
Re-exports from u-geometry for direct access to generic computational geometry.
geometry
Core geometry traits and types.
memory
Memory optimization utilities.
metaheur
Re-exports from u-metaheur for direct access to generic optimization frameworks.
placement
Placement representation for positioned geometries.
result
Solve result representation.
robust
Robust geometric predicates for numerical stability.
sa
Simulated Annealing framework for optimization.
solver
Solver traits and configuration.
timing
WASM-compatible timing abstraction.
transform
Transform types for 2D and 3D coordinate transformations.

Enums§

StopReason
Why a solve stopped – the same vocabulary every runner in u-metaheur reports, so a nesting run and any other search say it in one set of words. Each strategy here sets it where it stops; Completed is a fill that tried every piece, or a search that spent the budget it is given internally. Why a run stopped: the run’s own account of the solution it returns.