rework ortools samples (#4590)
This commit is contained in:
@@ -148,8 +148,8 @@ void CPIsFunCp() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::CPIsFunCp();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -198,8 +198,8 @@ void SolveJobShopExample() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SolveJobShopExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/base/logging.h"
|
||||
#include "ortools/constraint_solver/constraint_solver.h"
|
||||
// [END import]
|
||||
@@ -102,7 +105,9 @@ void NQueensCp(const int board_size) {
|
||||
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
int board_size = 8;
|
||||
if (argc > 1) {
|
||||
board_size = std::atoi(argv[1]);
|
||||
|
||||
@@ -205,8 +205,8 @@ void SolveNursesExample() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SolveNursesExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ void RunConstraintProgrammingExample() {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::RunConstraintProgrammingExample();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
#include "absl/base/log_severity.h"
|
||||
#include "absl/log/globals.h"
|
||||
#include "ortools/base/init_google.h"
|
||||
#include "ortools/constraint_solver/constraint_solver.h"
|
||||
// [END import]
|
||||
|
||||
@@ -73,7 +76,9 @@ void SimpleCpProgram() {
|
||||
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int /*argc*/, char* /*argv*/[]) {
|
||||
int main(int argc, char* argv[]) {
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SimpleCpProgram();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ void SolveProblem(SolveType solve_type) {
|
||||
} // namespace operations_research
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
InitGoogle(argv[0], &argc, &argv, true);
|
||||
absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfo);
|
||||
operations_research::SolveProblem(operations_research::LNS);
|
||||
operations_research::SolveProblem(operations_research::LS);
|
||||
operations_research::SolveProblem(operations_research::LS_WITH_FILTER);
|
||||
|
||||
Reference in New Issue
Block a user