17#ifndef OR_TOOLS_SAT_SUBSOLVER_H_
18#define OR_TOOLS_SAT_SUBSOLVER_H_
29#include "absl/strings/string_view.h"
33#if !defined(__PORTABLE_PLATFORM__)
75 virtual bool IsDone() {
return false; }
96 std::string
name()
const {
return name_; }
110 if (deterministic_duration <= 0)
return;
111 deterministic_time_ += deterministic_duration;
119 if (!data.empty()) data.pop_back();
126 if (!data.empty()) data.pop_back();
131 const std::string name_;
134 double deterministic_time_ = 0.0;
151 std::function<void()> f_;
181 int num_threads,
int batch_size,
182 int max_num_batches = 0);
188void SequentialLoop(std::vector<std::unique_ptr<SubSolver>>& subsolvers);
std::string ValueAsString() const override
Implemented by the subclasses.
void AddTimeInSec(double seconds)
Adds a time in seconds to this distribution.
std::string TimingInfo() const
SubSolver(absl::string_view name, SubsolverType type)
void AddTaskDeterministicDuration(double deterministic_duration)
std::string DeterministicTimingInfo() const
virtual ~SubSolver()=default
SubsolverType type() const
Returns the type of the subsolver.
virtual std::function< void()> GenerateTask(int64_t task_id)=0
virtual bool TaskIsAvailable()=0
double deterministic_time() const
std::string name() const
Returns the name of this SubSolver. Used in logs.
void AddTaskDuration(double duration_in_seconds)
virtual void Synchronize()=0
A simple wrapper to add a synchronization point in the list of subsolvers.
SynchronizationPoint(absl::string_view name, std::function< void()> f)
std::function< void()> GenerateTask(int64_t) final
bool TaskIsAvailable() final
void NonDeterministicLoop(std::vector< std::unique_ptr< SubSolver > > &subsolvers, const int num_threads)
void DeterministicLoop(std::vector< std::unique_ptr< SubSolver > > &subsolvers, int num_threads, int batch_size, int max_num_batches)
void SequentialLoop(std::vector< std::unique_ptr< SubSolver > > &subsolvers)
In SWIG mode, we don't want anything besides these top-level includes.