Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <routing_utils.h>
Classes | |
struct | LoadLimit |
Public Member Functions | |
BinCapacities (int num_bins) | |
void | AddDimension (std::function< int64_t(int, int)> load_demand_of_item_for_bin, std::vector< LoadLimit > load_limit_per_bin) |
int | NumDimensions () const |
bool | CheckAdditionFeasibility (int item, int bin) const |
Checks whether adding item(s) is feasible w.r.t. dimensions. | |
bool | CheckAdditionsFeasibility (const std::vector< int > &items, int bin) const |
bool | AddItemToBin (int item, int bin) |
bool | RemoveItemFromBin (int item, int bin) |
Removes item from bin, return whether the bin is feasible. | |
int64_t | TotalCost () const |
Returns the total cost incurred by violating soft costs. | |
void | ClearItemsOfBin (int bin) |
Removes all items from given bin, resets the total cost. | |
void | ClearItems () |
Removes all items from all bins. | |
Tracks whether bins constrained by several nonnegative dimensions can contain items added incrementally. Also tracks soft violation costs.
Definition at line 26 of file routing_utils.h.
|
inlineexplicit |
Definition at line 28 of file routing_utils.h.
void operations_research::BinCapacities::AddDimension | ( | std::function< int64_t(int, int)> | load_demand_of_item_for_bin, |
std::vector< LoadLimit > | load_limit_per_bin ) |
Definition at line 28 of file routing_utils.cc.
bool operations_research::BinCapacities::AddItemToBin | ( | int | item, |
int | bin ) |
Adds item to bin, returns whether the bin is feasible. The item is still added even when infeasible.
Definition at line 63 of file routing_utils.cc.
bool operations_research::BinCapacities::CheckAdditionFeasibility | ( | int | item, |
int | bin ) const |
Checks whether adding item(s) is feasible w.r.t. dimensions.
Definition at line 44 of file routing_utils.cc.
bool operations_research::BinCapacities::CheckAdditionsFeasibility | ( | const std::vector< int > & | items, |
int | bin ) const |
Definition at line 48 of file routing_utils.cc.
void operations_research::BinCapacities::ClearItems | ( | ) |
Removes all items from all bins.
Definition at line 114 of file routing_utils.cc.
void operations_research::BinCapacities::ClearItemsOfBin | ( | int | bin | ) |
Removes all items from given bin, resets the total cost.
Definition at line 99 of file routing_utils.cc.
|
inline |
Definition at line 50 of file routing_utils.h.
bool operations_research::BinCapacities::RemoveItemFromBin | ( | int | item, |
int | bin ) |
Removes item from bin, return whether the bin is feasible.
Definition at line 81 of file routing_utils.cc.
|
inline |
Returns the total cost incurred by violating soft costs.
Definition at line 61 of file routing_utils.h.