pub struct KnapsackSolution {
pub selected: Vec<usize>,
pub total_value: Value,
pub total_weight: Weight,
pub status: SolverStatus,
pub stats: SolverStats,
}Expand description
Solution to a knapsack problem
Fields§
§selected: Vec<usize>Selected items (indices)
total_value: ValueTotal value of selected items
total_weight: WeightTotal weight of selected items
status: SolverStatusSolver status
stats: SolverStatsSolver statistics
Trait Implementations§
Source§impl Clone for KnapsackSolution
impl Clone for KnapsackSolution
Source§fn clone(&self) -> KnapsackSolution
fn clone(&self) -> KnapsackSolution
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KnapsackSolution
impl Debug for KnapsackSolution
Source§impl<'de> Deserialize<'de> for KnapsackSolution
impl<'de> Deserialize<'de> for KnapsackSolution
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KnapsackSolution
impl RefUnwindSafe for KnapsackSolution
impl Send for KnapsackSolution
impl Sync for KnapsackSolution
impl Unpin for KnapsackSolution
impl UnsafeUnpin for KnapsackSolution
impl UnwindSafe for KnapsackSolution
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