Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::KnapsackItemWithEfficiency Struct Reference

Public Member Functions

 KnapsackItemWithEfficiency (int _id, int64_t _profit, int64_t _weight, int64_t _profit_max)
 

Public Attributes

int id
 
int64_t profit
 
int64_t weight
 
double efficiency
 

Detailed Description

--— KnapsackItemWithEfficiency --— KnapsackItem is a small struct to pair an item weight with its corresponding profit. This struct is used by Knapsack64ItemsSolver. As this solver deals only with one dimension, that's more efficient to store 'efficiency' than computing it on the fly.

Definition at line 668 of file knapsack_solver.cc.

Constructor & Destructor Documentation

◆ KnapsackItemWithEfficiency()

operations_research::KnapsackItemWithEfficiency::KnapsackItemWithEfficiency ( int _id,
int64_t _profit,
int64_t _weight,
int64_t _profit_max )
inline

Definition at line 669 of file knapsack_solver.cc.

Member Data Documentation

◆ efficiency

double operations_research::KnapsackItemWithEfficiency::efficiency

Definition at line 681 of file knapsack_solver.cc.

◆ id

int operations_research::KnapsackItemWithEfficiency::id

Definition at line 678 of file knapsack_solver.cc.

◆ profit

int64_t operations_research::KnapsackItemWithEfficiency::profit

Definition at line 679 of file knapsack_solver.cc.

◆ weight

int64_t operations_research::KnapsackItemWithEfficiency::weight

Definition at line 680 of file knapsack_solver.cc.


The documentation for this struct was generated from the following file: