![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
Solutions coming from the LP. More...
#include <synchronization.h>
Public Member Functions | |
SharedLPSolutionRepository (int num_solutions_to_keep) | |
void | NewLPSolution (std::vector< double > lp_solution) |
![]() | |
SharedSolutionRepository (int num_solutions_to_keep, absl::string_view name="") | |
int | NumSolutions () const |
std::shared_ptr< const Solution > | GetSolution (int index) const |
Returns the solution i where i must be smaller than NumSolutions(). | |
int64_t | GetBestRank () const |
std::vector< std::shared_ptr< const Solution > > | GetBestNSolutions (int n) const |
double | GetVariableValueInSolution (int var_index, int solution_index) const |
std::shared_ptr< const Solution > | GetRandomBiasedSolution (absl::BitGenRef random) const |
Returns a random solution biased towards good solutions. | |
std::shared_ptr< const Solution > | Add (Solution solution) |
void | Synchronize () |
std::vector< std::string > | TableLineStats () const |
Additional Inherited Members | |
![]() | |
int64_t num_added_ | ABSL_GUARDED_BY (mutex_)=0 |
int64_t num_queried_ | ABSL_GUARDED_BY (mutex_)=0 |
int64_t num_synchronization_ | ABSL_GUARDED_BY (mutex_)=0 |
std::vector< int > tmp_indices_ | ABSL_GUARDED_BY (mutex_) |
std::vector< std::shared_ptr< Solution > > solutions_ | ABSL_GUARDED_BY (mutex_) |
std::vector< std::shared_ptr< Solution > > new_solutions_ | ABSL_GUARDED_BY (mutex_) |
![]() | |
const std::string | name_ |
const int | num_solutions_to_keep_ |
absl::Mutex | mutex_ |
Solutions coming from the LP.
Definition at line 159 of file synchronization.h.
|
inlineexplicit |
Definition at line 161 of file synchronization.h.
void operations_research::sat::SharedLPSolutionRepository::NewLPSolution | ( | std::vector< double > | lp_solution | ) |
Add this solution to the pool.
We always prefer to keep the solution from the last synchronize batch.
Definition at line 76 of file synchronization.cc.