Struct cut_optimizer_2d::Optimizer
source · [−]pub struct Optimizer { /* private fields */ }
Expand description
Optimizer for optimizing rectangular cut pieces from rectangular stock pieces.
Implementations
sourceimpl Optimizer
impl Optimizer
sourcepub fn add_stock_piece(&mut self, stock_piece: StockPiece) -> &mut Self
pub fn add_stock_piece(&mut self, stock_piece: StockPiece) -> &mut Self
Add a stock piece that the optimizer can use to optimize cut pieces.
If the same stock piece is added multiple times, the quantities will be
summed up. If any have a None
quantity, the quantity on other equivalent
pieces will be ignored.
sourcepub fn add_stock_pieces<I>(&mut self, stock_pieces: I) -> &mut Self where
I: IntoIterator<Item = StockPiece>,
pub fn add_stock_pieces<I>(&mut self, stock_pieces: I) -> &mut Self where
I: IntoIterator<Item = StockPiece>,
Add a stock pieces that the optimizer can use to optimize cut pieces.
If the same stock piece is added multiple times, the quantities will be
summed up. If any have a None
quantity, the quantity on other equivalent
pieces will be ignored.
sourcepub fn add_cut_piece(&mut self, cut_piece: CutPiece) -> &mut Self
pub fn add_cut_piece(&mut self, cut_piece: CutPiece) -> &mut Self
Add a desired cut piece that you need cut from a stock piece.
sourcepub fn add_cut_pieces<I>(&mut self, cut_pieces: I) -> &mut Self where
I: IntoIterator<Item = CutPiece>,
pub fn add_cut_pieces<I>(&mut self, cut_pieces: I) -> &mut Self where
I: IntoIterator<Item = CutPiece>,
Add desired cut pieces that you need cut from a stock piece.
sourcepub fn set_cut_width(&mut self, cut_width: usize) -> &mut Self
pub fn set_cut_width(&mut self, cut_width: usize) -> &mut Self
Set the width of the cut to use between cut pieces. This could represent blade or kerf thickness.
sourcepub fn set_random_seed(&mut self, seed: u64) -> &mut Self
pub fn set_random_seed(&mut self, seed: u64) -> &mut Self
Set the random seed used by the genetic algorithms in the optimizer. Using the same random seed will give you the same result for the same input.
sourcepub fn allow_mixed_stock_sizes(&mut self, allow: bool) -> &mut Self
pub fn allow_mixed_stock_sizes(&mut self, allow: bool) -> &mut Self
Set whether the optimizer should allow mixed sized stock pieces in the results. If set to false, and multiple stock sizes are given, only one stock size will be used in the results.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Optimizer
impl Send for Optimizer
impl Sync for Optimizer
impl Unpin for Optimizer
impl UnwindSafe for Optimizer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more