diff --git a/ortools/algorithms/bin_packing.cc b/ortools/set_cover/samples/bin_packing.cc similarity index 99% rename from ortools/algorithms/bin_packing.cc rename to ortools/set_cover/samples/bin_packing.cc index 0f512b131b..c89a8ee4db 100644 --- a/ortools/algorithms/bin_packing.cc +++ b/ortools/set_cover/samples/bin_packing.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ortools/algorithms/bin_packing.h" +#include "ortools/set_cover/samples/bin_packing.h" #include #include @@ -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; } } diff --git a/ortools/algorithms/bin_packing.h b/ortools/set_cover/samples/bin_packing.h similarity index 95% rename from ortools/algorithms/bin_packing.h rename to ortools/set_cover/samples/bin_packing.h index 17ce141784..5bdba77135 100644 --- a/ortools/algorithms/bin_packing.h +++ b/ortools/set_cover/samples/bin_packing.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef OR_TOOLS_ORTOOLS_ALGORITHMS_BIN_PACKING_H -#define OR_TOOLS_ORTOOLS_ALGORITHMS_BIN_PACKING_H +#ifndef OR_TOOLS_ORTOOLS_SET_COVER_SAMPLES_BIN_PACKING_H +#define OR_TOOLS_ORTOOLS_SET_COVER_SAMPLES_BIN_PACKING_H #include #include @@ -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_ = {}; }; @@ -177,4 +177,4 @@ void AddRandomizedBins(const BinPackingModel& model, BaseInt num_bins, BinPackingSetCoverModel& scp_model, std::mt19937& rnd); } // namespace operations_research -#endif /* OR_TOOLS_ORTOOLS_ALGORITHMS_BIN_PACKING_H */ +#endif /* OR_TOOLS_ORTOOLS_SET_COVER_SAMPLES_BIN_PACKING_H */ diff --git a/ortools/algorithms/samples/bin_packing_cft.cc b/ortools/set_cover/samples/bin_packing_cft.cc similarity index 97% rename from ortools/algorithms/samples/bin_packing_cft.cc rename to ortools/set_cover/samples/bin_packing_cft.cc index 0eafd47416..4a311d71e1 100644 --- a/ortools/algorithms/samples/bin_packing_cft.cc +++ b/ortools/set_cover/samples/bin_packing_cft.cc @@ -18,10 +18,10 @@ #include #include -#include "ortools/algorithms/bin_packing.h" #include "ortools/base/init_google.h" #include "ortools/set_cover/base_types.h" #include "ortools/set_cover/set_cover_cft.h" +#include "ortools/set_cover/samples/bin_packing.h" using namespace operations_research; ABSL_FLAG(std::string, instance, "", "BPP instance int RAIL format."); @@ -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; -} \ No newline at end of file +}