pub trait Algorithmen3DBinPackagingwhere
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§
Sourcefn create_algorithmen(
input: Vec<Item>,
bin: Bin,
) -> Result<Self, AlgorithmenError>
fn create_algorithmen( input: Vec<Item>, bin: Bin, ) -> Result<Self, AlgorithmenError>
A Algorithmen Input where all packages are there
Sourcefn remove_item(&mut self, input: Vec<Item>) -> Result<(), Vec<Item>>
fn remove_item(&mut self, input: Vec<Item>) -> Result<(), Vec<Item>>
Remove Item If not fit give back items
Sourcefn space_left(&self) -> u32
fn space_left(&self) -> u32
If Space is left
Sourcefn check_fit_quick(input: &[Item], bin: &Bin) -> (bool, SpaceLeftBin)
fn check_fit_quick(input: &[Item], bin: &Bin) -> (bool, SpaceLeftBin)
Checks if the Items can be in a bin, possible fast check
Sourcefn calculate(self) -> Result<SortedBin, AlgorithmenError>
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
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.