cleanup bin_packing_cft
This commit is contained in:
@@ -37,10 +37,10 @@ void BinPackingModel::set_bin_capacity(Cost capacity) {
|
||||
LOG(WARNING) << "Bin capacity must be positive.";
|
||||
return;
|
||||
}
|
||||
bin_capcaity_ = capacity;
|
||||
bin_capacity_ = capacity;
|
||||
}
|
||||
void BinPackingModel::AddItem(Cost weight) {
|
||||
if (weight > bin_capcaity_) {
|
||||
if (weight > bin_capacity_) {
|
||||
LOG(WARNING) << "Element weight exceeds bin capacity.";
|
||||
return;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ void AddRandomizedBins(const BinPackingModel& model, BaseInt num_bins,
|
||||
items.push_back(n);
|
||||
|
||||
if (unique_bin_num == scp_model.full_model().num_subsets()) {
|
||||
VLOG(1) << "No new bins generated.";
|
||||
LOG(INFO) << "No new bins generated.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class BinPackingModel {
|
||||
public:
|
||||
BinPackingModel() = default;
|
||||
BaseInt num_items() const { return weigths_.size(); }
|
||||
Cost bin_capacity() const { return bin_capcaity_; }
|
||||
Cost bin_capacity() const { return bin_capacity_; }
|
||||
void set_bin_capacity(Cost capacity);
|
||||
const ElementCostVector& weights() const { return weigths_; }
|
||||
void AddItem(Cost weight);
|
||||
@@ -44,7 +44,7 @@ class BinPackingModel {
|
||||
|
||||
private:
|
||||
bool is_sorted_ = false;
|
||||
Cost bin_capcaity_ = .0;
|
||||
Cost bin_capacity_ = .0;
|
||||
ElementCostVector weigths_ = {};
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ void KnapsackTest() {
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
// KnapsackTest();
|
||||
// return 0;
|
||||
|
||||
@@ -141,4 +141,4 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user