Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <shaving_solver.h>
Classes | |
struct | State |
Public Member Functions | |
VariablesShavingSolver (const SatParameters &local_parameters, SharedClasses *shared) | |
~VariablesShavingSolver () override | |
bool | TaskIsAvailable () override |
void | ProcessLocalResponse (const CpSolverResponse &local_response, const State &state) |
std::function< void()> | GenerateTask (int64_t task_id) override |
void | Synchronize () override |
Public Member Functions inherited from operations_research::sat::SubSolver | |
SubSolver (absl::string_view name, SubsolverType type) | |
virtual | ~SubSolver ()=default |
virtual bool | IsDone () |
double | deterministic_time () const |
std::string | name () const |
Returns the name of this SubSolver. Used in logs. | |
SubsolverType | type () const |
Returns the type of the subsolver. | |
void | AddTaskDuration (double duration_in_seconds) |
void | AddTaskDeterministicDuration (double deterministic_duration) |
std::string | TimingInfo () const |
std::string | DeterministicTimingInfo () const |
Additional Inherited Members | |
Public Types inherited from operations_research::sat::SubSolver | |
enum | SubsolverType { FULL_PROBLEM , FIRST_SOLUTION , INCOMPLETE , HELPER } |
Definition at line 80 of file shaving_solver.h.
operations_research::sat::VariablesShavingSolver::VariablesShavingSolver | ( | const SatParameters & | local_parameters, |
SharedClasses * | shared ) |
Definition at line 254 of file shaving_solver.cc.
|
override |
Definition at line 271 of file shaving_solver.cc.
|
overridevirtual |
Returns a task to run. The task_id is just an ever increasing counter that correspond to the number of total calls to GenerateTask().
This is only called by the main thread.
Implements operations_research::sat::SubSolver.
Definition at line 314 of file shaving_solver.cc.
void operations_research::sat::VariablesShavingSolver::ProcessLocalResponse | ( | const CpSolverResponse & | local_response, |
const State & | state ) |
Definition at line 287 of file shaving_solver.cc.
|
overridevirtual |
Synchronizes with the external world from this SubSolver point of view. Also incorporate the results of the latest completed tasks if any.
Note(user): The intended implementation for determinism is that tasks update asynchronously (and so non-deterministically) global "shared" classes, but this global state is incorporated by the Subsolver only when Synchronize() is called.
This is only called by the main thread in Subsolver creation order.
We are just waiting for the inner code to check the time limit or to return nicely.
Implements operations_research::sat::SubSolver.
Definition at line 334 of file shaving_solver.cc.
|
overridevirtual |
Returns true iff GenerateTask() can be called. This is only called by the main thread in a sequential fashion.
Implements operations_research::sat::SubSolver.
Definition at line 283 of file shaving_solver.cc.