19 std::vector<double> m_profit;
20 std::vector<double> m_weight;
21 double m_capacity = 0;
23 explicit Instance(
unsigned int t_n_items);
25 Instance(
const Instance&) =
default;
26 Instance(Instance&&)
noexcept =
default;
28 Instance& operator=(
const Instance&) =
default;
29 Instance& operator=(Instance&&)
noexcept =
default;
31 ~Instance() =
default;
32 [[nodiscard]]
unsigned int n_items()
const {
return m_profit.size(); }
33 [[nodiscard]]
double profit(
unsigned int t_item)
const {
return m_profit[t_item]; }
34 [[nodiscard]]
double weight(
unsigned int t_item)
const {
return m_weight[t_item]; }
35 [[nodiscard]]
double capacity()
const {
return m_capacity; }
37 void set_profit(
unsigned int t_item,
double t_value) { m_profit[t_item] = t_value; }
38 void set_weight(
unsigned int t_item,
double t_value) { m_weight[t_item] = t_value; }
39 void set_capacity(
double t_value) { m_capacity = t_value; }