Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::SharedLPSolutionRepository Class Reference

Solutions coming from the LP. More...

Detailed Description

Solutions coming from the LP.

Definition at line 159 of file synchronization.h.

#include <synchronization.h>

Inheritance diagram for operations_research::sat::SharedLPSolutionRepository:
operations_research::sat::SharedSolutionRepository< double >

Public Member Functions

 SharedLPSolutionRepository (int num_solutions_to_keep)
void NewLPSolution (std::vector< double > lp_solution)
Public Member Functions inherited from operations_research::sat::SharedSolutionRepository< double >
 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

Protected Member Functions inherited from operations_research::sat::SharedSolutionRepository< double >
int64_t num_added_ ABSL_GUARDED_BY (mutex_)=0
Protected Attributes inherited from operations_research::sat::SharedSolutionRepository< double >
const std::string name_
const int num_solutions_to_keep_
absl::Mutex mutex_

Constructor & Destructor Documentation

◆ SharedLPSolutionRepository()

operations_research::sat::SharedLPSolutionRepository::SharedLPSolutionRepository ( int num_solutions_to_keep)
inlineexplicit

Definition at line 161 of file synchronization.h.

Member Function Documentation

◆ NewLPSolution()

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 77 of file synchronization.cc.


The documentation for this class was generated from the following files: