[CP-SAT] improve deterministic search code
This commit is contained in:
@@ -393,6 +393,7 @@ void SharedResponseManager::Synchronize() {
|
||||
IntegerValue(inner_objective_lower_bound_);
|
||||
synchronized_inner_objective_upper_bound_ =
|
||||
IntegerValue(inner_objective_upper_bound_);
|
||||
synchronized_best_status_ = best_status_;
|
||||
}
|
||||
|
||||
IntegerValue SharedResponseManager::SynchronizedInnerObjectiveLowerBound() {
|
||||
@@ -693,8 +694,8 @@ void SharedResponseManager::NewSolution(
|
||||
|
||||
bool SharedResponseManager::ProblemIsSolved() const {
|
||||
absl::MutexLock mutex_lock(&mutex_);
|
||||
return best_status_ == CpSolverStatus::OPTIMAL ||
|
||||
best_status_ == CpSolverStatus::INFEASIBLE;
|
||||
return synchronized_best_status_ == CpSolverStatus::OPTIMAL ||
|
||||
synchronized_best_status_ == CpSolverStatus::INFEASIBLE;
|
||||
}
|
||||
|
||||
std::string ExtractSubSolverName(const std::string& improvement_info) {
|
||||
|
||||
@@ -368,6 +368,8 @@ class SharedResponseManager {
|
||||
double relative_gap_limit_ ABSL_GUARDED_BY(mutex_) = 0.0;
|
||||
|
||||
CpSolverStatus best_status_ ABSL_GUARDED_BY(mutex_) = CpSolverStatus::UNKNOWN;
|
||||
CpSolverStatus synchronized_best_status_ ABSL_GUARDED_BY(mutex_) =
|
||||
CpSolverStatus::UNKNOWN;
|
||||
std::vector<int> unsat_cores_ ABSL_GUARDED_BY(mutex_);
|
||||
SharedSolutionRepository<int64_t> solutions_ ABSL_GUARDED_BY(mutex_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user