21 #ifndef AIKBSPLAYTREE_H
22 #define AIKBSPLAYTREE_H
26 namespace OpenSkyNet {
37 std::list<Record> _records;
38 BinaryNode *_left, *_right;
40 BinaryNode() : _left(0), _right(0) {}
41 BinaryNode(
const std::list<Record>& records_, BinaryNode* left_, BinaryNode* right_)
42 : _records(records_), _left(left_), _right(right_) {}
54 void reclaimMemory(BinaryNode* t)
const;
60 BinaryNode* clone(BinaryNode* t)
const;
62 float calcStateScore(
int stateId, BinaryNode* t,
bool first)
const;
66 void rotateWithLeftChild(BinaryNode*& k2)
const;
67 void rotateWithRightChild(BinaryNode*& k1)
const;
78 void splay(
const Record& x, BinaryNode*& t)
const;
83 unsigned int initParamsSizeOfReservedRecords_) :
KB(maxRecords_,
84 reservedRecords_,initParamsSizeOfReservedRecords_), _root(0), _size(0) {}
91 virtual bool add(
const Record& record_,
bool disallowIfPremNameExists_=
false);
92 virtual void remove(
const Record& record_,
bool all_,
int numOfParamsToCheck_=-1);
93 virtual const std::list<Record>&
find(
const Record& record_);
96 virtual int size()
const;
97 virtual float calcStateScore(
int stateId_)
const;
103 #endif //AIKBSPLAYTREE_H
KBSplayTree()
Definition: AIKBSplayTree.h:81
KBSplayTree(const KBSplayTree &rhs_)
Definition: AIKBSplayTree.h:85
virtual bool add(const Record &record_, bool disallowIfPremNameExists_=false)
Definition: AIKBSplayTree.cpp:19
virtual void clear()
Definition: AIKBSplayTree.cpp:127
virtual int size() const
Definition: AIKBSplayTree.cpp:133
Definition: AIKBSplayTree.h:35
const KBSplayTree & operator=(const KBSplayTree &rhs_)
Definition: AIKBSplayTree.cpp:9
virtual bool isEmpty() const
Definition: AIKBSplayTree.cpp:123
virtual const std::list< Record > & find(const Record &record_)
Definition: AIKBSplayTree.cpp:113
KBSplayTree(int maxRecords_, unsigned int reservedRecords_, unsigned int initParamsSizeOfReservedRecords_)
Definition: AIKBSplayTree.h:82
virtual ~KBSplayTree()
Definition: AIKBSplayTree.h:87