Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::SharedSolutionRepository< ValueType > Class Template Referenceabstract

Detailed Description

template<typename ValueType>
class operations_research::sat::SharedSolutionRepository< ValueType >

Definition at line 84 of file synchronization.h.

#include <synchronization.h>

Classes

struct  Solution

Public Member Functions

 SharedSolutionRepository (int num_solutions_to_keep, absl::string_view name="", int source_id=-1)
int NumSolutions () const
std::shared_ptr< const SolutionGetSolution (int index) const
int64_t GetBestRank () const
std::vector< std::shared_ptr< const Solution > > GetBestNSolutions (int n) const
ValueType GetVariableValueInSolution (int var_index, int solution_index) const
std::shared_ptr< const SolutionGetRandomBiasedSolution (absl::BitGenRef random) const
std::shared_ptr< const SolutionAdd (Solution solution)
void Synchronize (std::function< void(const Solution &solution)> f=nullptr)
std::vector< std::string > TableLineStats () const
int64_t NumRecentlyNonImproving () const
void ClearSolutionsAndIncreaseSourceId ()
int source_id () const
int num_queried () const
int num_solutions_to_keep () const
void SetDiversityLimit (int value)

Protected Member Functions

int source_id_ ABSL_GUARDED_BY (mutex_)
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
int64_t num_queried_at_last_sync_ ABSL_GUARDED_BY (mutex_)=0
int64_t num_non_improving_ 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_)
std::vector< int64_t > ABSL_GUARDED_BY (mutex_) distances_
std::vector< int64_t > ABSL_GUARDED_BY (mutex_) buffer_

Protected Attributes

const std::string name_
const int num_solutions_to_keep_
int diversity_limit_ = 10
absl::Mutex mutex_

Constructor & Destructor Documentation

◆ SharedSolutionRepository()

template<typename ValueType>
operations_research::sat::SharedSolutionRepository< ValueType >::SharedSolutionRepository ( int num_solutions_to_keep,
absl::string_view name = "",
int source_id = -1 )
inlineexplicit

Definition at line 86 of file synchronization.h.

Member Function Documentation

◆ ABSL_GUARDED_BY() [1/11]

template<typename ValueType>
std::vector< std::shared_ptr< Solution > > new_solutions_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protected

◆ ABSL_GUARDED_BY() [2/11]

template<typename ValueType>
std::vector< std::shared_ptr< Solution > > solutions_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protected

◆ ABSL_GUARDED_BY() [3/11]

template<typename ValueType>
std::vector< int > tmp_indices_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
mutableprotected

◆ ABSL_GUARDED_BY() [4/11]

template<typename ValueType>
int source_id_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protected

◆ ABSL_GUARDED_BY() [5/11]

template<typename ValueType>
std::vector< int64_t > operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protected

◆ ABSL_GUARDED_BY() [6/11]

template<typename ValueType>
std::vector< int64_t > operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protected

◆ ABSL_GUARDED_BY() [7/11]

template<typename ValueType>
int64_t num_non_improving_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
mutableprotectedpure virtual

◆ ABSL_GUARDED_BY() [8/11]

template<typename ValueType>
int64_t num_queried_at_last_sync_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
mutableprotectedpure virtual

◆ ABSL_GUARDED_BY() [9/11]

template<typename ValueType>
int64_t num_synchronization_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protectedpure virtual

◆ ABSL_GUARDED_BY() [10/11]

template<typename ValueType>
int64_t num_queried_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
mutableprotectedpure virtual

◆ ABSL_GUARDED_BY() [11/11]

template<typename ValueType>
int64_t num_added_ operations_research::sat::SharedSolutionRepository< ValueType >::ABSL_GUARDED_BY ( mutex_ )
protectedpure virtual

◆ Add()

template<typename ValueType>
std::shared_ptr< const typename SharedSolutionRepository< ValueType >::Solution > operations_research::sat::SharedSolutionRepository< ValueType >::Add ( Solution solution)

Definition at line 1141 of file synchronization.h.

◆ ClearSolutionsAndIncreaseSourceId()

template<typename ValueType>
void operations_research::sat::SharedSolutionRepository< ValueType >::ClearSolutionsAndIncreaseSourceId ( )
inline

Definition at line 178 of file synchronization.h.

◆ GetBestNSolutions()

template<typename ValueType>
std::vector< std::shared_ptr< const typename SharedSolutionRepository< ValueType >::Solution > > operations_research::sat::SharedSolutionRepository< ValueType >::GetBestNSolutions ( int n) const

Definition at line 1065 of file synchronization.h.

◆ GetBestRank()

template<typename ValueType>
int64_t operations_research::sat::SharedSolutionRepository< ValueType >::GetBestRank ( ) const

Definition at line 1056 of file synchronization.h.

◆ GetRandomBiasedSolution()

template<typename ValueType>
std::shared_ptr< const typename SharedSolutionRepository< ValueType >::Solution > operations_research::sat::SharedSolutionRepository< ValueType >::GetRandomBiasedSolution ( absl::BitGenRef random) const

Definition at line 1097 of file synchronization.h.

◆ GetSolution()

template<typename ValueType>
std::shared_ptr< const typename SharedSolutionRepository< ValueType >::Solution > operations_research::sat::SharedSolutionRepository< ValueType >::GetSolution ( int index) const

Definition at line 1048 of file synchronization.h.

◆ GetVariableValueInSolution()

template<typename ValueType>
ValueType operations_research::sat::SharedSolutionRepository< ValueType >::GetVariableValueInSolution ( int var_index,
int solution_index ) const

Definition at line 1088 of file synchronization.h.

◆ num_queried()

template<typename ValueType>
int operations_research::sat::SharedSolutionRepository< ValueType >::num_queried ( ) const
inline

Definition at line 190 of file synchronization.h.

◆ num_solutions_to_keep()

template<typename ValueType>
int operations_research::sat::SharedSolutionRepository< ValueType >::num_solutions_to_keep ( ) const
inline

Definition at line 195 of file synchronization.h.

◆ NumRecentlyNonImproving()

template<typename ValueType>
int64_t operations_research::sat::SharedSolutionRepository< ValueType >::NumRecentlyNonImproving ( ) const
inline

Definition at line 173 of file synchronization.h.

◆ NumSolutions()

template<typename ValueType>
int operations_research::sat::SharedSolutionRepository< ValueType >::NumSolutions ( ) const

Definition at line 1041 of file synchronization.h.

◆ SetDiversityLimit()

template<typename ValueType>
void operations_research::sat::SharedSolutionRepository< ValueType >::SetDiversityLimit ( int value)
inline

Definition at line 197 of file synchronization.h.

◆ source_id()

template<typename ValueType>
int operations_research::sat::SharedSolutionRepository< ValueType >::source_id ( ) const
inline

Definition at line 185 of file synchronization.h.

◆ Synchronize()

template<typename ValueType>
void operations_research::sat::SharedSolutionRepository< ValueType >::Synchronize ( std::function< void(const Solution &solution)> f = nullptr)

Definition at line 1155 of file synchronization.h.

◆ TableLineStats()

template<typename ValueType>
std::vector< std::string > operations_research::sat::SharedSolutionRepository< ValueType >::TableLineStats ( ) const
inline

Definition at line 167 of file synchronization.h.

Member Data Documentation

◆ diversity_limit_

template<typename ValueType>
int operations_research::sat::SharedSolutionRepository< ValueType >::diversity_limit_ = 10
protected

Definition at line 202 of file synchronization.h.

◆ mutex_

template<typename ValueType>
absl::Mutex operations_research::sat::SharedSolutionRepository< ValueType >::mutex_
mutableprotected

Definition at line 204 of file synchronization.h.

◆ name_

template<typename ValueType>
const std::string operations_research::sat::SharedSolutionRepository< ValueType >::name_
protected

Definition at line 200 of file synchronization.h.

◆ num_solutions_to_keep_

template<typename ValueType>
const int operations_research::sat::SharedSolutionRepository< ValueType >::num_solutions_to_keep_
protected

Definition at line 201 of file synchronization.h.


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