pub struct BPInstance {
pub items: Vec<(Arc<Item>, usize)>,
pub bins: Vec<Bin>,
}Expand description
Instance of the Bin Packing Problem.
Fields§
§items: Vec<(Arc<Item>, usize)>The items to be packed and their demands
bins: Vec<Bin>Set of bins available to pack the items
Implementations§
Source§impl BPInstance
impl BPInstance
pub fn new(items: Vec<(Arc<Item>, usize)>, bins: Vec<Bin>) -> Self
pub fn item_area(&self) -> f32
pub fn item_qty(&self, idx: usize) -> usize
pub fn bins(&self) -> impl Iterator<Item = &Bin>
pub fn bin_qty(&self, id: usize) -> usize
pub fn total_item_qty(&self) -> usize
Trait Implementations§
Source§impl Clone for BPInstance
impl Clone for BPInstance
Source§fn clone(&self) -> BPInstance
fn clone(&self) -> BPInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BPInstance
impl RefUnwindSafe for BPInstance
impl Send for BPInstance
impl Sync for BPInstance
impl Unpin for BPInstance
impl UnsafeUnpin for BPInstance
impl UnwindSafe for BPInstance
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more