14#ifndef OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_UTILS_H_
15#define OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_UTILS_H_
29 : num_bins_(num_bins),
30 load_per_bin_(num_bins),
31 load_limits_per_bin_(num_bins),
48 std::function<int64_t(
int,
int)> load_demand_of_item_for_bin,
49 std::vector<LoadLimit> load_limit_per_bin);
50 int NumDimensions()
const {
return load_demands_per_dimension_.size(); }
70 std::vector<std::vector<int64_t>> load_per_bin_;
72 std::vector<std::vector<LoadLimit>> load_limits_per_bin_;
74 std::vector<std::function<int64_t(
int,
int)>> load_demands_per_dimension_;
82 int num_arcs, int64_t
start,
83 const std::function<int64_t(int64_t)>& next_accessor,
84 const std::function<
bool(int64_t)>& is_end,
85 const std::function<int64_t(int64_t, int64_t, int64_t)>&
86 arc_cost_for_route_start,
87 std::vector<std::pair<int64_t, int>>* most_expensive_arc_starts_and_ranks,
88 std::pair<int, int>* first_expensive_arc_indices);
BinCapacities(int num_bins)
void ClearItems()
Removes all items from all bins.
bool RemoveItemFromBin(int item, int bin)
Removes item from bin, return whether the bin is feasible.
void AddDimension(std::function< int64_t(int, int)> load_demand_of_item_for_bin, std::vector< LoadLimit > load_limit_per_bin)
void ClearItemsOfBin(int bin)
Removes all items from given bin, resets the total cost.
bool CheckAdditionsFeasibility(const std::vector< int > &items, int bin) const
bool CheckAdditionFeasibility(int item, int bin) const
Checks whether adding item(s) is feasible w.r.t. dimensions.
int64_t TotalCost() const
Returns the total cost incurred by violating soft costs.
int NumDimensions() const
bool AddItemToBin(int item, int bin)
In SWIG mode, we don't want anything besides these top-level includes.
bool FindMostExpensiveArcsOnRoute(int num_arcs, int64_t start, const std::function< int64_t(int64_t)> &next_accessor, const std::function< bool(int64_t)> &is_end, const std::function< int64_t(int64_t, int64_t, int64_t)> &arc_cost_for_route_start, std::vector< std::pair< int64_t, int > > *most_expensive_arc_starts_and_ranks, std::pair< int, int > *first_expensive_arc_indices)
int64_t cost_above_soft_max_load