bazel: Fix rabbits and pheasants test

This commit is contained in:
Mizux Seiha
2021-04-06 15:50:52 +02:00
parent bafe9ff07b
commit 435a75cfd5

View File

@@ -40,18 +40,15 @@ void RunConstraintProgrammingExample() {
solver.MakePhase(rabbits, pheasants, Solver::CHOOSE_FIRST_UNBOUND,
Solver::ASSIGN_MIN_VALUE);
bool has_result = solver.Solve(db);
// Check that the problem has a solution.
if (has_result != true) {
LOG(FATAL) << "The problem does not have a solution!";
}
int count = 0;
solver.NewSearch(db);
while (solver.NextSolution()) {
count++;
LOG(INFO) << "Solution " << count << ":";
LOG(INFO) << "rabbits = " << rabbits->Value();
LOG(INFO) << "pheasants = " << rabbits->Value();
}
solver.EndSearch();
LOG(INFO) << "Number of solutions: " << count;
LOG(INFO) << "";
LOG(INFO) << "Advanced usage:";