pub struct Knapsack {
pub items: Vec<(u32, u32, u32)>,
pub capacity: u32,
}Expand description
A bi-objective 0/1 knapsack: maximise two values (returned negated as costs) under a weight capacity; the violation is the excess weight.
Fields§
§items: Vec<(u32, u32, u32)>Per item: (weight, value_1, value_2).
capacity: u32The weight capacity.
Implementations§
Trait Implementations§
impl Eq for Knapsack
Source§impl MultiObjective<Vec<bool>> for Knapsack
impl MultiObjective<Vec<bool>> for Knapsack
Source§fn objectives(&self) -> usize
fn objectives(&self) -> usize
The number of objectives,
m >= 1; constant for the lifetime of the problem.impl StructuralPartialEq for Knapsack
Auto Trait Implementations§
impl Forget for Knapsack
impl Freeze for Knapsack
impl Move for Knapsack
impl RefUnwindSafe for Knapsack
impl Send for Knapsack
impl Sync for Knapsack
impl Unpin for Knapsack
impl UnsafeUnpin for Knapsack
impl UnwindSafe for Knapsack
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