43void ParseAndSolve(
const std::string& filename, absl::string_view solver,
44 const std::string& params) {
45 std::string problem_name = filename;
46 const size_t found = problem_name.find_last_of(
"/\\");
47 if (found != std::string::npos) {
48 problem_name = problem_name.substr(found + 1);
50 if (absl::EndsWith(problem_name,
".vbp")) {
52 problem_name.resize(problem_name.size() - 4);
59 LOG(FATAL) <<
"Cannot read " << filename;
66 <<
"Ignoring max_bins value. The feasibility problem is not supported.";
69 LOG(INFO) <<
"Solving vector packing problem '" << data.
name() <<
"' with "
70 << data.
item_size() <<
" item types, and "
72 if (absl::GetFlag(FLAGS_display_proto)) {
81 data, solver_type, params, absl::GetFlag(FLAGS_time_limit),
82 absl::GetFlag(FLAGS_threads), absl::GetFlag(FLAGS_max_bins));
84 for (
int b = 0; b <
solution.bins_size(); ++b) {
85 LOG(INFO) <<
"Bin " << b;
98int main(
int argc,
char** argv) {
99 absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
101 if (absl::GetFlag(FLAGS_input).empty()) {
102 LOG(FATAL) <<
"Please supply a data file with --input=";
106 absl::GetFlag(FLAGS_solver),
107 absl::GetFlag(FLAGS_params));
vbp::VectorBinPackingSolution SolveVectorBinPackingWithArcFlow(const vbp::VectorBinPackingProblem &problem, MPSolver::OptimizationProblemType solver_type, const std::string &mip_params, double time_limit, int num_threads, int max_bins)
ABSL_FLAG(std::string, input, "", "Vector Bin Packing (.vpb) data file name.")
int main(int argc, char **argv)