-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwolworklist.h
63 lines (46 loc) · 1.21 KB
/
wolworklist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* wolworklist.h
*
* Created on: Sep 22, 2014
* Author: user
*/
#ifndef WOLWORKLIST_H_
#define WOLWORKLIST_H_
#include <unordered_set>
#include "common.h"
namespace wolver {
class WolNode;
struct expHashW
: std::unary_function<WolNodeSptr, std::size_t>
{
std::size_t operator()(WolNodeSptr const& x) const;
};
struct expEqualToW
: std::binary_function<WolNodeSptr, WolNodeSptr, bool>
{
bool operator()(WolNodeSptr const& x, WolNodeSptr const& y) const;
};
class WolWorkList {
public:
typedef std::unordered_set<WolNodeSptr>::iterator Iterator;
public:
WolWorkList() {}
~WolWorkList() {}
public: //methods
void addNode(WolNodeSptr node);
void addNodes(nodeL &nodes);
void addNodes(std::vector<WolNodeSptr> &nodes);
void setImplyFlag();
void unsetImplyFlag();
bool isEmpty() {return _workList.empty();}
bool performImplication(nodeL &changes, WolWorkList &wl);
WolWorkList getNeighbors();
std::string str();
// Iterator begin() { return _workList.begin();}
// Iterator end() {return _workList.end();}
private: // methods
private: //data
std::unordered_set<WolNodeSptr, expHashW, expEqualToW > _workList;
};
}
#endif /* WOLWORKLIST_H_ */