jagua_rs/probs/bpp/entities/
bin.rs

1use crate::entities::Container;
2
3#[derive(Debug, Clone)]
4/// A container in the Bin Packing Problem (BPP) with an associated cost and stock.
5pub struct Bin {
6    /// Unique identifier for the bin
7    pub id: usize,
8    /// The container in which to pack the items
9    pub container: Container,
10    /// The number of copies of this bin available to be use
11    pub stock: usize,
12    /// The cost of using a bin of this type
13    pub cost: u64,
14}
15
16impl Bin {
17    /// Creates a new bin with the given id, container, stock, and cost.
18    pub fn new(container: Container, stock: usize, cost: u64) -> Self {
19        Self {
20            id: container.id,
21            container,
22            stock,
23            cost,
24        }
25    }
26}