Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
OpenSkyNet::AI::KBSplayTree Class Reference

#include <AIKBSplayTree.h>

Inheritance diagram for OpenSkyNet::AI::KBSplayTree:

Public Member Functions

 KBSplayTree ()
 KBSplayTree (int maxRecords_, unsigned int reservedRecords_, unsigned int initParamsSizeOfReservedRecords_)
 KBSplayTree (const KBSplayTree &rhs_)
const KBSplayTreeoperator= (const KBSplayTree &rhs_)
virtual ~KBSplayTree ()
KB interface methods
virtual bool add (const Record &record_, bool disallowIfPremNameExists_=false)
virtual void remove (const Record &record_, bool all_, int numOfParamsToCheck_=-1)
virtual const std::list< Record > & find (const Record &record_)
virtual bool isEmpty () const
virtual void clear ()
virtual int size () const
virtual float calcStateScore (int stateId_) const
- Public Member Functions inherited from OpenSkyNet::AI::KB
 KB ()
 KB (int maxRecords_, unsigned int reservedRecords_, unsigned int initParamsSizeOfReservedRecords_)

Additional Inherited Members

- Public Attributes inherited from OpenSkyNet::AI::KB
std::vector< Record_reservedRecords
 for constant time (speed-critical) access of Records More...
- Protected Attributes inherited from OpenSkyNet::AI::KB
const int _maxRecords
- Static Protected Attributes inherited from OpenSkyNet::AI::KB
static const std::list< RecordRECORDS_NOT_FOUND

Detailed Description

KBSplayTree is one implementation of a knowledge base. Frequently used or recently accessed nodes sit near the top of the tree, allowing fast search. All operations complexity: Expected Time O(lg N) [amortized] Worst-Case Time O(N)

Constructor & Destructor Documentation

OpenSkyNet::AI::KBSplayTree::KBSplayTree ( )
OpenSkyNet::AI::KBSplayTree::KBSplayTree ( int  maxRecords_,
unsigned int  reservedRecords_,
unsigned int  initParamsSizeOfReservedRecords_ 
OpenSkyNet::AI::KBSplayTree::KBSplayTree ( const KBSplayTree rhs_)
virtual OpenSkyNet::AI::KBSplayTree::~KBSplayTree ( )

Member Function Documentation

bool KBSplayTree::add ( const Record record_,
bool  disallowIfPremNameExists_ = false 

Implements OpenSkyNet::AI::KB.

float KBSplayTree::calcStateScore ( int  stateId_) const

iterates through the KB, totaling the badGoodScaleValue of each Record that has _stateIdAtCreation == stateId

Implements OpenSkyNet::AI::KB.

void KBSplayTree::clear ( )

removes all entries EXCEPT for the reserved slots

Implements OpenSkyNet::AI::KB.

const list< Record > & KBSplayTree::find ( const Record record_)

Implements OpenSkyNet::AI::KB.

bool KBSplayTree::isEmpty ( ) const

Implements OpenSkyNet::AI::KB.

const KBSplayTree & KBSplayTree::operator= ( const KBSplayTree rhs_)
void KBSplayTree::remove ( const Record record_,
bool  all_,
int  numOfParamsToCheck_ = -1 

Implements OpenSkyNet::AI::KB.

int KBSplayTree::size ( ) const

does NOT include the reserved slots

Implements OpenSkyNet::AI::KB.

The documentation for this class was generated from the following files: