1
#ifndef ISEARCHSTRATEGY_H
2
#define ISEARCHSTRATEGY_H
4
#include "CTL/DependencyGraph/Edge.h"
7
namespace SearchStrategy {
12
enum Type {HALT = 0, REQUEST = 1, ANSWER_ONE = 2, ANSWER_ZERO = 3} type;
13
DependencyGraph::Configuration *configuration;
16
Message(size_t sender, uint32_t distance, Type type, DependencyGraph::Configuration *configuration) :
17
sender(sender), distance(distance), type(type), configuration(configuration) {}
19
std::string ToString() {
21
ss << "Message from " << sender << ": ";
22
ss << (type == HALT ? "Halt" : type == REQUEST ? "Request" : type == ANSWER_ONE ? "Answer 1" : "Answer 0");
23
ss << configuration << "\n";
32
virtual ~SearchStrategy() {};
34
void pushEdge(DependencyGraph::Edge *edge);
35
void pushDependency(DependencyGraph::Edge* edge);
36
void pushNegation(DependencyGraph::Edge *edge);
37
DependencyGraph::Edge* popEdge(bool saturate = false);
40
uint32_t maxDistance() const;
41
bool available() const;
42
void releaseNegationEdges(uint32_t );
43
bool trivialNegation();
44
virtual void flush() {};
47
virtual size_t Wsize() const = 0;
48
virtual void pushToW(DependencyGraph::Edge* edge) = 0;
49
virtual DependencyGraph::Edge* popFromW() = 0;
51
std::vector<DependencyGraph::Edge*> N;
52
std::vector<DependencyGraph::Edge*> D;
56
#endif // SEARCHSTRATEGY_H