|
| 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.
|
|
| ~HordeSatSharing () |
| Destructor 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 the producer for the coming round.
|
|
void | importClauses (const std::vector< ClauseExchangePtr > &v_clauses) override |
| Imports multiple clauses.
|
|
bool | doSharing () override |
| Performs the sharing operation. It checks the literal production to decide if the lbd limit should be increased, decreased or unchanged. The selection of clauses from the database is exported to all consumers.
|
|
| SharingStrategy (const std::vector< std::shared_ptr< SharingEntity > > &producers, const std::vector< std::shared_ptr< SharingEntity > > &consumers, const std::shared_ptr< ClauseDatabase > &clauseDB) |
| Constructor for SharingStrategy. Be sure to call connectConstructorProducers after construction, this is due to the base class shared_from_this.
|
|
virtual | ~SharingStrategy () |
| Virtual destructor.
|
|
virtual std::chrono::microseconds | getSleepingTime () |
| Determines the sleeping time for the sharer.
|
|
virtual void | printStats () |
| Prints the statistics of the strategy.
|
|
void | connectConstructorProducers () |
| Add this to the producers' clients list.
|
|
virtual void | connectProducer (std::shared_ptr< SharingEntity > producer) |
| Connect a producer to this strategy. Add (this) to clients of (producer)
|
|
| SharingEntity () |
| Construct a new SharingEntity object.
|
|
| SharingEntity (const std::vector< std::shared_ptr< SharingEntity > > &clients) |
| Construct a new SharingEntity object.
|
|
virtual | ~SharingEntity () |
| Destroy the SharingEntity object.
|
|
int | getSharingId () const |
| Get the sharing ID of this entity.
|
|
void | setSharingId (int _id) |
| Set the sharing ID of this entity.
|
|
virtual void | addClient (std::shared_ptr< SharingEntity > client) |
| Add a client to this entity.
|
|
virtual void | removeClient (std::shared_ptr< SharingEntity > client) |
| Remove a specific client from this entity.
|
|
size_t | getClientCount () const |
| Get the current number of clients.
|
|
void | clearClients () |
| Remove all clients.
|
|
|
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 production for the producer.
|
|
void | removeProducer (std::shared_ptr< SharingEntity > producer) override |
| Removes a producer from the sharing strategy.
|
|
bool | exportClauseToClient (const ClauseExchangePtr &clause, std::shared_ptr< SharingEntity > client) override |
| A SharingStrategy doesn't send a clause to the source client (->from must store the sharingId of its producer)
|
|
bool | exportClause (const ClauseExchangePtr &clause) |
| Export a clause to all registered clients.
|
|
void | exportClauses (const std::vector< ClauseExchangePtr > &clauses) |
| Export multiple clauses to all registered clients.
|
|
|
unsigned long | literalPerRound |
| Number of shared literals per round.
|
|
unsigned int | initialLbdLimit |
| Initial lbd value for per producer filter.
|
|
unsigned int | roundBeforeIncrease |
| Number of rounds before forcing an increase in production.
|
|
int | round |
| Round Number.
|
|
std::vector< ClauseExchangePtr > | selection |
| Used to manipulate clauses (as a member to reduce number of allocations).
|
|
std::unordered_map< unsigned int, std::atomic< unsigned int > > | lbdLimitPerProducer |
| SharingEntity id to lbdLimit.
|
|
std::unordered_map< unsigned int, std::atomic< unsigned long > > | literalsPerProducer |
| Metadata for clause database.
|
|
std::shared_ptr< ClauseDatabase > | m_clauseDB |
| Clause database where exported clauses are stored.
|
|
SharingStatistics | stats |
| Sharing statistics.
|
|
std::vector< std::weak_ptr< SharingEntity > > | m_producers |
| The set holding the references to the producers.
|
|
std::shared_mutex | m_producersMutex |
| Shared mutex for producers list (to become RCU ?)
|
|
std::vector< std::weak_ptr< SharingEntity > > | m_clients |
| List of weak pointers to client SharingEntities.
|
|
std::shared_mutex | m_clientsMutex |
| Mutex to protect access to m_clients.
|
|
This strategy is a HordeSat-like sharing strategy.
- Todo
- Strengthening strategy + keep units for future ones in derived classes?