![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Small wrapper containing all the shared classes between our subsolver threads. Note that all these classes can also be retrieved with something like global_model->GetOrCreate<Class>() but it is not thread-safe to do so.
All the classes here should be thread-safe, or at least safe in the way they are accessed. For instance the model_proto will be kept constant for the whole duration of the solve.
Definition at line 44 of file cp_model_solver_helpers.h.
#include <cp_model_solver_helpers.h>
Public Member Functions | |
SharedClasses (const CpModelProto *proto, Model *global_model) | |
void | RegisterSharedClassesInLocalModel (Model *local_model) |
bool | SearchIsDone () |
Public Attributes | |
const CpModelProto & | model_proto |
These are never nullptr. | |
WallTimer *const | wall_timer |
ModelSharedTimeLimit *const | time_limit |
SolverLogger *const | logger |
SharedStatistics *const | stats |
SharedStatTables *const | stat_tables |
SharedResponseManager *const | response |
SharedTreeManager *const | shared_tree_manager |
SharedLsSolutionRepository *const | ls_hints |
std::unique_ptr< SharedBoundsManager > | bounds |
These can be nullptr depending on the options. | |
std::unique_ptr< SharedLPSolutionRepository > | lp_solutions |
std::unique_ptr< SharedIncompleteSolutionManager > | incomplete_solutions |
std::unique_ptr< SharedClausesManager > | clauses |
operations_research::sat::SharedClasses::SharedClasses | ( | const CpModelProto * | proto, |
Model * | global_model ) |
Create extra shared classes if needed. Note that while these parameters are true by default, we disable them if we don't have enough workers for them in AdaptGlobalParameters().
Registering them to the global model should not really be necessary, except if one wants to expect them from outside SolveCpModel().
Set up synchronization mode in parallel.
Definition at line 2077 of file cp_model_solver_helpers.cc.
void operations_research::sat::SharedClasses::RegisterSharedClassesInLocalModel | ( | Model * | local_model | ) |
call local_model->Register() on most of the class here, this allow to more easily depends on one of the shared class deep within the solver.
Definition at line 2120 of file cp_model_solver_helpers.cc.
bool operations_research::sat::SharedClasses::SearchIsDone | ( | ) |
This is for cases where the time limit is checked more often.
Definition at line 2145 of file cp_model_solver_helpers.cc.
std::unique_ptr<SharedBoundsManager> operations_research::sat::SharedClasses::bounds |
These can be nullptr depending on the options.
Definition at line 59 of file cp_model_solver_helpers.h.
std::unique_ptr<SharedClausesManager> operations_research::sat::SharedClasses::clauses |
Definition at line 62 of file cp_model_solver_helpers.h.
std::unique_ptr<SharedIncompleteSolutionManager> operations_research::sat::SharedClasses::incomplete_solutions |
Definition at line 61 of file cp_model_solver_helpers.h.
SolverLogger* const operations_research::sat::SharedClasses::logger |
Definition at line 51 of file cp_model_solver_helpers.h.
std::unique_ptr<SharedLPSolutionRepository> operations_research::sat::SharedClasses::lp_solutions |
Definition at line 60 of file cp_model_solver_helpers.h.
SharedLsSolutionRepository* const operations_research::sat::SharedClasses::ls_hints |
Definition at line 56 of file cp_model_solver_helpers.h.
const CpModelProto& operations_research::sat::SharedClasses::model_proto |
These are never nullptr.
Definition at line 48 of file cp_model_solver_helpers.h.
SharedResponseManager* const operations_research::sat::SharedClasses::response |
Definition at line 54 of file cp_model_solver_helpers.h.
SharedTreeManager* const operations_research::sat::SharedClasses::shared_tree_manager |
Definition at line 55 of file cp_model_solver_helpers.h.
SharedStatTables* const operations_research::sat::SharedClasses::stat_tables |
Definition at line 53 of file cp_model_solver_helpers.h.
SharedStatistics* const operations_research::sat::SharedClasses::stats |
Definition at line 52 of file cp_model_solver_helpers.h.
ModelSharedTimeLimit* const operations_research::sat::SharedClasses::time_limit |
Definition at line 50 of file cp_model_solver_helpers.h.
WallTimer* const operations_research::sat::SharedClasses::wall_timer |
Definition at line 49 of file cp_model_solver_helpers.h.