This commit is contained in:
Laurent Perron
2019-07-01 15:54:04 +02:00
parent eccfa72779
commit db90fdef06

View File

@@ -345,6 +345,14 @@ void SharedResponseManager::SetStatsFromModelInternal(Model* model) {
bool SharedResponseManager::ProblemIsSolved() const {
absl::MutexLock mutex_lock(&mutex_);
// TODO(user): Currently this work because we do not allow enumerate all
// solution in multithread.
if (!model_proto_.has_objective() &&
best_response_.status() == CpSolverStatus::FEASIBLE) {
return true;
}
return best_response_.status() == CpSolverStatus::OPTIMAL ||
best_response_.status() == CpSolverStatus::INFEASIBLE;
}