3#include "sharing/Filters/BloomFilter.hpp"
4#include "sharing/SharingStrategy.hpp"
7#include <unordered_map>
34 unsigned long literalsPerProducerPerRound,
36 unsigned int roundsBeforeLbdIncrease,
37 const std::vector<std::shared_ptr<SharingEntity>>& producers = {},
38 const std::vector<std::shared_ptr<SharingEntity>>& consumers = {});
59 void importClauses(
const std::vector<ClauseExchangePtr>& v_clauses)
override
61 for (
auto clause : v_clauses)
81 void addProducer(std::shared_ptr<SharingEntity> producer)
override
121 static constexpr int UNDER_UTILIZATION_THRESHOLD = 75;
122 static constexpr int OVER_UTILIZATION_THRESHOLD = 98;
This strategy is a HordeSat-like sharing strategy.
Definition HordeSatSharing.hpp:22
~HordeSatSharing()
Destructor for HordeSatSharing.
int round
Round Number.
Definition HordeSatSharing.hpp:113
std::unordered_map< unsigned int, std::atomic< unsigned long > > literalsPerProducer
Metadata for clause database.
Definition HordeSatSharing.hpp:131
bool doSharing() override
Performs the sharing operation. It checks the literal production to decide if the lbd limit should be...
void addProducer(std::shared_ptr< SharingEntity > producer) override
Adds a producer to the sharing strategy. It initializes the lbd limit and the per round literal produ...
Definition HordeSatSharing.hpp:81
void importClauses(const std::vector< ClauseExchangePtr > &v_clauses) override
Imports multiple clauses.
Definition HordeSatSharing.hpp:59
std::unordered_map< unsigned int, std::atomic< unsigned int > > lbdLimitPerProducer
SharingEntity id to lbdLimit.
Definition HordeSatSharing.hpp:128
unsigned int initialLbdLimit
Initial lbd value for per producer filter.
Definition HordeSatSharing.hpp:107
unsigned long literalPerRound
Number of shared literals per round.
Definition HordeSatSharing.hpp:104
unsigned int roundBeforeIncrease
Number of rounds before forcing an increase in production.
Definition HordeSatSharing.hpp:110
std::vector< ClauseExchangePtr > selection
Used to manipulate clauses (as a member to reduce number of allocations).
Definition HordeSatSharing.hpp:116
HordeSatSharing(const std::shared_ptr< ClauseDatabase > &clauseDB, unsigned long literalsPerProducerPerRound, unsigned int initialLbdLimit, unsigned int roundsBeforeLbdIncrease, const std::vector< std::shared_ptr< SharingEntity > > &producers={}, const std::vector< std::shared_ptr< SharingEntity > > &consumers={})
Constructor for HordeSatSharing.
bool importClause(const ClauseExchangePtr &clause) override
Imports a single clause if the lbd limit is respected. And updates the amount of literals exprted by ...
void removeProducer(std::shared_ptr< SharingEntity > producer) override
Removes a producer from the sharing strategy.
Definition HordeSatSharing.hpp:94
SharingStrategy class, inheriting from SharingEntity.
Definition SharingStrategy.hpp:26
virtual void removeProducer(std::shared_ptr< SharingEntity > producer)
Removes a producer from this strategy.
Definition SharingStrategy.hpp:120
virtual void addProducer(std::shared_ptr< SharingEntity > producer)
Adds a producer to this strategy.
Definition SharingStrategy.hpp:98