Painless
A framework to ease parallelization of sequential CDCL SAT solvers
Loading...
Searching...
No Matches
PortfolioSimple.hpp
1#pragma once
2
3#include "utils/Parameters.hpp"
4#include "working/WorkingStrategy.hpp"
5
6#include "solvers/CDCL/SolverCdclInterface.hpp"
7#include "solvers/LocalSearch/LocalSearchInterface.hpp"
8
9#include "sharing/Sharer.hpp"
10
11#include "sharing/GlobalStrategies/GlobalSharingStrategy.hpp"
12#include "sharing/SharingStrategy.hpp"
13
14#include <condition_variable>
15#include <mutex>
16
24{
25 public:
27
29
30 void solve(const std::vector<int>& cube) override;
31
32 void join(WorkingStrategy* strat, SatResult res, const std::vector<int>& model) override;
33
34 void setSolverInterrupt() override;
35
36 void unsetSolverInterrupt() override;
37
38 void waitInterrupt() override;
39
40 protected:
41 std::atomic<bool> strategyEnding;
42
43 // Solvers
44 //--------
45 std::vector<std::shared_ptr<SolverCdclInterface>> cdclSolvers;
46 std::vector<std::shared_ptr<LocalSearchInterface>> localSolvers;
47
48 // Sharing
49 //--------
50
51 std::vector<std::shared_ptr<SharingStrategy>> localStrategies;
52 std::vector<std::shared_ptr<GlobalSharingStrategy>> globalStrategies;
53 std::vector<std::unique_ptr<Sharer>> sharers;
54};
A Simple Implementation of WorkingStrategy for the portfolio parallel strategy This strategy uses the...
Definition PortfolioSimple.hpp:24
Base Interface for Working Strategies.
Definition WorkingStrategy.hpp:18
SatResult
Enumeration for SAT solver results.
Definition SolverInterface.hpp:39