Skip to main content

Algorithmen3DBinPackaging

Trait Algorithmen3DBinPackaging 

Source
pub trait Algorithmen3DBinPackaging
where Self: Sized,
{ // Required methods fn create_algorithmen( input: Vec<Item>, bin: Bin, ) -> Result<Self, AlgorithmenError>; fn add_item(&mut self, input: Vec<Item>) -> Result<(), AlgorithmenError>; fn remove_item(&mut self, input: Vec<Item>) -> Result<(), Vec<Item>>; fn space_left(&self) -> u32; fn check_fit_quick(input: &[Item], bin: &Bin) -> (bool, SpaceLeftBin); fn calculate(self) -> Result<SortedBin, AlgorithmenError>; fn calculate_custom<F>( self, custom_score_function: Option<F>, ) -> Result<SortedBin, AlgorithmenError> where F: Fn(&Bin, &Item, &Corners) -> f32 + Send + Sync; }
Expand description

Defines a trait for 3d Bin Packaging algorithments, so is replacing the algorithm possible

Required Methods§

Source

fn create_algorithmen( input: Vec<Item>, bin: Bin, ) -> Result<Self, AlgorithmenError>

A Algorithmen Input where all packages are there

Source

fn add_item(&mut self, input: Vec<Item>) -> Result<(), AlgorithmenError>

Add Items Later

Source

fn remove_item(&mut self, input: Vec<Item>) -> Result<(), Vec<Item>>

Remove Item If not fit give back items

Source

fn space_left(&self) -> u32

If Space is left

Source

fn check_fit_quick(input: &[Item], bin: &Bin) -> (bool, SpaceLeftBin)

Checks if the Items can be in a bin, possible fast check

Source

fn calculate(self) -> Result<SortedBin, AlgorithmenError>

A final result

the score function checks what the best position is to place a object

Used default score function

Source

fn calculate_custom<F>( self, custom_score_function: Option<F>, ) -> Result<SortedBin, AlgorithmenError>
where F: Fn(&Bin, &Item, &Corners) -> f32 + Send + Sync,

A final result

the score function checks what the best position is to place a object

In some chasses a custom is preferred

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§